sw/source/uibase/shells/textsh1.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
New commits: commit d5b0d5b1aa379d7cc758f6206ac9b3143868f75e Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Mon Jul 18 08:21:43 2022 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Jul 18 09:05:57 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/+/137161 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 8d7c07e104ca..1fee0e9759d5 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1536,9 +1536,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& ) {