diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-06-30 20:03:28 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-06-30 20:06:33 -0400 |
commit | dc93074f71f91efd8a615ad8f1a5289deb210b75 (patch) | |
tree | 8143bd8e995c443b2c82936c06443fee5e700b65 /oox | |
parent | 712d60f03d4c7dfa1ec56e49f40036ab7eb25fde (diff) |
Use a new fast parser instance for each XML fragment.
Otherwise a crash ensues when the threaded XML parsing kicks in.
Change-Id: Ic41e5a29bbb860d7b63b70f2f0d8896264d9d53e
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 486946cedad6..af0567b5c8e1 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -171,6 +171,7 @@ struct XmlFilterBaseImpl { typedef RefMap< OUString, Relations > RelationsMap; + Reference<XComponentContext> mxContext; FastParser maFastParser; const OUString maBinSuffix; const OUString maVmlSuffix; @@ -182,6 +183,7 @@ struct XmlFilterBaseImpl }; XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + mxContext(rxContext), maFastParser( rxContext ), maBinSuffix( ".bin" ), maVmlSuffix( ".vml" ) @@ -272,7 +274,9 @@ OUString XmlFilterBase::getFragmentPathFromFirstTypeFromOfficeDoc( const OUStrin bool XmlFilterBase::importFragment( const rtl::Reference<FragmentHandler>& rxHandler ) { - return importFragment(rxHandler, mxImpl->maFastParser); + FastParser aParser(mxImpl->mxContext); + registerNamespaces(aParser); + return importFragment(rxHandler, aParser); } bool XmlFilterBase::importFragment( const rtl::Reference<FragmentHandler>& rxHandler, FastParser& rParser ) |