summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-12-03 16:58:23 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-12-03 19:33:05 +0100
commita46a5b653b4d609cace9806872d954b07c8af3e1 (patch)
treeb8005696ec1cc6134a8dc2b42f94e7afa0353224 /xmloff
parentb7f2f93dd55ef5c54f7ac7d83d1225e7d2352800 (diff)
Use for-range loops in xmlexppr (xmloff)
Change-Id: I65b20b98082db6cd2bda17f527f7ade7a1123a97 Reviewed-on: https://gerrit.libreoffice.org/45743 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlexppr.cxx51
1 files changed, 19 insertions, 32 deletions
diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx
index 085380c48f1d..a119edd360bb 100644
--- a/xmloff/source/style/xmlexppr.cxx
+++ b/xmloff/source/style/xmlexppr.cxx
@@ -258,10 +258,12 @@ const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames()
// construct sequence
pApiNames.reset( new Sequence < OUString >( nCount ) );
OUString *pNames = pApiNames->getArray();
- FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
- FilterPropertyInfoList_Impl::iterator aEnd = aPropInfos.end();
- for ( ; aItr != aEnd; ++aItr, ++pNames)
- *pNames = aItr->GetApiName();
+
+ for (auto const& propInfo : aPropInfos)
+ {
+ *pNames = propInfo.GetApiName();
+ ++pNames;
+ }
}
return *pApiNames;
@@ -297,11 +299,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
aNewProperty.mnIndex = -1;
aNewProperty.maValue = pResults->Value;
- for( std::list<sal_uInt32>::iterator aIndexItr(aPropIter->GetIndexes().begin());
- aIndexItr != aPropIter->GetIndexes().end();
- ++aIndexItr )
+ for (auto const& index : aPropIter->GetIndexes())
{
- aNewProperty.mnIndex = *aIndexItr;
+ aNewProperty.mnIndex = index;
aPropStates.AddPropertyState( aNewProperty );
}
++pResults;
@@ -329,11 +329,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
aNewProperty.mnIndex = -1;
aNewProperty.maValue = pResults->Value;
- for( std::list<sal_uInt32>::iterator aIndexItr(aPropIter->GetIndexes().begin());
- aIndexItr != aPropIter->GetIndexes().end();
- ++aIndexItr )
+ for (auto const& index : aPropIter->GetIndexes())
{
- aNewProperty.mnIndex = *aIndexItr;
+ aNewProperty.mnIndex = index;
aPropStates.AddPropertyState( aNewProperty );
}
}
@@ -407,13 +405,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
aNewProperty.mnIndex = -1;
aNewProperty.maValue = *pValues;
- const ::std::list< sal_uInt32 >& rIndexes( (*pPropIter)->GetIndexes() );
- for ( std::list<sal_uInt32>::const_iterator aIndexItr = rIndexes.begin();
- aIndexItr != rIndexes.end();
- ++aIndexItr
- )
+ for (auto const& index : (*pPropIter)->GetIndexes())
{
- aNewProperty.mnIndex = *aIndexItr;
+ aNewProperty.mnIndex = index;
aPropStates.AddPropertyState( aNewProperty );
}
@@ -434,12 +428,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
XMLPropertyState aNewProperty( -1 );
aNewProperty.maValue = *pValues;
++pValues;
- for( std::list<sal_uInt32>::iterator aIndexItr =
- aItr->GetIndexes().begin();
- aIndexItr != aItr->GetIndexes().end();
- ++aIndexItr )
+ for (auto const& index : aItr->GetIndexes())
{
- aNewProperty.mnIndex = *aIndexItr;
+ aNewProperty.mnIndex = index;
aPropStates.AddPropertyState( aNewProperty );
}
++aItr;
@@ -458,13 +449,10 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
// The value is stored in the PropertySet itself, add to list.
bool bGotValue = false;
XMLPropertyState aNewProperty( -1 );
- for( std::list<sal_uInt32>::const_iterator aIndexItr =
- aItr->GetIndexes().begin();
- aIndexItr != aItr->GetIndexes().end();
- ++aIndexItr )
+ for (auto const& index : aItr->GetIndexes())
{
if( bDirectValue ||
- (rPropMapper->GetEntryFlags( *aIndexItr ) &
+ (rPropMapper->GetEntryFlags(index) &
MID_FLAG_DEFAULT_ITEM_EXPORT) != 0 )
{
try
@@ -475,7 +463,7 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
rPropSet->getPropertyValue( aItr->GetApiName() );
bGotValue = true;
}
- aNewProperty.mnIndex = *aIndexItr;
+ aNewProperty.mnIndex = index;
aPropStates.AddPropertyState( aNewProperty );
}
catch( UnknownPropertyException& )
@@ -511,9 +499,8 @@ struct SvXMLExportPropertyMapper::Impl
~Impl()
{
- CacheType::iterator it = maCache.begin(), itEnd = maCache.end();
- for (; it != itEnd; ++it)
- delete it->second;
+ for (auto const& itemCache : maCache)
+ delete itemCache.second;
}
};