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 /sw | |
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 'sw')
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 17 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimp.hxx | 4 |
2 files changed, 7 insertions, 14 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 1735a9716140..743eb5ef1325 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -235,6 +235,9 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SwXMLDocContext_Impl::c case XML_ELEMENT(OFFICE, XML_MASTER_STYLES): return GetSwImport().CreateMasterStylesContext(); break; + case XML_ELEMENT(OFFICE, XML_FONT_FACE_DECLS): + return GetSwImport().CreateFontDeclsContext(); + break; } return nullptr; } @@ -242,17 +245,13 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL SwXMLDocContext_Impl::c SvXMLImportContextRef SwXMLDocContext_Impl::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, - const Reference< xml::sax::XAttributeList > & xAttrList ) + const Reference< xml::sax::XAttributeList > & /*xAttrList*/ ) { SvXMLImportContext *pContext = nullptr; const SvXMLTokenMap& rTokenMap = GetSwImport().GetDocElemTokenMap(); switch( rTokenMap.Get( nPrefix, rLocalName ) ) { - case XML_TOK_DOC_FONTDECLS: - pContext = GetSwImport().CreateFontDeclsContext( rLocalName, - xAttrList ); - break; case XML_TOK_DOC_META: OSL_FAIL("XML_TOK_DOC_META: should not have come here, maybe document is invalid?"); break; @@ -1192,14 +1191,10 @@ XMLShapeImportHelper* SwXMLImport::CreateShapeImport() return new SvTextShapeImportHelper( *this ); } -SvXMLImportContext *SwXMLImport::CreateFontDeclsContext( - const OUString& rLocalName, - const Reference< xml::sax::XAttributeList > & xAttrList ) +SvXMLImportContext *SwXMLImport::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/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx index 10c064b7846c..eaa5a151645a 100644 --- a/sw/source/filter/xml/xmlimp.hxx +++ b/sw/source/filter/xml/xmlimp.hxx @@ -137,9 +137,7 @@ public: SvXMLImportContext *CreateScriptContext(); SvXMLImportContext *CreateStylesContext( bool bAuto ); SvXMLImportContext *CreateMasterStylesContext(); - SvXMLImportContext *CreateFontDeclsContext( - const OUString& rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList > & xAttrList ); + SvXMLImportContext *CreateFontDeclsContext(); SvXMLImportContext *CreateBodyContentContext( const OUString& rLocalName ); SfxStyleFamily GetStyleFamilyMask() const { return m_nStyleFamilyMask; } bool IsInsertMode() const { return m_bInsert; } |