diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-06-30 20:03:28 -0400 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-07-01 10:55:03 +0000 |
commit | c14063522433306c9b7f598b623d54fefd2a443d (patch) | |
tree | 648a2c2b3dc977a51baa3180eff5a6c95351ff9b /oox | |
parent | 45c73dfd98321dd1977cfa7b7cfb3a92c1fb9a29 (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
(cherry picked from commit dc93074f71f91efd8a615ad8f1a5289deb210b75)
Reviewed-on: https://gerrit.libreoffice.org/10003
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
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 cf996ebf6110..1608aed57888 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -158,6 +158,7 @@ struct XmlFilterBaseImpl { typedef RefMap< OUString, Relations > RelationsMap; + Reference<XComponentContext> mxContext; FastParser maFastParser; const OUString maBinSuffix; const OUString maVmlSuffix; @@ -170,6 +171,7 @@ struct XmlFilterBaseImpl XmlFilterBaseImpl::XmlFilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : + mxContext(rxContext), maFastParser( rxContext ), maBinSuffix( ".bin" ), maVmlSuffix( ".vml" ) @@ -268,7 +270,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 ) |