summaryrefslogtreecommitdiff
path: root/xmloff/source/draw/sdxmlimp.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-22 09:55:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-22 09:37:08 +0100
commite9262376f0acbe67a544d7e391992c9943ed6d8b (patch)
tree690d30eaa5172f3188827091927e46a11708b508 /xmloff/source/draw/sdxmlimp.cxx
parent6f6a64952d9aa4826e83ad94c2a6de2344cbe2de (diff)
use fastparser for XMLFontStylesContext
Change-Id: I7b273cdc0f90f2a8c9527d1f19fed97672a74741 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87175 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/draw/sdxmlimp.cxx')
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx46
1 files changed, 12 insertions, 34 deletions
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index 7ccf05c73ff4..d41b52b88173 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -91,10 +91,6 @@ protected:
public:
SdXMLDocContext_Impl( SdXMLImport& 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;
@@ -114,31 +110,6 @@ SdXMLDocContext_Impl::SdXMLDocContext_Impl(
{
}
-SvXMLImportContextRef SdXMLDocContext_Impl::CreateChildContext(
- sal_uInt16 nPrefix,
- const OUString& rLocalName,
- const uno::Reference<xml::sax::XAttributeList>& xAttrList)
-{
- SvXMLImportContextRef xContext;
-
- const SvXMLTokenMap& rTokenMap = GetSdImport().GetDocElemTokenMap();
- switch(rTokenMap.Get(nPrefix, rLocalName))
- {
- case XML_TOK_DOC_FONTDECLS:
- {
- xContext = GetSdImport().CreateFontDeclsContext( rLocalName, xAttrList );
- break;
- }
- case XML_TOK_DOC_META:
- {
- SAL_INFO("xmloff.draw", "XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
- break;
- }
- }
-
- return xContext;
-}
-
uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SdXMLDocContext_Impl::createFastChildContext(
sal_Int32 nElement, const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/ )
{
@@ -197,6 +168,16 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SdXMLDocContext_Impl::c
}
break;
}
+ case XML_ELEMENT(OFFICE, XML_FONT_FACE_DECLS):
+ {
+ return GetSdImport().CreateFontDeclsContext();
+ break;
+ }
+ case XML_ELEMENT(OFFICE, XML_META):
+ {
+ SAL_INFO("xmloff.draw", "XML_ELEMENT(OFFICE, XML_META): should not have come here, maybe document is invalid?");
+ break;
+ }
}
return nullptr;
}
@@ -731,13 +712,10 @@ SvXMLImportContext* SdXMLImport::CreateMasterStylesContext()
return mxMasterStylesContext.get();
}
-SvXMLImportContext *SdXMLImport::CreateFontDeclsContext(const OUString& rLocalName,
- const uno::Reference< xml::sax::XAttributeList > & xAttrList )
+SvXMLImportContext *SdXMLImport::CreateFontDeclsContext()
{
XMLFontStylesContext *pFSContext =
- new XMLFontStylesContext( *this, XML_NAMESPACE_OFFICE,
- rLocalName, xAttrList,
- osl_getThreadTextEncoding() );
+ new XMLFontStylesContext( *this, osl_getThreadTextEncoding() );
SetFontDecls( pFSContext );
return pFSContext;
}