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 /dbaccess | |
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 'dbaccess')
-rw-r--r-- | dbaccess/source/filter/xml/xmlStyleImport.cxx | 21 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlStyleImport.hxx | 3 |
2 files changed, 13 insertions, 11 deletions
diff --git a/dbaccess/source/filter/xml/xmlStyleImport.cxx b/dbaccess/source/filter/xml/xmlStyleImport.cxx index 91ccd77c462a..e5a5970c2e00 100644 --- a/dbaccess/source/filter/xml/xmlStyleImport.cxx +++ b/dbaccess/source/filter/xml/xmlStyleImport.cxx @@ -107,17 +107,20 @@ void OTableStyleContext::AddProperty(const sal_Int16 nContextID, const uno::Any& GetProperties().push_back(aPropState); // has to be inserted in a sort order later } -void OTableStyleContext::SetAttribute( sal_uInt16 nPrefixKey, - const OUString& rLocalName, +void OTableStyleContext::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 ) ) - sPageStyle = rValue; - else - XMLPropStyleContext::SetAttribute( nPrefixKey, rLocalName, rValue ); + switch(nElement & TOKEN_MASK) + { + case XML_DATA_STYLE_NAME: + m_sDataStyleName = rValue; + break; + case XML_MASTER_PAGE_NAME: + sPageStyle = rValue; + break; + default: + XMLPropStyleContext::SetAttribute( nElement, rValue ); + } } ODBFilter& OTableStyleContext::GetOwnImport() diff --git a/dbaccess/source/filter/xml/xmlStyleImport.hxx b/dbaccess/source/filter/xml/xmlStyleImport.hxx index 27e3fa5549a1..d3fc001b03d5 100644 --- a/dbaccess/source/filter/xml/xmlStyleImport.hxx +++ b/dbaccess/source/filter/xml/xmlStyleImport.hxx @@ -39,8 +39,7 @@ namespace dbaxml protected: - virtual void SetAttribute( sal_uInt16 nPrefixKey, - const OUString& rLocalName, + virtual void SetAttribute( sal_Int32 nElement, const OUString& rValue ) override; public: |