summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2021-03-15 17:10:10 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2021-03-19 20:40:21 +0100
commit69bcdb4cffe2c3a12e215b6cf5d99f18e49a5973 (patch)
treeb6bf83048aa43b7fc653854fc82e13daba9175c1 /sfx2
parent01d6d4419e08c16d5488970d3f3ad9f059ee2625 (diff)
lok: switch to the correct view before any UI update is done via SfxBindings.
Change-Id: I541e53b4219340233ed5a4bec407ded5adf6a841 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112538 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/bindings.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 1d6fd0d62441..6be545d382bf 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -55,6 +55,9 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/msgpool.hxx>
+#include <sfx2/viewsh.hxx>
+#include <sfx2/lokhelper.hxx>
+#include <comphelper/lok.hxx>
#include <cstddef>
#include <memory>
@@ -1240,6 +1243,26 @@ bool SfxBindings::NextJob_Impl(Timer const * pTimer)
SfxApplication *pSfxApp = SfxGetpApp();
+ // Switch to the right view for state update.
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ if( pDispatcher )
+ {
+ SfxViewFrame* pFrame = pDispatcher->GetFrame();
+ if (pFrame)
+ {
+ vcl::Window* pFrameWin = pFrame->GetWindow().GetFrameWindow();
+ if (pFrameWin && pFrameWin->GetLOKNotifier()) {
+ const SfxViewShell* pView = dynamic_cast<const SfxViewShell*>(pFrameWin->GetLOKNotifier());
+ if (pView)
+ {
+ SfxLokHelper::setView(pView->GetViewShellId().get());
+ }
+ }
+ }
+ }
+ }
+
if( pDispatcher )
pDispatcher->Update_Impl();