diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-21 16:59:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-21 17:56:56 +0100 |
commit | 998308c363dfad03143591aa18256d2669b4da11 (patch) | |
tree | 1eec3bb9ab79fa54d3bfc37c6bc969349ab24909 /sc/source/filter/xml | |
parent | 63b7e282a598ff5dc9d665127f567b20adc56f24 (diff) |
use more FastParser in SvXMLStylesContext
Change-Id: I05c7314739246a864b16723c13bd8fbb4ef725e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87146
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/filter/xml')
-rw-r--r-- | sc/source/filter/xml/xmlimprt.cxx | 21 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlimprt.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlstyli.cxx | 5 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlstyli.hxx | 5 |
4 files changed, 13 insertions, 22 deletions
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 0e22d225672a..fdc16dfd477d 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -357,14 +357,6 @@ SvXMLImportContextRef ScXMLDocContext_Impl::CreateChildContext( sal_uInt16 nPref if (GetScImport().getImportFlags() & SvXMLImportFlags::FONTDECLS) pContext = GetScImport().CreateFontDeclsContext(nPrefix, rLocalName, xAttrList); break; - case XML_TOK_DOC_STYLES: - if (GetScImport().getImportFlags() & SvXMLImportFlags::STYLES) - pContext = GetScImport().CreateStylesContext( rLocalName, xAttrList, false); - break; - case XML_TOK_DOC_AUTOSTYLES: - if (GetScImport().getImportFlags() & SvXMLImportFlags::AUTOSTYLES) - pContext = GetScImport().CreateStylesContext( rLocalName, xAttrList, true); - break; case XML_TOK_DOC_MASTERSTYLES: if (GetScImport().getImportFlags() & SvXMLImportFlags::MASTERSTYLES) pContext = new ScXMLMasterStylesContext( GetImport(), nPrefix, rLocalName, @@ -398,6 +390,14 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL if (GetScImport().getImportFlags() & SvXMLImportFlags::SETTINGS) pContext = new XMLDocumentSettingsContext(GetScImport()); break; + case XML_ELEMENT(OFFICE, XML_STYLES): + if (GetScImport().getImportFlags() & SvXMLImportFlags::STYLES) + pContext = GetScImport().CreateStylesContext( false); + break; + case XML_ELEMENT(OFFICE, XML_AUTOMATIC_STYLES): + if (GetScImport().getImportFlags() & SvXMLImportFlags::AUTOSTYLES) + pContext = GetScImport().CreateStylesContext( true); + break; //TODO: handle all other cases } @@ -752,11 +752,10 @@ SvXMLImportContext *ScXMLImport::CreateFontDeclsContext(const sal_uInt16 nPrefix return pContext; } -SvXMLImportContext *ScXMLImport::CreateStylesContext(const OUString& rLocalName, - const uno::Reference<xml::sax::XAttributeList>& xAttrList, bool bIsAutoStyle ) +SvXMLImportContext *ScXMLImport::CreateStylesContext( bool bIsAutoStyle ) { SvXMLImportContext* pContext = new XMLTableStylesContext( - *this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList, bIsAutoStyle); + *this, bIsAutoStyle); if (bIsAutoStyle) SetAutoStyles(static_cast<SvXMLStylesContext*>(pContext)); diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index a225957f014d..a471a44a7975 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -314,9 +314,7 @@ public: SvXMLImportContext *CreateFontDeclsContext(const sal_uInt16 nPrefix, const OUString& rLocalName, const css::uno::Reference<css::xml::sax::XAttributeList>& xAttrList); SvXMLImportContext *CreateScriptContext(); - SvXMLImportContext *CreateStylesContext(const OUString& rLocalName, - const css::uno::Reference<css::xml::sax::XAttributeList>& xAttrList, - bool bAutoStyles ); + SvXMLImportContext *CreateStylesContext( bool bAutoStyles ); SvXMLImportContext *CreateBodyContext( const rtl::Reference<sax_fastparser::FastAttributeList>& rAttrList ); diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 1a92449707ec..e4fc574948a5 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -680,11 +680,8 @@ static const OUStringLiteral gsRowStyleServiceName(XML_STYLE_FAMILY_TABLE_ROW_ST static const OUStringLiteral gsTableStyleServiceName(XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME); XMLTableStylesContext::XMLTableStylesContext( SvXMLImport& rImport, - sal_uInt16 nPrfx , - const OUString& rLName , - const uno::Reference< XAttributeList > & xAttrList, const bool bTempAutoStyles ) - : SvXMLStylesContext( rImport, nPrfx, rLName, xAttrList ) + : SvXMLStylesContext( rImport ) , nNumberFormatIndex(-1) , nConditionalFormatIndex(-1) , nCellStyleIndex(-1) diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx index 21e2ae976ed4..666bfa9fef7f 100644 --- a/sc/source/filter/xml/xmlstyli.hxx +++ b/sc/source/filter/xml/xmlstyli.hxx @@ -152,10 +152,7 @@ protected: public: - XMLTableStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx , - const OUString& rLName , - const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList, - const bool bAutoStyles ); + XMLTableStylesContext( SvXMLImport& rImport, bool bAutoStyles ); virtual ~XMLTableStylesContext() override; virtual void EndElement() override; |