Kaydet (Commit) a46a5b65 authored tarafından Julien Nabet's avatar Julien Nabet

Use for-range loops in xmlexppr (xmloff)

Change-Id: I65b20b98082db6cd2bda17f527f7ade7a1123a97
Reviewed-on: https://gerrit.libreoffice.org/45743Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst b7f2f93d
...@@ -258,10 +258,12 @@ const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames() ...@@ -258,10 +258,12 @@ const uno::Sequence<OUString>& FilterPropertiesInfo_Impl::GetApiNames()
// construct sequence // construct sequence
pApiNames.reset( new Sequence < OUString >( nCount ) ); pApiNames.reset( new Sequence < OUString >( nCount ) );
OUString *pNames = pApiNames->getArray(); OUString *pNames = pApiNames->getArray();
FilterPropertyInfoList_Impl::iterator aItr = aPropInfos.begin();
FilterPropertyInfoList_Impl::iterator aEnd = aPropInfos.end(); for (auto const& propInfo : aPropInfos)
for ( ; aItr != aEnd; ++aItr, ++pNames) {
*pNames = aItr->GetApiName(); *pNames = propInfo.GetApiName();
++pNames;
}
} }
return *pApiNames; return *pApiNames;
...@@ -297,11 +299,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( ...@@ -297,11 +299,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
aNewProperty.mnIndex = -1; aNewProperty.mnIndex = -1;
aNewProperty.maValue = pResults->Value; aNewProperty.maValue = pResults->Value;
for( std::list<sal_uInt32>::iterator aIndexItr(aPropIter->GetIndexes().begin()); for (auto const& index : aPropIter->GetIndexes())
aIndexItr != aPropIter->GetIndexes().end();
++aIndexItr )
{ {
aNewProperty.mnIndex = *aIndexItr; aNewProperty.mnIndex = index;
aPropStates.AddPropertyState( aNewProperty ); aPropStates.AddPropertyState( aNewProperty );
} }
++pResults; ++pResults;
...@@ -329,11 +329,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( ...@@ -329,11 +329,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
aNewProperty.mnIndex = -1; aNewProperty.mnIndex = -1;
aNewProperty.maValue = pResults->Value; aNewProperty.maValue = pResults->Value;
for( std::list<sal_uInt32>::iterator aIndexItr(aPropIter->GetIndexes().begin()); for (auto const& index : aPropIter->GetIndexes())
aIndexItr != aPropIter->GetIndexes().end();
++aIndexItr )
{ {
aNewProperty.mnIndex = *aIndexItr; aNewProperty.mnIndex = index;
aPropStates.AddPropertyState( aNewProperty ); aPropStates.AddPropertyState( aNewProperty );
} }
} }
...@@ -407,13 +405,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( ...@@ -407,13 +405,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
aNewProperty.mnIndex = -1; aNewProperty.mnIndex = -1;
aNewProperty.maValue = *pValues; aNewProperty.maValue = *pValues;
const ::std::list< sal_uInt32 >& rIndexes( (*pPropIter)->GetIndexes() ); for (auto const& index : (*pPropIter)->GetIndexes())
for ( std::list<sal_uInt32>::const_iterator aIndexItr = rIndexes.begin();
aIndexItr != rIndexes.end();
++aIndexItr
)
{ {
aNewProperty.mnIndex = *aIndexItr; aNewProperty.mnIndex = index;
aPropStates.AddPropertyState( aNewProperty ); aPropStates.AddPropertyState( aNewProperty );
} }
...@@ -434,12 +428,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( ...@@ -434,12 +428,9 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
XMLPropertyState aNewProperty( -1 ); XMLPropertyState aNewProperty( -1 );
aNewProperty.maValue = *pValues; aNewProperty.maValue = *pValues;
++pValues; ++pValues;
for( std::list<sal_uInt32>::iterator aIndexItr = for (auto const& index : aItr->GetIndexes())
aItr->GetIndexes().begin();
aIndexItr != aItr->GetIndexes().end();
++aIndexItr )
{ {
aNewProperty.mnIndex = *aIndexItr; aNewProperty.mnIndex = index;
aPropStates.AddPropertyState( aNewProperty ); aPropStates.AddPropertyState( aNewProperty );
} }
++aItr; ++aItr;
...@@ -458,13 +449,10 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( ...@@ -458,13 +449,10 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
// The value is stored in the PropertySet itself, add to list. // The value is stored in the PropertySet itself, add to list.
bool bGotValue = false; bool bGotValue = false;
XMLPropertyState aNewProperty( -1 ); XMLPropertyState aNewProperty( -1 );
for( std::list<sal_uInt32>::const_iterator aIndexItr = for (auto const& index : aItr->GetIndexes())
aItr->GetIndexes().begin();
aIndexItr != aItr->GetIndexes().end();
++aIndexItr )
{ {
if( bDirectValue || if( bDirectValue ||
(rPropMapper->GetEntryFlags( *aIndexItr ) & (rPropMapper->GetEntryFlags(index) &
MID_FLAG_DEFAULT_ITEM_EXPORT) != 0 ) MID_FLAG_DEFAULT_ITEM_EXPORT) != 0 )
{ {
try try
...@@ -475,7 +463,7 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray( ...@@ -475,7 +463,7 @@ void FilterPropertiesInfo_Impl::FillPropertyStateArray(
rPropSet->getPropertyValue( aItr->GetApiName() ); rPropSet->getPropertyValue( aItr->GetApiName() );
bGotValue = true; bGotValue = true;
} }
aNewProperty.mnIndex = *aIndexItr; aNewProperty.mnIndex = index;
aPropStates.AddPropertyState( aNewProperty ); aPropStates.AddPropertyState( aNewProperty );
} }
catch( UnknownPropertyException& ) catch( UnknownPropertyException& )
...@@ -511,9 +499,8 @@ struct SvXMLExportPropertyMapper::Impl ...@@ -511,9 +499,8 @@ struct SvXMLExportPropertyMapper::Impl
~Impl() ~Impl()
{ {
CacheType::iterator it = maCache.begin(), itEnd = maCache.end(); for (auto const& itemCache : maCache)
for (; it != itEnd; ++it) delete itemCache.second;
delete it->second;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment