sd/source/ui/view/Outliner.cxx | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-)
New commits: commit 188ff24ee209d4f5f8ec6a6ae82241e56f0be6d5 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Sat May 25 12:15:00 2019 -0400 Commit: Ashod Nakashian <ashnak...@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 <jenkinscollaboraoff...@gmail.com> Reviewed-by: Ashod Nakashian <ashnak...@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; + } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits