editeng/source/xml/xmltxtimp.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
New commits: commit bd1ef206d37eee556f5b4a0b1437b5c1b2d1a037 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed Mar 4 13:05:26 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Mar 4 14:17:59 2020 +0100 use FastParser in SvxXMLTextImportContext Change-Id: I5af3c5cc17e838cc9c856d1a24c1a7cd3e350345 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89955 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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 { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits