diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-22 09:55:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-22 09:37:08 +0100 |
commit | e9262376f0acbe67a544d7e391992c9943ed6d8b (patch) | |
tree | 690d30eaa5172f3188827091927e46a11708b508 /xmloff | |
parent | 6f6a64952d9aa4826e83ad94c2a6de2344cbe2de (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')
-rw-r--r-- | xmloff/source/draw/sdxmlimp.cxx | 46 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlimp_impl.hxx | 3 | ||||
-rw-r--r-- | xmloff/source/style/XMLFontStylesContext.cxx | 4 |
3 files changed, 14 insertions, 39 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; } diff --git a/xmloff/source/draw/sdxmlimp_impl.hxx b/xmloff/source/draw/sdxmlimp_impl.hxx index 93fc2f242153..dc304c92a263 100644 --- a/xmloff/source/draw/sdxmlimp_impl.hxx +++ b/xmloff/source/draw/sdxmlimp_impl.hxx @@ -205,8 +205,7 @@ public: SvXMLStylesContext* CreateStylesContext(); SvXMLStylesContext* CreateAutoStylesContext(); SvXMLImportContext* CreateMasterStylesContext(); - SvXMLImportContext *CreateFontDeclsContext(const OUString& rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ); + SvXMLImportContext *CreateFontDeclsContext(); // Styles and AutoStyles contexts diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx index 3a2840baa6e9..9c3fbb9feb39 100644 --- a/xmloff/source/style/XMLFontStylesContext.cxx +++ b/xmloff/source/style/XMLFontStylesContext.cxx @@ -366,10 +366,8 @@ SvXMLStyleContext *XMLFontStylesContext::CreateStyleChildContext( XMLFontStylesContext::XMLFontStylesContext( SvXMLImport& rImport, - sal_uInt16 nPrfx, const OUString& rLName, - const Reference< XAttributeList > & xAttrList, rtl_TextEncoding eDfltEnc ) : - SvXMLStylesContext( rImport, nPrfx, rLName, xAttrList ), + SvXMLStylesContext( rImport ), pFamilyNameHdl( new XMLFontFamilyNamePropHdl ), pFamilyHdl( new XMLFontFamilyPropHdl ), pPitchHdl( new XMLFontPitchPropHdl ), |