[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sfx2/source
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jan 20 20:17:56 UTC 2021
sfx2/source/sidebar/SidebarDockingWindow.cxx | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
New commits:
commit 90511b3c20be54284eaad1d3c888cf2d1ca16569
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Dec 29 08:59:54 2020 +0100
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Wed Jan 20 21:17:22 2021 +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.
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108444
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
(cherry picked from commit a6a3b9b665a874e98cedebbb2566d57285a40772)
Change-Id: I2a3f18eaf51e4bf9a9f811595ec4fc02ce86fa7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109622
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 302605d6a65a..737b9195b617 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -60,8 +60,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 phone.
std::stringstream aStream;
@@ -72,16 +76,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 = Point(m_rSidebarDockingWin.GetOutOffXPixel(),
m_rSidebarDockingWin.GetOutOffYPixel());
const OString posMessage = pos.toString();
More information about the Libreoffice-commits
mailing list