summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-22 10:07:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-22 10:05:23 +0100
commita8303106cb6289e7ddc57d8163fafb22226d085a (patch)
treec59f12da8a2b35053eef13e0ac3d827dcfbbc7ea
parentbe32a6390d0fc4ebf60d553b31e402ca9fbdec5d (diff)
use fastparser in ScXMLMasterStylesContext
Change-Id: I02a303fb9940749fbd1ae3e951b1b9bbf4a3052e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87176 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx35
-rw-r--r--sc/source/filter/xml/xmlstyli.cxx7
-rw-r--r--sc/source/filter/xml/xmlstyli.hxx4
3 files changed, 10 insertions, 36 deletions
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index c6875dcb9438..e1bcfa4e176a 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -234,10 +234,6 @@ protected:
public:
ScXMLDocContext_Impl( ScXMLImport& rImport );
- virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList ) override;
-
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL
createFastChildContext( sal_Int32 nElement,
const css::uno::Reference<css::xml::sax::XFastAttributeList>& xAttrList ) override;
@@ -344,28 +340,6 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
return GetScImport().CreateBodyContext( pAttribList );
}
-SvXMLImportContextRef ScXMLDocContext_Impl::CreateChildContext( sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList )
-{
- SvXMLImportContext *pContext(nullptr);
-
- const SvXMLTokenMap& rTokenMap(GetScImport().GetDocElemTokenMap());
- switch( rTokenMap.Get( nPrefix, rLocalName ) )
- {
- case XML_TOK_DOC_MASTERSTYLES:
- if (GetScImport().getImportFlags() & SvXMLImportFlags::MASTERSTYLES)
- pContext = new ScXMLMasterStylesContext( GetImport(), nPrefix, rLocalName,
- xAttrList );
- break;
- case XML_TOK_DOC_META:
- SAL_INFO("sc", "XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
- break;
- }
-
- return pContext;
-}
-
uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
ScXMLDocContext_Impl::createFastChildContext( sal_Int32 nElement,
const uno::Reference< xml::sax::XFastAttributeList > & /*xAttrList*/ )
@@ -398,8 +372,13 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
if (GetScImport().getImportFlags() & SvXMLImportFlags::FONTDECLS)
pContext = GetScImport().CreateFontDeclsContext();
break;
-
- //TODO: handle all other cases
+ case XML_ELEMENT(OFFICE, XML_MASTER_STYLES):
+ if (GetScImport().getImportFlags() & SvXMLImportFlags::MASTERSTYLES)
+ pContext = new ScXMLMasterStylesContext( GetImport() );
+ break;
+ case XML_ELEMENT(OFFICE, XML_META):
+ SAL_INFO("sc", "XML_ELEMENT(OFFICE, XML_META): should not have come here, maybe document is invalid?");
+ break;
}
return pContext;
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index e4fc574948a5..1d7656083233 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -900,11 +900,8 @@ bool ScXMLMasterStylesContext::InsertStyleFamily( sal_uInt16 ) const
return true;
}
-ScXMLMasterStylesContext::ScXMLMasterStylesContext(
- SvXMLImport& rImport,
- sal_uInt16 nPrfx, const OUString& rLName,
- const uno::Reference< XAttributeList > & xAttrList ) :
- SvXMLStylesContext( rImport, nPrfx, rLName, xAttrList )
+ScXMLMasterStylesContext::ScXMLMasterStylesContext( SvXMLImport& rImport ) :
+ SvXMLStylesContext( rImport )
{
}
diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx
index 666bfa9fef7f..efd463d5713d 100644
--- a/sc/source/filter/xml/xmlstyli.hxx
+++ b/sc/source/filter/xml/xmlstyli.hxx
@@ -181,9 +181,7 @@ protected:
public:
- ScXMLMasterStylesContext( SvXMLImport& rImport, sal_uInt16 nPrfx,
- const OUString& rLName,
- const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList);
+ ScXMLMasterStylesContext( SvXMLImport& rImport );
virtual ~ScXMLMasterStylesContext() override;
virtual void EndElement() override;