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/+/124468
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 4d8b13e..c295c5c 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1511,6 +1511,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);
}