summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-05 10:00:13 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-04-05 12:08:15 +0100
commit58b56f8c78eef15c70e1afd6b52c79a800a185ab (patch)
treeea228269daff76c03492162c0b0ef4093ca4c766 /oox
parent1fd19d3e45bd192de2ceae84724653a9f722d51c (diff)
add a clearDocumentHandler for null document handler case
Change-Id: I661a2fd5381013056c69b379792560aed7121214
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/fastparser.cxx7
-rw-r--r--oox/source/core/xmlfilterbase.cxx2
2 files changed, 8 insertions, 1 deletions
diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx
index 4ce9d9f37cf7..d31ee7067f1c 100644
--- a/oox/source/core/fastparser.cxx
+++ b/oox/source/core/fastparser.cxx
@@ -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
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 393911c97699..8401dd7ce59d 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -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)