From 46aaf4e4e611a48c3c5b8338c9a19814094c563a Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 19 Nov 2020 14:43:54 +0200 Subject: fastparser in forms Change-Id: Ia5274bf6c200a5077bc9b7fdf16b7723337d353d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106165 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/source/forms/propertyimport.cxx | 33 ++++++++++++++++++--------------- xmloff/source/forms/propertyimport.hxx | 17 +++++++---------- 2 files changed, 25 insertions(+), 25 deletions(-) (limited to 'xmloff/source/forms') diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx index d8933bbaa52e..77affdb261ab 100644 --- a/xmloff/source/forms/propertyimport.cxx +++ b/xmloff/source/forms/propertyimport.cxx @@ -41,6 +41,8 @@ #include #include +using namespace ::xmloff::token; + namespace xmloff { @@ -343,16 +345,16 @@ OPropertyElementsContext::OPropertyElementsContext(SvXMLImport& _rImport, { } -SvXMLImportContextRef OPropertyElementsContext::CreateChildContext(sal_uInt16 _nPrefix, const OUString& _rLocalName, - const Reference< XAttributeList >&) +css::uno::Reference< css::xml::sax::XFastContextHandler > OPropertyElementsContext::createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) { - if( token::IsXMLToken( _rLocalName, token::XML_PROPERTY ) ) + if( (nElement & TOKEN_MASK) == XML_PROPERTY ) { - return new OSinglePropertyContext(GetImport(), _nPrefix, _rLocalName, m_xPropertyImporter); + return new OSinglePropertyContext(GetImport(), m_xPropertyImporter); } - else if( token::IsXMLToken( _rLocalName, token::XML_LIST_PROPERTY ) ) + else if( (nElement & TOKEN_MASK) == XML_LIST_PROPERTY ) { - return new OListPropertyContext( GetImport(), _nPrefix, _rLocalName, m_xPropertyImporter ); + return new OListPropertyContext( GetImport(), m_xPropertyImporter ); } return nullptr; } @@ -370,9 +372,9 @@ SvXMLImportContextRef OPropertyElementsContext::CreateChildContext(sal_uInt16 _n #endif //= OSinglePropertyContext -OSinglePropertyContext::OSinglePropertyContext(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const OUString& _rName, +OSinglePropertyContext::OSinglePropertyContext(SvXMLImport& _rImport, const OPropertyImportRef& _rPropertyImporter) - :SvXMLImportContext(_rImport, _nPrefix, _rName) + :SvXMLImportContext(_rImport) ,m_xPropertyImporter(_rPropertyImporter) { } @@ -435,9 +437,9 @@ void OSinglePropertyContext::StartElement(const Reference< XAttributeList >& _rx } //= OListPropertyContext -OListPropertyContext::OListPropertyContext( SvXMLImport& _rImport, sal_uInt16 _nPrefix, const OUString& _rName, +OListPropertyContext::OListPropertyContext( SvXMLImport& _rImport, const OPropertyImportRef& _rPropertyImporter ) - :SvXMLImportContext( _rImport, _nPrefix, _rName ) + :SvXMLImportContext( _rImport ) ,m_xPropertyImporter( _rPropertyImporter ) { } @@ -497,19 +499,20 @@ void OListPropertyContext::endFastElement(sal_Int32 ) m_xPropertyImporter->implPushBackGenericPropertyValue( aSequenceValue ); } -SvXMLImportContextRef OListPropertyContext::CreateChildContext( sal_uInt16 _nPrefix, const OUString& _rLocalName, const Reference< XAttributeList >& /*_rxAttrList*/ ) +css::uno::Reference< css::xml::sax::XFastContextHandler > OListPropertyContext::createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& ) { - if ( token::IsXMLToken( _rLocalName, token::XML_LIST_VALUE ) ) + if ( (nElement & TOKEN_MASK) == XML_LIST_VALUE ) { m_aListValues.emplace_back(); - return new OListValueContext( GetImport(), _nPrefix, _rLocalName, *m_aListValues.rbegin() ); + return new OListValueContext( GetImport(), *m_aListValues.rbegin() ); } return nullptr; } //= OListValueContext -OListValueContext::OListValueContext( SvXMLImport& _rImport, sal_uInt16 _nPrefix, const OUString& _rName, OUString& _rListValueHolder ) - :SvXMLImportContext( _rImport, _nPrefix, _rName ) +OListValueContext::OListValueContext( SvXMLImport& _rImport, OUString& _rListValueHolder ) + :SvXMLImportContext( _rImport ) ,m_rListValueHolder( _rListValueHolder ) { } diff --git a/xmloff/source/forms/propertyimport.hxx b/xmloff/source/forms/propertyimport.hxx index c75e662c1ad0..6cf7c67e67ac 100644 --- a/xmloff/source/forms/propertyimport.hxx +++ b/xmloff/source/forms/propertyimport.hxx @@ -160,9 +160,8 @@ namespace xmloff OPropertyElementsContext(SvXMLImport& _rImport, const OPropertyImportRef& _rPropertyImporter); - virtual SvXMLImportContextRef CreateChildContext( - sal_uInt16 _nPrefix, const OUString& _rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList >& _rxAttrList) override; + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; #if OSL_DEBUG_LEVEL > 0 virtual void StartElement( @@ -179,7 +178,7 @@ namespace xmloff OPropertyImportRef m_xPropertyImporter; // to add the properties public: - OSinglePropertyContext(SvXMLImport& _rImport, sal_uInt16 _nPrefix, const OUString& _rName, + OSinglePropertyContext(SvXMLImport& _rImport, const OPropertyImportRef& _rPropertyImporter); virtual void StartElement( @@ -195,7 +194,7 @@ namespace xmloff ::std::vector< OUString > m_aListValues; public: - OListPropertyContext( SvXMLImport& _rImport, sal_uInt16 _nPrefix, const OUString& _rName, + OListPropertyContext( SvXMLImport& _rImport, const OPropertyImportRef& _rPropertyImporter ); virtual void StartElement( @@ -203,9 +202,8 @@ namespace xmloff virtual void SAL_CALL endFastElement(sal_Int32 nElement) override; - virtual SvXMLImportContextRef CreateChildContext( - sal_uInt16 _nPrefix, const OUString& _rLocalName, - const css::uno::Reference< css::xml::sax::XAttributeList >& _rxAttrList) override; + virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( + sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& AttrList ) override; }; //= OListValueContext @@ -214,8 +212,7 @@ namespace xmloff OUString& m_rListValueHolder; public: - OListValueContext( SvXMLImport& _rImport, sal_uInt16 _nPrefix, const OUString& _rName, - OUString& _rListValueHolder ); + OListValueContext( SvXMLImport& _rImport, OUString& _rListValueHolder ); virtual void StartElement( const css::uno::Reference< css::xml::sax::XAttributeList >& _rxAttrList ) override; -- cgit