sw/source/core/swg/SwXMLBlockImport.cxx | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)
New commits: commit 6b0d5a2aa98f6e201820080eed88f329f6b40cef Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Jan 16 08:16:34 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Jan 16 08:25:04 2020 +0100 fix use of FastParser in SwXMLTextBlockImport need to override startFastElement or SvXMLImport will fall back to trying the non-fastparser stuff Change-Id: Ia38e62d529391e490807d77dd265c69beb2d8476 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86901 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/swg/SwXMLBlockImport.cxx b/sw/source/core/swg/SwXMLBlockImport.cxx index ceda8003a152..ab5519e27bf4 100644 --- a/sw/source/core/swg/SwXMLBlockImport.cxx +++ b/sw/source/core/swg/SwXMLBlockImport.cxx @@ -54,6 +54,9 @@ public: SwXMLBlockListContext( SwXMLBlockListImport& rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ); + virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {} + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override; }; @@ -63,6 +66,8 @@ class SwXMLBlockContext : public SvXMLImportContext public: SwXMLBlockContext( SwXMLBlockListImport& rImport, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ); + virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {} }; class SwXMLTextBlockDocumentContext : public SvXMLImportContext @@ -73,6 +78,9 @@ private: public: SwXMLTextBlockDocumentContext( SwXMLTextBlockImport& rImport ); + virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {} + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override; }; @@ -85,6 +93,9 @@ private: public: SwXMLTextBlockBodyContext( SwXMLTextBlockImport& rImport ); + virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {} + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override; }; @@ -97,6 +108,9 @@ private: public: SwXMLTextBlockTextContext( SwXMLTextBlockImport& rImport ); + virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {} + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > & xAttrList ) override; @@ -110,6 +124,9 @@ private: public: SwXMLTextBlockParContext( SwXMLTextBlockImport & rImport ); + virtual void SAL_CALL startFastElement( sal_Int32 /*nElement*/, + const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) override {} + virtual void SAL_CALL characters( const OUString & aChars ) override; virtual ~SwXMLTextBlockParContext() override; @@ -308,8 +325,7 @@ SvXMLImportContext* SwXMLBlockListImport::CreateFastContext( sal_Int32 Element, { if( Element == SwXMLBlockListToken::BLOCK_LIST ) return new SwXMLBlockListContext( *this, xAttrList ); - else - return SvXMLImport::CreateFastContext( Element, xAttrList ); + return nullptr; } SwXMLTextBlockImport::SwXMLTextBlockImport( @@ -328,13 +344,12 @@ SwXMLTextBlockImport::~SwXMLTextBlockImport() } SvXMLImportContext* SwXMLTextBlockImport::CreateFastContext( sal_Int32 Element, - const uno::Reference< xml::sax::XFastAttributeList > & xAttrList ) + const uno::Reference< xml::sax::XFastAttributeList > & /*xAttrList*/ ) { if( Element == SwXMLTextBlockToken::OFFICE_DOCUMENT || Element == SwXMLTextBlockToken::OFFICE_DOCUMENT_CONTENT ) return new SwXMLTextBlockDocumentContext( *this ); - else - return SvXMLImport::CreateFastContext( Element, xAttrList ); + return nullptr; } void SAL_CALL SwXMLTextBlockImport::endDocument() _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits