[Libreoffice-commits] core.git: sd/source
Ashod Nakashian (via logerrit)
logerrit at kemper.freedesktop.org
Sun Dec 22 15:23:49 UTC 2019
sd/source/ui/view/Outliner.cxx | 40 ++++++++++++++++++++++------------------
1 file changed, 22 insertions(+), 18 deletions(-)
New commits:
commit d33378691500f02c8004645dadd403c2a72e4fee
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: Sun Dec 22 16:22:57 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)
Reviewed-on: https://gerrit.libreoffice.org/83631
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
(cherry picked from commit 188ff24ee209d4f5f8ec6a6ae82241e56f0be6d5)
Change-Id: Ic2950e70383a77d63438341fac174d369748b36a
Reviewed-on: https://gerrit.libreoffice.org/85676
Tested-by: Jenkins
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 d3bd66724c7b..e67d823e9a11 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1402,29 +1402,33 @@ 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 (mpView->IsTextEdit())
+ if (pViewShell && pViewShell->GetDispatcher())
{
- // end text edition before starting it again
- mpView->SdrEndTextEdit();
- }
+ 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);
+ if (mpView->IsTextEdit())
+ {
+ // end text edition before starting it again
+ mpView->SdrEndTextEdit();
+ }
- mpSearchSpellTextObj->setActiveText( mnText );
+ // 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);
- // Turn on the edit mode for the text object.
- mpView->SdrBeginTextEdit(mpSearchSpellTextObj, pPV, mpWindow, true, this, pOutlinerView, true, true, bGrabFocus);
+ mpSearchSpellTextObj->setActiveText(mnText);
- 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;
+ }
}
ESelection SdOutliner::GetSearchStartPosition() const
More information about the Libreoffice-commits
mailing list