diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-12-07 22:04:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-08 07:50:58 +0100 |
commit | 7896173f7ff017e338721b8079f00634a8879dab (patch) | |
tree | f465f88267d01b469bfe5b727b620b96abaadb31 /reportdesign | |
parent | 491992d0229afedba29b14778c918f6f9d2d7a07 (diff) |
fastparser in styles
Change-Id: I39d285f1dd7dd18c396db96863f77f511741951c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107364
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/filter/xml/xmlStyleImport.cxx | 20 | ||||
-rw-r--r-- | reportdesign/source/filter/xml/xmlStyleImport.hxx | 3 |
2 files changed, 12 insertions, 11 deletions
diff --git a/reportdesign/source/filter/xml/xmlStyleImport.cxx b/reportdesign/source/filter/xml/xmlStyleImport.cxx index 5b269a5d7e9d..e6b103abc586 100644 --- a/reportdesign/source/filter/xml/xmlStyleImport.cxx +++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx @@ -127,17 +127,19 @@ void OControlStyleContext::AddProperty(const sal_Int16 nContextID, const uno::An GetProperties().push_back(aPropState); // has to be inserted in a sort order later } -void OControlStyleContext::SetAttribute( sal_uInt16 nPrefixKey, - const OUString& rLocalName, +void OControlStyleContext::SetAttribute( sal_Int32 nElement, const OUString& rValue ) { - // TODO: use a map here - if( IsXMLToken(rLocalName, XML_DATA_STYLE_NAME ) ) - m_sDataStyleName = rValue; - else if ( IsXMLToken(rLocalName, XML_MASTER_PAGE_NAME ) ) - ; - else - XMLPropStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue ); + switch(nElement & TOKEN_MASK) + { + case XML_DATA_STYLE_NAME: + m_sDataStyleName = rValue; + break; + case XML_MASTER_PAGE_NAME: + break; + default: + XMLPropStyleContext::SetAttribute( nElement, rValue ); + } } diff --git a/reportdesign/source/filter/xml/xmlStyleImport.hxx b/reportdesign/source/filter/xml/xmlStyleImport.hxx index fac89edc67bf..b51108fd5244 100644 --- a/reportdesign/source/filter/xml/xmlStyleImport.hxx +++ b/reportdesign/source/filter/xml/xmlStyleImport.hxx @@ -40,8 +40,7 @@ namespace rptxml void operator =(const OControlStyleContext&) = delete; protected: - virtual void SetAttribute( sal_uInt16 nPrefixKey, - const OUString& rLocalName, + virtual void SetAttribute( sal_Int32 nElement, const OUString& rValue ) override; public: |