summaryrefslogtreecommitdiff
path: root/chart2/source/model/main
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-03-03 12:54:07 +0100
committerJulien Nabet <serval2412@yahoo.fr>2018-03-03 19:20:53 +0100
commitba7191ed0d4da2f5a2ebd2ef40387b26145860f1 (patch)
treee019dbd2dcc947c155e63841c2ec3a53eca427fb /chart2/source/model/main
parent301514183d471cfeb085673eb4563f8c310162b7 (diff)
Use for-range loops in chart2 (part1)
Change-Id: I9310a6dc79d47f9058df8a3b463667389af1b2cb Reviewed-on: https://gerrit.libreoffice.org/50672 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'chart2/source/model/main')
-rw-r--r--chart2/source/model/main/Axis.cxx9
-rw-r--r--chart2/source/model/main/DataSeries.cxx7
2 files changed, 7 insertions, 9 deletions
diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx
index 639c347582da..49340ee8d9b8 100644
--- a/chart2/source/model/main/Axis.cxx
+++ b/chart2/source/model/main/Axis.cxx
@@ -426,11 +426,10 @@ void Axis::AllocateSubGrids()
}
}
//don't keep the mutex locked while calling out
- std::vector< Reference< beans::XPropertySet > >::iterator aBroadcaster = aOldBroadcasters.begin();
- for( ;aBroadcaster != aOldBroadcasters.end(); ++aBroadcaster )
- ModifyListenerHelper::removeListener( *aBroadcaster, xModifyEventForwarder );
- for( aBroadcaster = aNewBroadcasters.begin(); aBroadcaster != aNewBroadcasters.end(); ++aBroadcaster )
- ModifyListenerHelper::addListener( *aBroadcaster, xModifyEventForwarder );
+ for (auto const& oldBroadcaster : aOldBroadcasters)
+ ModifyListenerHelper::removeListener(oldBroadcaster, xModifyEventForwarder );
+ for (auto const& newBroadcaster : aNewBroadcasters)
+ ModifyListenerHelper::addListener( newBroadcaster, xModifyEventForwarder );
}
// ____ XAxis ____
diff --git a/chart2/source/model/main/DataSeries.cxx b/chart2/source/model/main/DataSeries.cxx
index ff805227b3f5..f9179ac9dc4a 100644
--- a/chart2/source/model/main/DataSeries.cxx
+++ b/chart2/source/model/main/DataSeries.cxx
@@ -99,10 +99,9 @@ void lcl_CloneAttributedDataPoints(
const lcl_tDataPointMap & rSource, lcl_tDataPointMap & rDestination,
const uno::Reference< uno::XInterface > & xSeries )
{
- for( lcl_tDataPointMap::const_iterator aIt( rSource.begin());
- aIt != rSource.end(); ++aIt )
+ for (auto const& elem : rSource)
{
- Reference< beans::XPropertySet > xPoint( (*aIt).second );
+ Reference< beans::XPropertySet > xPoint( elem.second );
if( xPoint.is())
{
Reference< util::XCloneable > xCloneable( xPoint, uno::UNO_QUERY );
@@ -112,7 +111,7 @@ void lcl_CloneAttributedDataPoints(
if( xPoint.is())
{
lcl_SetParent( xPoint, xSeries );
- rDestination.emplace( (*aIt).first, xPoint );
+ rDestination.emplace( elem.first, xPoint );
}
}
}