From 3e9bef4b6ef2e1b467b46f5579b5fce201015d83 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 28 Apr 2020 16:16:34 +0200 Subject: 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 --- svx/source/xml/xmlxtimp.cxx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'svx') 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; -- cgit