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:
Michael Stahl 2012-10-08 17:45:49 +02:00
parent cf955c6212
commit cf0ef68185

View File

@ -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 );
}