diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-29 14:04:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-29 20:56:06 +0200 |
commit | 5f56f07e9278e357a079cbecb5366da98e36d97f (patch) | |
tree | 56b12fd785291f7bfe8bf08ee22a47b6f43dbd89 /comphelper/source/xml | |
parent | 33cac418db78f64f7fa84b8e65c01c2b02cf17a7 (diff) |
use for-range loop on Sequence
Change-Id: Ib2d7b21e0fa52087027c0b3b1d362693c7019ba3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93856
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper/source/xml')
-rw-r--r-- | comphelper/source/xml/ofopxmlhelper.cxx | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx index 46785b35cbba..bde7bb00280e 100644 --- a/comphelper/source/xml/ofopxmlhelper.cxx +++ b/comphelper/source/xml/ofopxmlhelper.cxx @@ -156,21 +156,21 @@ void WriteRelationsInfoSequence( xWriter->startDocument(); xWriter->startElement( aRelListElement, xRootAttrList ); - for ( sal_Int32 nInd = 0; nInd < aSequence.getLength(); nInd++ ) + for ( const auto & i : aSequence ) { AttributeList *pAttrList = new AttributeList; uno::Reference< css::xml::sax::XAttributeList > xAttrList( pAttrList ); - for( sal_Int32 nSecInd = 0; nSecInd < aSequence[nInd].getLength(); nSecInd++ ) + for( const beans::StringPair & pair : i ) { - if ( !(aSequence[nInd][nSecInd].First == "Id" - || aSequence[nInd][nSecInd].First == "Type" - || aSequence[nInd][nSecInd].First == "TargetMode" - || aSequence[nInd][nSecInd].First == "Target") ) + if ( !(pair.First == "Id" + || pair.First == "Type" + || pair.First == "TargetMode" + || pair.First == "Target") ) { // TODO/LATER: should the extensions be allowed? throw lang::IllegalArgumentException(); } - pAttrList->AddAttribute( aSequence[nInd][nSecInd].First, aCDATAString, aSequence[nInd][nSecInd].Second ); + pAttrList->AddAttribute( pair.First, aCDATAString, pair.Second ); } xWriter->startElement( aRelElement, xAttrList ); @@ -215,24 +215,24 @@ void WriteContentSequence( xWriter->startDocument(); xWriter->startElement( aTypesElement, xRootAttrList ); - for ( sal_Int32 nInd = 0; nInd < aDefaultsSequence.getLength(); nInd++ ) + for ( const beans::StringPair & pair : aDefaultsSequence ) { AttributeList *pAttrList = new AttributeList; uno::Reference< css::xml::sax::XAttributeList > xAttrList( pAttrList ); - pAttrList->AddAttribute( "Extension", aCDATAString, aDefaultsSequence[nInd].First ); - pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, aDefaultsSequence[nInd].Second ); + pAttrList->AddAttribute( "Extension", aCDATAString, pair.First ); + pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, pair.Second ); xWriter->startElement( aDefaultElement, xAttrList ); xWriter->ignorableWhitespace( aWhiteSpace ); xWriter->endElement( aDefaultElement ); } - for ( sal_Int32 nInd = 0; nInd < aOverridesSequence.getLength(); nInd++ ) + for ( const beans::StringPair & pair : aOverridesSequence ) { AttributeList *pAttrList = new AttributeList; uno::Reference< css::xml::sax::XAttributeList > xAttrList( pAttrList ); - pAttrList->AddAttribute( "PartName", aCDATAString, aOverridesSequence[nInd].First ); - pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, aOverridesSequence[nInd].Second ); + pAttrList->AddAttribute( "PartName", aCDATAString, pair.First ); + pAttrList->AddAttribute( aContentTypeAttr, aCDATAString, pair.Second ); xWriter->startElement( aOverrideElement, xAttrList ); xWriter->ignorableWhitespace( aWhiteSpace ); |