[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 3 commits - sfx2/source sw/source

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 1 13:53:58 UTC 2021


 sfx2/source/control/unoctitm.cxx             |    2 +-
 sfx2/source/sidebar/SidebarDockingWindow.cxx |    8 ++++----
 sw/source/uibase/uno/unotxdoc.cxx            |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 6b3bee079b3d40bf287168d4f34f9e80f5c7b984
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Wed Dec 30 12:07:10 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 1 15:52:35 2021 +0200

    lok: send uno command state update to the right view.
    
    We get the correct view as a parameter(pViewFrame).
    
    Change-Id: I36e99a7660fee69c6c7cb10977763b1136eb6e22
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108511
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108557
    Tested-by: Jenkins

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index b32235b4ca48..e291eb472a25 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1324,7 +1324,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, SfxViewFrame* pViewFra
     else
     {
         // Try to send JSON state version
-        SfxLokHelper::sendUnoStatus(SfxViewShell::Current(), pState);
+        SfxLokHelper::sendUnoStatus(pViewFrame->GetViewShell(), pState);
 
         return;
     }
commit 3ad5deda9b0adae5e107e26b913c0c79371d10f6
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Dec 29 08:59:54 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 1 15:52:16 2021 +0200

    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 at gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108456
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index c3bbe327fab7..a7b752af67eb 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -60,13 +60,13 @@ public:
     void Invoke() override
     {
         auto pNotifier = m_rSidebarDockingWin.GetLOKNotifier();
-        auto pMobileNotifier = SfxViewShell::Current();
-        if (!pNotifier || (!pMobileNotifier && !comphelper::LibreOfficeKit::isActive()))
+        if (!pNotifier || !comphelper::LibreOfficeKit::isActive())
             return;
 
         try
         {
-            if (pMobileNotifier && pMobileNotifier->isLOKMobilePhone())
+            const SfxViewShell* pOwnerView = dynamic_cast<const SfxViewShell*>(pNotifier);
+            if (pOwnerView && pOwnerView->isLOKMobilePhone())
             {
                 // Mobile phone.
                 tools::JsonWriter aJsonWriter;
@@ -77,7 +77,7 @@ public:
                 if (message != m_LastNotificationMessage)
                 {
                     m_LastNotificationMessage = message;
-                    pMobileNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, m_LastNotificationMessage.c_str());
+                    pOwnerView->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, m_LastNotificationMessage.c_str());
                 }
             }
 
commit 7e9b99c5f2148fcfc4b7e7aa2d012cf387106521
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Dec 28 14:28:06 2020 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Apr 1 15:52:01 2021 +0200

    Fix crash in SwXTextDocument::getSelection() method.
    
    pWrtShell was nullptr. This crash was triggered by
    an collaborative editing use case.
    
    Change-Id: Id64298b424f5ac4d96df97581c6fe3067e799eb3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108417
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 7261aaa79fc1..05f4acf2f9c5 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3583,7 +3583,7 @@ uno::Reference<datatransfer::XTransferable> SwXTextDocument::getSelection()
     uno::Reference<datatransfer::XTransferable> xTransferable;
 
     SwWrtShell* pWrtShell = m_pDocShell->GetWrtShell();
-    if (SdrView* pSdrView = pWrtShell->GetDrawView())
+    if (SdrView* pSdrView = pWrtShell ? pWrtShell->GetDrawView() : nullptr)
     {
         if (pSdrView->GetTextEditObject())
         {


More information about the Libreoffice-commits mailing list