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

Ashod Nakashian (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 25 12:40:39 UTC 2019


 sd/source/ui/view/Outliner.cxx |   32 +++++++++++++++++++-------------
 1 file changed, 19 insertions(+), 13 deletions(-)

New commits:
commit 188ff24ee209d4f5f8ec6a6ae82241e56f0be6d5
Author:     Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sat May 25 12:15:00 2019 -0400
Commit:     Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Mon Nov 25 13:40:01 2019 +0100

    sd: LOK: don't access null dispatcher
    
    With SpellDialog invoked from multiple views
    the dispatcher can indeed be null in some cases.
    
    (cherry picked from commit b18c12f4dbe91379cef795d559c2d84341e32a75)
    
    Change-Id: Ic2950e70383a77d63438341fac174d369748b36a
    Reviewed-on: https://gerrit.libreoffice.org/83631
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index ed25f27e2d34..5d9181475d45 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1418,23 +1418,29 @@ void SdOutliner::EnterEditMode (bool bGrabFocus)
         // Make FuText the current function.
         SfxUInt16Item aItem (SID_TEXTEDIT, 1);
         std::shared_ptr<sd::ViewShell> pViewShell (mpWeakViewShell.lock());
-        pViewShell->GetDispatcher()->ExecuteList(SID_TEXTEDIT,
-                SfxCallMode::SYNCHRON | SfxCallMode::RECORD, { &aItem });
+        if (pViewShell && pViewShell->GetDispatcher())
+        {
+            pViewShell->GetDispatcher()->ExecuteList(
+                SID_TEXTEDIT, SfxCallMode::SYNCHRON | SfxCallMode::RECORD, { &aItem });
 
-        // To be consistent with the usual behaviour in the Office the text
-        // object that is put into edit mode would have also to be selected.
-        // Starting the text edit mode is not enough so we do it here by
-        // hand.
-        mpView->UnmarkAllObj (pPV);
-        mpView->MarkObj (mpSearchSpellTextObj, pPV);
+            // To be consistent with the usual behaviour in the Office the text
+            // object that is put into edit mode would have also to be selected.
+            // Starting the text edit mode is not enough so we do it here by
+            // hand.
+            mpView->UnmarkAllObj (pPV);
+            mpView->MarkObj (mpSearchSpellTextObj, pPV);
 
-        mpSearchSpellTextObj->setActiveText( mnText );
+            mpSearchSpellTextObj->setActiveText( mnText );
 
-        // Turn on the edit mode for the text object.
-        mpView->SdrBeginTextEdit(mpSearchSpellTextObj, pPV, mpWindow, true, this, pOutlinerView, true, true, bGrabFocus);
+            // Make sure we aren't editing already.
+            mpView->SdrEndTextEdit();
 
-        SetUpdateMode(true);
-        mbFoundObject = true;
+            // Turn on the edit mode for the text object.
+            mpView->SdrBeginTextEdit(mpSearchSpellTextObj, pPV, mpWindow, true, this, pOutlinerView, true, true, bGrabFocus);
+
+            SetUpdateMode(true);
+            mbFoundObject = true;
+        }
     }
 }
 


More information about the Libreoffice-commits mailing list