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
This commit is contained in:
@@ -3033,6 +3033,12 @@ uno::Reference< text::XFlatParagraphIterator > SAL_CALL SwXTextDocument::getFlat
|
|||||||
throw ( uno::RuntimeException )
|
throw ( uno::RuntimeException )
|
||||||
{
|
{
|
||||||
SolarMutexGuard aGuard;
|
SolarMutexGuard aGuard;
|
||||||
|
if (!IsValid())
|
||||||
|
{
|
||||||
|
throw DisposedException("SwXTextDocument not valid",
|
||||||
|
static_cast<XTextDocument*>(this));
|
||||||
|
}
|
||||||
|
|
||||||
return new SwXFlatParagraphIterator( *pDocShell->GetDoc(), nTextMarkupType, bAutomatic );
|
return new SwXFlatParagraphIterator( *pDocShell->GetDoc(), nTextMarkupType, bAutomatic );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user