diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-04 13:05:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-04 14:17:59 +0100 |
commit | bd1ef206d37eee556f5b4a0b1437b5c1b2d1a037 (patch) | |
tree | 414a78ee98bf33f099b631a677996b1b885d461e /editeng/source/xml/xmltxtimp.cxx | |
parent | 5da687891223488f46d08d705585ace1900ba0f4 (diff) |
use FastParser in SvxXMLTextImportContext
Change-Id: I5af3c5cc17e838cc9c856d1a24c1a7cd3e350345
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89955
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source/xml/xmltxtimp.cxx')
-rw-r--r-- | editeng/source/xml/xmltxtimp.cxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx index f0bb5d171ceb..fdfc588c2679 100644 --- a/editeng/source/xml/xmltxtimp.cxx +++ b/editeng/source/xml/xmltxtimp.cxx @@ -53,6 +53,9 @@ public: SvxXMLTextImportContext( SvXMLImport& rImport, const uno::Reference< XText >& xText ); virtual SvXMLImportContextRef CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ) override; + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, + const uno::Reference< xml::sax::XFastAttributeList >& xAttrList) override; virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/, const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {} @@ -67,18 +70,29 @@ SvxXMLTextImportContext::SvxXMLTextImportContext( SvXMLImport& rImport, const un { } +css::uno::Reference< css::xml::sax::XFastContextHandler > SvxXMLTextImportContext::createFastChildContext( + sal_Int32 nElement, + const uno::Reference< xml::sax::XFastAttributeList >& /*xAttrList*/) +{ + SvXMLImportContext* pContext = nullptr; + if(nElement == XML_ELEMENT(OFFICE, XML_BODY )) + { + pContext = new SvxXMLTextImportContext( GetImport(), mxText ); + } + return pContext; +} + SvXMLImportContextRef SvxXMLTextImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ) { SvXMLImportContext* pContext = nullptr; if(XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken( rLocalName, XML_BODY ) ) { - pContext = new SvxXMLTextImportContext( GetImport(), mxText ); + // dealt with in createFastChildContext } else if( XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken( rLocalName, XML_AUTOMATIC_STYLES ) ) { pContext = new SvXMLStylesContext( GetImport(), nPrefix, rLocalName, xAttrList ); GetImport().GetTextImport()->SetAutoStyles( static_cast<SvXMLStylesContext*>(pContext) ); - } else { |