Resolves: tdf#145464 ensure the SfxViewFrame is activated
before dispatching SID_SIGNATURE, its normally activated on getting
focus, but its possible to move focus into the button of the infobar
without the frame getting focus.
Change-Id: Id353e23b595e14614361c0c25976c788940c67eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124534
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 1182ad5..6f7e3fc 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1512,6 +1512,13 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
IMPL_LINK_NOARG(SfxObjectShell, SignDocumentHandler, weld::Button&, void)
{
SfxViewFrame *pFrame = SfxViewFrame::GetFirst(this);
if (!pFrame)
{
SAL_WARN("sfx.appl", "There should be some SfxViewFrame associated here");
return;
}
pFrame->MakeActive_Impl(false);
GetDispatcher()->Execute(SID_SIGNATURE);
}