From 367369c6f93521da562c5e72e54264eb29ff8432 Mon Sep 17 00:00:00 2001 From: Tamás Zolnai Date: Tue, 29 Dec 2020 08:59:54 +0100 Subject: lok: send sidebar dialog update to the right view. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Tamás Zolnai Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108456 Tested-by: Tamás Zolnai --- sfx2/source/sidebar/SidebarDockingWindow.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sfx2/source/sidebar') 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(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()); } } -- cgit