summaryrefslogtreecommitdiff
path: root/chart2/source/tools/RegressionCurveHelper.cxx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-03-03 23:26:43 +0100
committerJulien Nabet <serval2412@yahoo.fr>2018-03-04 00:38:16 +0100
commite108a31a8fee09c2fa4031e45e45ed73bbdb7c6f (patch)
treee334e8b5c11b621d59d8086b9fd853ebafb2ba61 /chart2/source/tools/RegressionCurveHelper.cxx
parent4f4137d0e20e6693037846c870857c887979770b (diff)
Modernize a bit chart2
mainly by using for range loops + by using empty() instead of comparing begin and iterator or use size to test that a container has at least 2 elements Change-Id: I81f168d8c36a8b4195fbb0c1aee4983dab25d22c Reviewed-on: https://gerrit.libreoffice.org/50705 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'chart2/source/tools/RegressionCurveHelper.cxx')
-rw-r--r--chart2/source/tools/RegressionCurveHelper.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx
index 53b12b6397e9..6d397b1449bb 100644
--- a/chart2/source/tools/RegressionCurveHelper.cxx
+++ b/chart2/source/tools/RegressionCurveHelper.cxx
@@ -412,10 +412,9 @@ bool RegressionCurveHelper::removeAllExceptMeanValueLine(
}
}
- for( std::vector< uno::Reference< chart2::XRegressionCurve > >::const_iterator aIt = aCurvesToDelete.begin();
- aIt != aCurvesToDelete.end(); ++aIt )
+ for (auto const& curveToDelete : aCurvesToDelete)
{
- xRegCnt->removeRegressionCurve( *aIt );
+ xRegCnt->removeRegressionCurve(curveToDelete);
bRemovedSomething = true;
}
}
@@ -686,10 +685,9 @@ std::vector< Reference< chart2::XRegressionCurve > >
{
std::vector< Reference< chart2::XRegressionCurve > > aResult;
std::vector< Reference< chart2::XDataSeries > > aSeries( DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
- for( std::vector< Reference< chart2::XDataSeries > >::iterator aIt( aSeries.begin());
- aIt != aSeries.end(); ++aIt )
+ for (auto const& elem : aSeries)
{
- Reference< chart2::XRegressionCurveContainer > xContainer( *aIt, uno::UNO_QUERY );
+ Reference< chart2::XRegressionCurveContainer > xContainer(elem, uno::UNO_QUERY);
if(xContainer.is())
{
uno::Sequence< uno::Reference< chart2::XRegressionCurve > > aCurves(xContainer->getRegressionCurves());