diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 23:51:21 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-29 05:59:15 +0100 |
commit | 951a65923c088a1e19a4073f3c26a3b564a0a922 (patch) | |
tree | 5e7191cc0783df304e5f7f28616dd31ee950a405 /xmloff | |
parent | cb7500ddb8de6c41fca84a0009ffe22240bb1845 (diff) |
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I0516dc68cf7d451eafc044be8e50a66d2bddf15f
Reviewed-on: https://gerrit.libreoffice.org/62484
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 57826fc6546e..a2303e170b0f 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -1627,26 +1627,15 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext *pAutoStyles ) if (pAutoStyles && mxNumberStyles.is() && (mnImportFlags & SvXMLImportFlags::CONTENT) ) { uno::Reference<xml::sax::XAttributeList> xAttrList; - uno::Sequence< OUString > aNames = mxNumberStyles->getElementNames(); - sal_uInt32 nCount(aNames.getLength()); - if (nCount) + for (const auto& name : mxNumberStyles->getElementNames()) { - const OUString* pNames = aNames.getConstArray(); - if ( pNames ) + uno::Any aAny(mxNumberStyles->getByName(name)); + sal_Int32 nKey(0); + if (aAny >>= nKey) { - SvXMLStyleContext* pContext; - uno::Any aAny; - sal_Int32 nKey(0); - for (sal_uInt32 i = 0; i < nCount; i++, pNames++) - { - aAny = mxNumberStyles->getByName(*pNames); - if (aAny >>= nKey) - { - pContext = new SvXMLNumFormatContext( *this, XML_NAMESPACE_NUMBER, - *pNames, xAttrList, nKey, *pAutoStyles ); - pAutoStyles->AddStyle(*pContext); - } - } + SvXMLStyleContext* pContext = new SvXMLNumFormatContext( + *this, XML_NAMESPACE_NUMBER, name, xAttrList, nKey, *pAutoStyles); + pAutoStyles->AddStyle(*pContext); } } } |