diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2020-12-29 08:59:54 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2021-01-01 12:31:55 +0100 |
commit | 367369c6f93521da562c5e72e54264eb29ff8432 (patch) | |
tree | 77fc0ebeb32f25ae20c7ba58c76701f6a3a68f76 | |
parent | 7b36e8718036377ad5e370151099aa15c3c9a067 (diff) |
lok: send sidebar dialog update to the right view.
SfxViewShell::Current() might point to wrong client,
not the actual owner of the sidebar. Better to use
the LOKNotifier which points to the correct view.
Change-Id: I2a3f18eaf51e4bf9a9f811595ec4fc02ce86fa7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108444
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108456
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r-- | sfx2/source/sidebar/SidebarDockingWindow.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx index 46b62f51ad93..9958e7943aee 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.cxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx @@ -60,13 +60,13 @@ public: void Invoke() override { auto pNotifier = m_rSidebarDockingWin.GetLOKNotifier(); - auto pMobileNotifier = SfxViewShell::Current(); - if (!pNotifier || (!pMobileNotifier && !comphelper::LibreOfficeKit::isActive())) + if (!pNotifier || !comphelper::LibreOfficeKit::isActive()) return; try { - if (pMobileNotifier && pMobileNotifier->isLOKMobilePhone()) + const SfxViewShell* pOwnerView = dynamic_cast<const SfxViewShell*>(pNotifier); + if (pOwnerView && pOwnerView->isLOKMobilePhone()) { // Mobile phone. tools::JsonWriter aJsonWriter; @@ -77,7 +77,7 @@ public: if (message != m_LastNotificationMessage) { m_LastNotificationMessage = message; - pMobileNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, m_LastNotificationMessage.c_str()); + pOwnerView->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, m_LastNotificationMessage.c_str()); } } |