diff options
author | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2017-10-01 14:11:11 +0530 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-03-14 14:12:08 +0100 |
commit | bf46b46a1d734348096936284fb8a76e977936d0 (patch) | |
tree | a76c30897cf1e49491bf26580c823701b6d74778 /sfx2 | |
parent | 1b61d0417bf46896ef1f1bd1e1a8209588fc157a (diff) |
Moving XSAXDocumentBuilder2 to use XFastDocumentHandler:
This is used in parsing of meta Contexts across different
modules. This also involved moving to XFastParser for
parsing xml filters in sw, sd, starmath.
Change-Id: Ic663aaac6cb20ee8ce5b97cae87c93220f5a2929
Reviewed-on: https://gerrit.libreoffice.org/42989
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index a15ea43e0ed6..7e696129ad78 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -48,6 +48,7 @@ #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/xml/sax/Parser.hpp> #include <com/sun/star/xml/sax/Writer.hpp> +#include <com/sun/star/xml/sax/XFastParser.hpp> #include <com/sun/star/xml/dom/DOMException.hpp> #include <com/sun/star/xml/dom/XDocument.hpp> #include <com/sun/star/xml/dom/XElement.hpp> @@ -1770,8 +1771,13 @@ SfxDocumentMetaData::loadFromStorage( css::uno::UNO_QUERY_THROW); xImp->setTargetDocument(css::uno::Reference<css::lang::XComponent>(this)); xParser->setDocumentHandler(xDocHandler); + css::uno::Reference< css::xml::sax::XFastParser > xFastParser = dynamic_cast< + css::xml::sax::XFastParser* >( xDocHandler.get() ); try { - xParser->parseStream(input); + if( xFastParser.is() ) + xFastParser->parseStream(input); + else + xParser->parseStream(input); } catch (const css::xml::sax::SAXException &) { throw css::io::WrongFormatException( "SfxDocumentMetaData::loadFromStorage:" |