summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-07-18 08:21:43 +0200
committerAron Budea <aron.budea@collabora.com>2022-11-10 00:13:15 +0100
commit94647d0e903c90543e40d073e9896b1e26fd5d69 (patch)
treec2ad54ab02ff31a4336318d96c5a8f0241fbe8b2
parent5a472b364062dd60434ac714ba3cd127b2a3ec30 (diff)
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 <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit d5b0d5b1aa379d7cc758f6206ac9b3143868f75e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142450 Reviewed-by: Aron Budea <aron.budea@collabora.com>
-rw-r--r--sw/source/uibase/shells/textsh1.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index e8bae3666ca5..829b42c5a968 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1478,9 +1478,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& )
{