Kaydet (Commit) 58b56f8c authored tarafından Caolán McNamara's avatar Caolán McNamara

add a clearDocumentHandler for null document handler case

Change-Id: I661a2fd5381013056c69b379792560aed7121214
üst 1fd19d3e
......@@ -78,6 +78,8 @@ public:
void setDocumentHandler(
const css::uno::Reference< css::xml::sax::XFastDocumentHandler >& rxDocHandler );
void clearDocumentHandler();
/** Parses the passed SAX input source.
@param bCloseStream True = closes the stream in the input source after parsing.
@throws css::xml::sax::SAXException
......
......@@ -107,6 +107,13 @@ void FastParser::setDocumentHandler( const Reference< XFastDocumentHandler >& rx
mxParser->setFastDocumentHandler( rxDocHandler );
}
void FastParser::clearDocumentHandler()
{
if (!mxParser.is())
return;
mxParser->setFastDocumentHandler(nullptr);
}
void FastParser::parseStream( const InputSource& rInputSource, bool bCloseStream )
{
// guard closing the input stream also when exceptions are thrown
......
......@@ -211,7 +211,7 @@ XmlFilterBase::~XmlFilterBase()
// the following implicit destruction chain of ~XmlFilterBaseImpl, but in that
// case it's member RelationsMap maRelationsMap will be destroyed, but maybe
// still be used by ~FragmentHandler -> crash.
mxImpl->maFastParser.setDocumentHandler( nullptr );
mxImpl->maFastParser.clearDocumentHandler();
}
void XmlFilterBase::checkDocumentProperties(const Reference<XDocumentProperties>& xDocProps)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment