summaryrefslogtreecommitdiff
path: root/xmloff/source/forms
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-11-19 14:43:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-19 19:31:17 +0100
commit46aaf4e4e611a48c3c5b8338c9a19814094c563a (patch)
treea1c9db5a8de52a8cb83df794b27a39c930531aa2 /xmloff/source/forms
parentcf13e985a6112a18e4d405b807a2064092c01b2d (diff)
fastparser in forms
Change-Id: Ia5274bf6c200a5077bc9b7fdf16b7723337d353d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106165 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/forms')
-rw-r--r--xmloff/source/forms/propertyimport.cxx33
-rw-r--r--xmloff/source/forms/propertyimport.hxx17
2 files changed, 25 insertions, 25 deletions
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 <unotools/datetime.hxx>
#include <rtl/strbuf.hxx>
+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;