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> | 2020-12-29 12:25:37 +0100 |
commit | a6a3b9b665a874e98cedebbb2566d57285a40772 (patch) | |
tree | b1c773ee7a94c72a3af0c42633b4487a9840f08b /sfx2 | |
parent | 2d7152efbe4420b9ff192d0eccb47b674a8bb666 (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>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/SidebarDockingWindow.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx index 8bb1f164c125..1ef2ed8fc107 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.cxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx @@ -63,8 +63,12 @@ public: try { - auto pMobileNotifier = SfxViewShell::Current(); - if (pMobileNotifier && pMobileNotifier->isLOKMobilePhone()) + auto pNotifier = m_rSidebarDockingWin.GetLOKNotifier(); + if (!pNotifier) + return; + + const SfxViewShell* pOwnerView = dynamic_cast<const SfxViewShell*>(pNotifier); + if (pOwnerView && pOwnerView->isLOKMobilePhone()) { // Mobile. std::stringstream aStream; @@ -75,16 +79,12 @@ public: if (message != m_LastNotificationMessage) { m_LastNotificationMessage = message; - pMobileNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str()); + pOwnerView->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, message.c_str()); } } // Notify the sidebar is created, and its LOKWindowId, which // is needed on mobile phones, tablets, and desktop. - auto pNotifier = m_rSidebarDockingWin.GetLOKNotifier(); - if (!pNotifier) - return; - const Point pos(m_rSidebarDockingWin.GetOutOffXPixel(), m_rSidebarDockingWin.GetOutOffYPixel()); const OString posMessage = pos.toString(); |