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 /reportdesign | |
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 'reportdesign')
-rw-r--r-- | reportdesign/source/filter/xml/xmlfilter.cxx | 25 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlfilter.hxx | 5 |
2 files changed, 23 insertions, 7 deletions
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index bf246129d9e3..054e9b2e39c9 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -745,10 +745,6 @@ SvXMLImportContext* ORptFilter::CreateDocumentContext( sal_uInt16 nPrefix, case XML_TOK_DOC_CONTENT: pContext = new RptXMLDocumentContentContext(*this, nPrefix, rLocalName); break; - case XML_TOK_DOC_META: - GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP ); - pContext = CreateMetaContext( rLocalName ); - break; default: break; } @@ -759,6 +755,23 @@ SvXMLImportContext* ORptFilter::CreateDocumentContext( sal_uInt16 nPrefix, return pContext; } +SvXMLImportContext *ORptFilter::CreateFastContext( sal_Int32 nElement, + const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ ) +{ + SvXMLImportContext *pContext = nullptr; + + switch (nElement) + { + case XML_ELEMENT( OFFICE, XML_DOCUMENT_META ): + GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP ); + pContext = CreateMetaContext( nElement ); + break; + default: + pContext = new SvXMLImportContext(*this); + } + return pContext; +} + const SvXMLTokenMap& ORptFilter::GetDocElemTokenMap() const { if ( !m_pDocElemTokenMap.get() ) @@ -1102,14 +1115,14 @@ void ORptFilter::insertFunction(const css::uno::Reference< css::report::XFunctio m_aFunctions.emplace(_xFunction->getName(),_xFunction); } -SvXMLImportContext* ORptFilter::CreateMetaContext(const OUString& rLocalName) +SvXMLImportContext* ORptFilter::CreateMetaContext(const sal_Int32 /*nElement*/) { SvXMLImportContext* pContext = nullptr; if ( getImportFlags() & SvXMLImportFlags::META ) { uno::Reference<document::XDocumentPropertiesSupplier> xDPS(GetModel(), uno::UNO_QUERY_THROW); - pContext = new SvXMLMetaDocumentContext(*this,XML_NAMESPACE_OFFICE, rLocalName,xDPS->getDocumentProperties()); + pContext = new SvXMLMetaDocumentContext(*this, xDPS->getDocumentProperties()); } return pContext; } diff --git a/reportdesign/source/filter/xml/xmlfilter.hxx b/reportdesign/source/filter/xml/xmlfilter.hxx index eacb74e83969..6ecf8f061130 100644 --- a/reportdesign/source/filter/xml/xmlfilter.hxx +++ b/reportdesign/source/filter/xml/xmlfilter.hxx @@ -99,7 +99,7 @@ public: using SvXMLImport::SetMasterStyles; SvXMLImportContext* CreateStylesContext(const OUString& rLocalName, const Reference< XAttributeList>& xAttrList, bool bIsAutoStyle ); - SvXMLImportContext* CreateMetaContext(const OUString& rLocalName); + SvXMLImportContext* CreateMetaContext(const sal_Int32 nElement); SvXMLImportContext* CreateFontDeclsContext(const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ); protected: @@ -108,6 +108,9 @@ protected: const OUString& rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList ) override; + virtual SvXMLImportContext *CreateFastContext( sal_Int32 nElement, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override; + virtual XMLShapeImportHelper* CreateShapeImport() override; virtual ~ORptFilter() throw() override; |