diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-10-08 17:45:49 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-10-08 17:47:20 +0200 |
commit | cf0ef681854ad53a0bdeff31ff5c49c8c31da99b (patch) | |
tree | 235b7f2d24d1be3be1bfbdefafccbc6a77d0f7ac /sw | |
parent | cf955c621269011eaa71ee7e51647203f6120110 (diff) |
SwXTextDocument::getFlatParagraphIterator: fix crash:
Check if the document is still valid. Crash in idle handler grammar
checker observed on libreoffice-3-5 branch.
Change-Id: I3cae1c6726bb9ad5be11f59bc33f8550bbbe1883
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/uno/unotxdoc.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index ef09ecf5a026..52d989de90e7 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -3033,6 +3033,12 @@ uno::Reference< text::XFlatParagraphIterator > SAL_CALL SwXTextDocument::getFlat throw ( uno::RuntimeException ) { SolarMutexGuard aGuard; + if (!IsValid()) + { + throw DisposedException("SwXTextDocument not valid", + static_cast<XTextDocument*>(this)); + } + return new SwXFlatParagraphIterator( *pDocShell->GetDoc(), nTextMarkupType, bAutomatic ); } |