diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-08-03 22:59:04 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-08-09 16:58:06 +0200 |
commit | fca94779872b8ba0b0583d0b7068f1a46beb88c5 (patch) | |
tree | c3dd200a046d3c6e54cba570f7661b9c1068ed1b /sc/source/ui/view/drawvie4.cxx | |
parent | d05eb786d408af883500404229b89ffa0d7cde16 (diff) |
Simplify Sequence iterations in sc
Use range-based loops, STL and comphelper functions
Change-Id: I047fb2e6ec9591166339b9748c5013a32185f14b
Reviewed-on: https://gerrit.libreoffice.org/76912
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'sc/source/ui/view/drawvie4.cxx')
-rw-r--r-- | sc/source/ui/view/drawvie4.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 3a9755e528fb..063a4f28ddda 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -110,9 +110,8 @@ namespace { void getRangeFromDataSource( uno::Reference< chart2::data::XDataSource > const & xDataSource, std::vector<OUString>& rRangeRep) { uno::Sequence<uno::Reference<chart2::data::XLabeledDataSequence> > xSeqs = xDataSource->getDataSequences(); - for (sal_Int32 i = 0, n = xSeqs.getLength(); i < n; ++i) + for (const uno::Reference<chart2::data::XLabeledDataSequence>& xLS : xSeqs) { - uno::Reference<chart2::data::XLabeledDataSequence> xLS = xSeqs[i]; uno::Reference<chart2::data::XDataSequence> xSeq = xLS->getValues(); if (xSeq.is()) { @@ -139,23 +138,22 @@ void getRangeFromErrorBar(const uno::Reference< chart2::XChartDocument >& rChart return; uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems()); - for(sal_Int32 i = 0; i < xCooSysSequence.getLength(); ++i) + for(const auto& rCooSys : xCooSysSequence) { - uno::Reference< chart2::XChartTypeContainer > xChartTypeContainer( xCooSysSequence[i], uno::UNO_QUERY); + uno::Reference< chart2::XChartTypeContainer > xChartTypeContainer( rCooSys, uno::UNO_QUERY); if(!xChartTypeContainer.is()) continue; uno::Sequence< uno::Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() ); - for(sal_Int32 nChartType = 0; nChartType < xChartTypeSequence.getLength(); ++nChartType) + for(const auto& rChartType : xChartTypeSequence) { - uno::Reference< chart2::XDataSeriesContainer > xDataSequenceContainer( xChartTypeSequence[nChartType], uno::UNO_QUERY); + uno::Reference< chart2::XDataSeriesContainer > xDataSequenceContainer( rChartType, uno::UNO_QUERY); if(!xDataSequenceContainer.is()) continue; uno::Sequence< uno::Reference< chart2::XDataSeries > > xSeriesSequence( xDataSequenceContainer->getDataSeries() ); - for(sal_Int32 nDataSeries = 0; nDataSeries < xSeriesSequence.getLength(); ++nDataSeries) + for(const uno::Reference<chart2::XDataSeries>& xSeries : xSeriesSequence) { - uno::Reference< chart2::XDataSeries > xSeries = xSeriesSequence[nDataSeries]; uno::Reference< beans::XPropertySet > xPropSet( xSeries, uno::UNO_QUERY); uno::Reference< chart2::data::XDataSource > xErrorBarY; xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarY; |