diff options
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); } } } |