diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-21 09:11:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-21 09:54:30 +0200 |
commit | 60846212c7f5271a86fd43555d633f77d59f5a10 (patch) | |
tree | ba3d9464385a2f3abdeea93b1fe887bf385f8463 /svx | |
parent | 8477bbf8d6867e656b8132f0ddd682d08590a547 (diff) |
use for-range on Sequence in sfx2..sw
Change-Id: I09806869f2fdbae61f4c5d5c9db6859202bb63b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94609
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/AccessibleControlShape.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/svxbmpnumvalueset.cxx | 27 | ||||
-rw-r--r-- | svx/source/items/customshapeitem.cxx | 7 |
3 files changed, 18 insertions, 20 deletions
diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index a775d572b254..2eaf8448f9c5 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -785,8 +785,8 @@ void AccessibleControlShape::initializeComposedState() // now, only states which are not in the responsibility of the UNO control should be part of this state set { Sequence< sal_Int16 > aInitStates = pComposedStates->getStates(); - for ( sal_Int32 i=0; i<aInitStates.getLength(); ++i ) - OSL_ENSURE( !isComposedState( aInitStates.getConstArray()[i] ), + for ( sal_Int16 state : aInitStates ) + OSL_ENSURE( !isComposedState( state ), "AccessibleControlShape::initializeComposedState: invalid initial composed state (should be controlled by the UNO-control)!" ); } #endif diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx index 6ca545e9973d..e04ae513d4fa 100644 --- a/svx/source/dialog/svxbmpnumvalueset.cxx +++ b/svx/source/dialog/svxbmpnumvalueset.cxx @@ -284,23 +284,22 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) Any aLevelAny = xLevel->getByIndex(i); Sequence<PropertyValue> aLevel; aLevelAny >>= aLevel; - const PropertyValue* pValues = aLevel.getConstArray(); aNumberingTypes[i] = 0; aParentNumberings[i] = 0; - for(sal_Int32 nProperty = 0; nProperty < aLevel.getLength() - 1; nProperty++) + for(const PropertyValue& rProp : std::as_const(aLevel)) { - if ( pValues[nProperty].Name == "NumberingType" ) - pValues[nProperty].Value >>= aNumberingTypes[i]; - else if ( pValues[nProperty].Name == "BulletFontName" ) - pValues[nProperty].Value >>= sFontNames[i]; - else if ( pValues[nProperty].Name == "BulletChar" ) - pValues[nProperty].Value >>= sBulletChars[i]; - else if ( pValues[nProperty].Name == "Prefix" ) - pValues[nProperty].Value >>= sPrefixes[i]; - else if ( pValues[nProperty].Name == "Suffix" ) - pValues[nProperty].Value >>= sSuffixes[i]; - else if ( pValues[nProperty].Name == "ParentNumbering" ) - pValues[nProperty].Value >>= aParentNumberings[i]; + if ( rProp.Name == "NumberingType" ) + rProp.Value >>= aNumberingTypes[i]; + else if ( rProp.Name == "BulletFontName" ) + rProp.Value >>= sFontNames[i]; + else if ( rProp.Name == "BulletChar" ) + rProp.Value >>= sBulletChars[i]; + else if ( rProp.Name == "Prefix" ) + rProp.Value >>= sPrefixes[i]; + else if ( rProp.Name == "Suffix" ) + rProp.Value >>= sSuffixes[i]; + else if ( rProp.Name == "ParentNumbering" ) + rProp.Value >>= aParentNumberings[i]; } Sequence< PropertyValue > aProperties(2); PropertyValue* pProperties = aProperties.getArray(); diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx index 0b63b0e8ccea..8626d893ed7e 100644 --- a/svx/source/items/customshapeitem.cxx +++ b/svx/source/items/customshapeitem.cxx @@ -120,12 +120,11 @@ void SdrCustomShapeGeometryItem::SetPropertyValue( const css::beans::PropertyVal css::uno::Any* pAny = GetPropertyValueByName( rPropVal.Name ); if ( pAny ) { // property is already available - sal_Int32 i; if ( auto rSecSequence = o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pAny) ) { // old property is a sequence->each entry has to be removed from the HashPairMap - for ( i = 0; i < rSecSequence->getLength(); i++ ) + for ( auto const & i : *rSecSequence ) { - PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rPropVal.Name, (*rSecSequence)[ i ].Name ) ) ); + PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( PropertyPair( rPropVal.Name, i.Name ) ) ); if ( aHashIter != aPropPairHashMap.end() ) aPropPairHashMap.erase( aHashIter ); } @@ -133,7 +132,7 @@ void SdrCustomShapeGeometryItem::SetPropertyValue( const css::beans::PropertyVal *pAny = rPropVal.Value; if ( auto rSecSequence = o3tl::tryAccess<css::uno::Sequence<beans::PropertyValue>>(*pAny) ) { // the new property is a sequence->each entry has to be inserted into the HashPairMap - for ( i = 0; i < rSecSequence->getLength(); i++ ) + for ( sal_Int32 i = 0; i < rSecSequence->getLength(); i++ ) { beans::PropertyValue const & rPropVal2 = (*rSecSequence)[ i ]; aPropPairHashMap[ PropertyPair( rPropVal.Name, rPropVal2.Name ) ] = i; |