summaryrefslogtreecommitdiff
path: root/unoxml/source/dom/saxbuilder.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-08-05 20:28:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-06 09:27:18 +0200
commitfebc581c30fe22eb133d5c1e355fc12fe3c0dc39 (patch)
treeccfce9d0cbb091de22d9ab63475f5d0c5509d70f /unoxml/source/dom/saxbuilder.cxx
parentc2864be448b52cdac0f8712708cb6c988155fdc8 (diff)
loplugin:flatten in unoxml
Change-Id: I7c85b3618450ea6914c3076b0dca67ef4847be51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100187 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unoxml/source/dom/saxbuilder.cxx')
-rw-r--r--unoxml/source/dom/saxbuilder.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/unoxml/source/dom/saxbuilder.cxx b/unoxml/source/dom/saxbuilder.cxx
index 25686b21c4de..b0e521f033e4 100644
--- a/unoxml/source/dom/saxbuilder.cxx
+++ b/unoxml/source/dom/saxbuilder.cxx
@@ -225,20 +225,20 @@ namespace DOM
aElement.set( m_aNodeStack.top()->appendChild(aElement), UNO_QUERY);
m_aNodeStack.push(aElement);
- if (xAttribs.is())
+ if (!xAttribs.is())
+ return;
+
+ setElementFastAttributes(aElement, xAttribs);
+ const Sequence< css::xml::Attribute > unknownAttribs = xAttribs->getUnknownAttributes();
+ for ( const auto& rUnknownAttrib : unknownAttribs )
{
- setElementFastAttributes(aElement, xAttribs);
- const Sequence< css::xml::Attribute > unknownAttribs = xAttribs->getUnknownAttributes();
- for ( const auto& rUnknownAttrib : unknownAttribs )
- {
- const OUString& rAttrValue = rUnknownAttrib.Value;
- const OUString& rAttrName = rUnknownAttrib.Name;
- const OUString& rAttrNamespace = rUnknownAttrib.NamespaceURL;
- if ( !rAttrNamespace.isEmpty() )
- aElement->setAttributeNS( rAttrNamespace, rAttrName, rAttrValue );
- else
- aElement->setAttribute( rAttrName, rAttrValue );
- }
+ const OUString& rAttrValue = rUnknownAttrib.Value;
+ const OUString& rAttrName = rUnknownAttrib.Name;
+ const OUString& rAttrNamespace = rUnknownAttrib.NamespaceURL;
+ if ( !rAttrNamespace.isEmpty() )
+ aElement->setAttributeNS( rAttrNamespace, rAttrName, rAttrValue );
+ else
+ aElement->setAttribute( rAttrName, rAttrValue );
}
}