sw/source/uibase/shells/textsh1.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
New commits: commit c1339170226b7c348f463b6a189aa86eed7839d5 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Mon Jul 18 08:21:43 2022 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Jul 18 21:23:32 2022 +0200 sw: fix crash in SwTextShell::Execute() Crashreport signature: SwTextShell::Execute(SfxRequest&) sw/source/uibase/shells/textsh1.cxx:1540 SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) sfx2/source/control/dispatch.cxx:256 SfxDispatcher::Execute(unsigned short, SfxCallMode, SfxItemSet const*, SfxItemSet const*, unsigned short) sfx2/source/control/dispatch.cxx:811 SfxDispatchController_Impl::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> const&) sfx2/source/control/unoctitm.cxx:671 This is the Grammar case, the Spelling case already checked for an empty xDictionary reference. Change-Id: If1f88e4bdf2d68d877fbb0bd89d0cadbd493771f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137198 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins (cherry picked from commit c6d242ebf0d3ca5e57ac7d6e894d800faa38d15a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137176 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 326716127493..68ebb51f5ed6 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1533,9 +1533,12 @@ void SwTextShell::Execute(SfxRequest &rReq) SwPaM *pPaM = rWrtSh.GetCursor(); if (pPaM) SwEditShell::IgnoreGrammarErrorAt( *pPaM ); - // refresh the layout of all paragraphs (workaround to launch a dictionary event) - xDictionary->setActive(false); - xDictionary->setActive(true); + if (xDictionary.is()) + { + // refresh the layout of all paragraphs (workaround to launch a dictionary event) + xDictionary->setActive(false); + xDictionary->setActive(true); + } } catch( const uno::Exception& ) {