diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2020-05-10 16:34:25 -0400 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2020-05-11 09:07:09 +0200 |
commit | 1467a33543f56d4e6472d5e05ffdd8e6e41bc607 (patch) | |
tree | 3c03dda5063c991a957a49e1916acfc758c6cba2 | |
parent | f71fe05e37a96e35537cd212fbc331794707f91d (diff) |
sfx2: lok: separate sidebar notifications to mobile and desktop
If we have two notifiers for mobile and non-mobile,
we should check them separately, so we can support
one without the other.
Also, correctly check for null before dereferencing.
Change-Id: I3f21d2f4d5d430b7c876aaf4e90d5b4e55df04ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93944
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | sfx2/source/sidebar/SidebarDockingWindow.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx index ed4ac31d81c6..302605d6a65a 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.cxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx @@ -55,14 +55,13 @@ public: void Invoke() override { - auto pNotifier = m_rSidebarDockingWin.GetLOKNotifier(); - auto pMobileNotifier = SfxViewShell::Current(); - if (!pNotifier || (!pMobileNotifier && !comphelper::LibreOfficeKit::isActive())) + if (!comphelper::LibreOfficeKit::isActive()) return; try { - if (pMobileNotifier->isLOKMobilePhone()) + auto pMobileNotifier = SfxViewShell::Current(); + if (pMobileNotifier && pMobileNotifier->isLOKMobilePhone()) { // Mobile phone. std::stringstream aStream; @@ -79,6 +78,10 @@ public: // 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(); |