diff options
author | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2016-09-25 11:06:32 +0530 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-25 13:22:51 +0000 |
commit | 5678bc99fb685fe09191e8419a1121e565f97f80 (patch) | |
tree | daf36cf7506eea6dc9ecd5247a87e982037ccb45 | |
parent | 8dc46fc45b5c7d833caca331a9045167d1794f1a (diff) |
tdf#101935 and tdf#102201:
This fixes both the bugs.
Change-Id: I7a64abc0cb12b5195a3b955549ce4f72f3530d57
Reviewed-on: https://gerrit.libreoffice.org/29263
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/xmloff/xmlimp.hxx | 1 | ||||
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index 87634e742455..93c5f250db9d 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -194,6 +194,7 @@ class XMLOFF_DLLPUBLIC SvXMLImport : public ::cppu::WeakImplHelper8< bool isFastContext; css::uno::Reference< css::xml::sax::XFastParser > mxParser; rtl::Reference< SvXMLImportFastNamespaceHandler > maNamespaceHandler; + css::uno::Reference< css::xml::sax::XFastDocumentHandler > mxFastDocumentHandler; css::uno::Reference< css::xml::sax::XFastTokenHandler > mxTokenHandler; std::unordered_map< sal_Int32, OUString > maNamespaceMap; const OUString getNameFromToken( sal_Int32 nToken ); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 715ddb9e3f9f..66e6075fb1bc 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -431,6 +431,7 @@ SvXMLImport::SvXMLImport( mnErrorFlags(SvXMLErrorFlags::NO), isFastContext( false ), maNamespaceHandler( new SvXMLImportFastNamespaceHandler() ), + mxFastDocumentHandler( nullptr ), mxTokenHandler( new FastTokenHandler() ), mbIsFormsSupported( true ), mbIsTableShapeSupported( false ), @@ -439,7 +440,6 @@ SvXMLImport::SvXMLImport( SAL_WARN_IF( !xContext.is(), "xmloff.core", "got no service manager" ); InitCtor_(); mxParser = xml::sax::FastParser::create( xContext ); - setFastDocumentHandler( this ); setNamespaceHandler( maNamespaceHandler.get() ); setTokenHandler( mxTokenHandler ); registerNamespaces(); @@ -478,13 +478,19 @@ sal_Int64 SAL_CALL SvXMLImport::getSomething( const uno::Sequence< sal_Int8 >& r void SAL_CALL SvXMLImport::parseStream( const xml::sax::InputSource& aInputSource ) throw (xml::sax::SAXException, io::IOException, uno::RuntimeException, std::exception) { + if ( mxFastDocumentHandler.is() ) + mxParser->setFastDocumentHandler( mxFastDocumentHandler ); + else + mxParser->setFastDocumentHandler( this ); + mxParser->parseStream( aInputSource ); + mxParser->setFastDocumentHandler( nullptr ); } void SAL_CALL SvXMLImport::setFastDocumentHandler( const uno::Reference< xml::sax::XFastDocumentHandler >& Handler ) throw (uno::RuntimeException, std::exception) { - mxParser->setFastDocumentHandler( Handler ); + mxFastDocumentHandler = Handler; } void SAL_CALL SvXMLImport::setTokenHandler( const uno::Reference< xml::sax::XFastTokenHandler >& Handler ) |