[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sfx2/source

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Mon May 11 07:07:39 UTC 2020


 sfx2/source/sidebar/SidebarDockingWindow.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 1467a33543f56d4e6472d5e05ffdd8e6e41bc607
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun May 10 16:34:25 2020 -0400
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Mon May 11 09:07:09 2020 +0200

    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 at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

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();


More information about the Libreoffice-commits mailing list