sfx2/source/sidebar/SidebarDockingWindow.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
New commits: commit a6a3b9b665a874e98cedebbb2566d57285a40772 Author: Tamás Zolnai <[email protected]> AuthorDate: Tue Dec 29 08:59:54 2020 +0100 Commit: Tamás Zolnai <[email protected]> CommitDate: Tue Dec 29 12:25:37 2020 +0100 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 <[email protected]> Reviewed-by: Tamás Zolnai <[email protected]> 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(); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
