[Libreoffice-commits] core.git: sc/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jan 22 09:05:56 UTC 2020
sc/source/filter/xml/xmlimprt.cxx | 35 +++++++----------------------------
sc/source/filter/xml/xmlstyli.cxx | 7 ++-----
sc/source/filter/xml/xmlstyli.hxx | 4 +---
3 files changed, 10 insertions(+), 36 deletions(-)
New commits:
commit a8303106cb6289e7ddc57d8163fafb22226d085a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jan 22 10:07:33 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jan 22 10:05:23 2020 +0100
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 at collabora.co.uk>
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;
More information about the Libreoffice-commits
mailing list