diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-28 16:16:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-29 19:35:52 +0200 |
commit | 3e9bef4b6ef2e1b467b46f5579b5fce201015d83 (patch) | |
tree | bb48254079b2277a108e4ba44428ab1c56248208 /svx | |
parent | ab846145bbd56f4308c8657df8b1354a403edd74 (diff) |
simplify handling of comparing XML_NAMESPACE values
Change-Id: I18bbf1ee206285842250891ce556d523489855b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93075
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/xml/xmlxtimp.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/svx/source/xml/xmlxtimp.cxx b/svx/source/xml/xmlxtimp.cxx index ea32ca9c380c..7c0a238dcebc 100644 --- a/svx/source/xml/xmlxtimp.cxx +++ b/svx/source/xml/xmlxtimp.cxx @@ -101,9 +101,8 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SvxXMLTableImportContext::createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > & rAttrList) { - sal_Int32 nNamespace = nElement & NMSP_MASK; - if( NAMESPACE_TOKEN(XML_NAMESPACE_DRAW) == nNamespace || - NAMESPACE_TOKEN(XML_NAMESPACE_DRAW_OOO) == nNamespace ) + if( IsTokenInNamespace(nElement, XML_NAMESPACE_DRAW) || + IsTokenInNamespace(nElement, XML_NAMESPACE_DRAW_OOO) ) { SvXMLAttributeList *pAttrList = new SvXMLAttributeList; for (auto& aIter : sax_fastparser::castToFastAttributeList( rAttrList )) @@ -428,13 +427,12 @@ bool SvxXMLXTableImport::load( const OUString &rPath, const OUString &rReferer, SvXMLImportContext *SvxXMLXTableImport::CreateFastContext( sal_Int32 nElement, const ::css::uno::Reference< ::css::xml::sax::XFastAttributeList >& /*xAttrList*/ ) { - sal_Int32 nNamespace = nElement & NMSP_MASK; - if( NAMESPACE_TOKEN(XML_NAMESPACE_OOO) == nNamespace || - NAMESPACE_TOKEN(XML_NAMESPACE_OFFICE) == nNamespace || - NAMESPACE_TOKEN(XML_NAMESPACE_OFFICE_OOO) == nNamespace ) + if( IsTokenInNamespace(nElement, XML_NAMESPACE_OOO) || + IsTokenInNamespace(nElement, XML_NAMESPACE_OFFICE) || + IsTokenInNamespace(nElement, XML_NAMESPACE_OFFICE_OOO) ) { - bool bOOoFormat = (NAMESPACE_TOKEN(XML_NAMESPACE_OFFICE) == nNamespace) || - (NAMESPACE_TOKEN(XML_NAMESPACE_OFFICE_OOO) == nNamespace); + bool bOOoFormat = IsTokenInNamespace(nElement, XML_NAMESPACE_OFFICE) || + IsTokenInNamespace(nElement, XML_NAMESPACE_OFFICE_OOO); Type aType = mrTable->getElementType(); sal_Int32 nToken = nElement & TOKEN_MASK; |