diff options
Diffstat (limited to 'chart2/source/view')
-rw-r--r-- | chart2/source/view/axes/VCartesianGrid.cxx | 6 | ||||
-rw-r--r-- | chart2/source/view/axes/VCoordinateSystem.cxx | 9 | ||||
-rw-r--r-- | chart2/source/view/charttypes/VSeriesPlotter.cxx | 19 | ||||
-rw-r--r-- | chart2/source/view/main/ShapeFactory.cxx | 13 | ||||
-rw-r--r-- | chart2/source/view/main/VDataSeries.cxx | 8 |
5 files changed, 26 insertions, 29 deletions
diff --git a/chart2/source/view/axes/VCartesianGrid.cxx b/chart2/source/view/axes/VCartesianGrid.cxx index 36a143df4545..eda61d9b8e6c 100644 --- a/chart2/source/view/axes/VCartesianGrid.cxx +++ b/chart2/source/view/axes/VCartesianGrid.cxx @@ -187,12 +187,12 @@ void VCartesianGrid::fillLinePropertiesFromGridModel( std::vector<VLinePropertie return; VLineProperties aLineProperties; - for( sal_Int32 nN=0; nN < rGridPropertiesList.getLength(); nN++ ) + for( const auto & rxPropSet : rGridPropertiesList ) { - if(!AxisHelper::isGridVisible( rGridPropertiesList[nN] )) + if(!AxisHelper::isGridVisible( rxPropSet )) aLineProperties.LineStyle <<= drawing::LineStyle_NONE; else - aLineProperties.initFromPropertySet( rGridPropertiesList[nN] ); + aLineProperties.initFromPropertySet( rxPropSet ); rLinePropertiesList.push_back(aLineProperties); } }; diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx b/chart2/source/view/axes/VCoordinateSystem.cxx index 54d3341efaf2..1c900b392233 100644 --- a/chart2/source/view/axes/VCoordinateSystem.cxx +++ b/chart2/source/view/axes/VCoordinateSystem.cxx @@ -142,9 +142,8 @@ uno::Sequence< sal_Int32 > VCoordinateSystem::getCoordinateSystemResolution( uno::Sequence<sal_Int32> aResolution( std::max<sal_Int32>(m_xCooSysModel->getDimension(), 2)); - sal_Int32 nN = 0; - for( nN = 0 ;nN<aResolution.getLength(); nN++ ) - aResolution[nN]=1000; + for( auto& i : aResolution ) + i = 1000; ::basegfx::B3DTuple aScale( BaseGFXHelper::GetScaleFromMatrix( BaseGFXHelper::HomogenMatrixToB3DHomMatrix( @@ -179,8 +178,8 @@ uno::Sequence< sal_Int32 > VCoordinateSystem::getCoordinateSystemResolution( //this maybe can be optimized further ... sal_Int32 nMaxResolution = std::max( nXResolution, nYResolution ); nMaxResolution*=2; - for( nN = 0 ;nN<aResolution.getLength(); nN++ ) - aResolution[nN]=nMaxResolution; + for( auto& i : aResolution ) + i = nMaxResolution; } return aResolution; diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 484fa4362261..063a87eb78ee 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -581,9 +581,9 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re } } - for( sal_Int32 nN = 0; nN < aTextList.getLength(); ++nN ) + for( auto const & line : std::as_const(aTextList) ) { - if( !aTextList[nN].isEmpty() ) + if( !line.isEmpty() ) { ++nLineCountForSymbolsize; } @@ -864,11 +864,10 @@ double lcl_getErrorBarLogicLength( { double fMaxValue; ::rtl::math::setInf(&fMaxValue, true); - const double* pValues = rData.getConstArray(); - for(sal_Int32 i=0; i<rData.getLength(); ++i, ++pValues) + for(double d : rData) { - if(fMaxValue<*pValues) - fMaxValue=*pValues; + if(fMaxValue < d) + fMaxValue = d; } if( std::isfinite( fMaxValue ) && std::isfinite( fPercent )) @@ -1399,7 +1398,7 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries const & rVDataSer xScalingY.set( aScales[1].Scaling ); } - uno::Sequence< geometry::RealPoint2D > aCalculatedPoints( + const uno::Sequence< geometry::RealPoint2D > aCalculatedPoints( xCalculator->getCurveValues( fMinX, fMaxX, nPointCount, xScalingX, xScalingY, bMaySkipPoints )); @@ -1416,10 +1415,10 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries const & rVDataSer sal_Int32 nRealPointCount = 0; - for(sal_Int32 nP = 0; nP < aCalculatedPoints.getLength(); ++nP) + for(geometry::RealPoint2D const & p : aCalculatedPoints) { - double fLogicX = aCalculatedPoints[nP].X; - double fLogicY = aCalculatedPoints[nP].Y; + double fLogicX = p.X; + double fLogicY = p.Y; double fLogicZ = 0.0; //dummy // fdo#51656: don't scale mean value lines diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 1ec43352b8b6..26a598931c29 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2438,8 +2438,8 @@ uno::Reference< drawing::XShape > if( xFormattedString.hasElements() ) { OUString aLabel; - for( sal_Int32 nN=0; nN<xFormattedString.getLength();nN++ ) - aLabel += xFormattedString[nN]->getString(); + for( const auto & i : std::as_const(xFormattedString) ) + aLabel += i->getString(); aLabel = ShapeFactory::getStackedString( aLabel, bStackCharacters ); xTextCursor->gotoEnd(false); @@ -2461,11 +2461,10 @@ uno::Reference< drawing::XShape > } else { - sal_Int32 nN = 0; - for( nN=0; nN<xFormattedString.getLength();nN++ ) + for( const uno::Reference< chart2::XFormattedString >& rxFS : std::as_const(xFormattedString) ) { xTextCursor->gotoEnd(false); - xText->insertString( xTextCursor, xFormattedString[nN]->getString(), false ); + xText->insertString( xTextCursor, rxFS->getString(), false ); xTextCursor->gotoEnd(true); } awt::Size aOldRefSize; @@ -2641,8 +2640,8 @@ OUString ShapeFactory::getStackedString( const OUString& rString, bool bStacked bool ShapeFactory::hasPolygonAnyLines( drawing::PolyPolygonShape3D& rPoly) { // #i67757# check all contained polygons, if at least one polygon contains 2 or more points, return true - for( sal_Int32 nIdx = 0, nCount = rPoly.SequenceX.getLength(); nIdx < nCount; ++nIdx ) - if( rPoly.SequenceX[ nIdx ].getLength() > 1 ) + for( auto const & i : std::as_const(rPoly.SequenceX) ) + if( i.getLength() > 1 ) return true; return false; } diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index c0d0616a090d..91388d1c2eda 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -608,8 +608,8 @@ sal_Int32 VDataSeries::getLabelPlacement( sal_Int32 nPointIndex, const uno::Refe uno::Sequence < sal_Int32 > aAvailablePlacements( ChartTypeHelper::getSupportedLabelPlacements( xChartType, bSwapXAndY, m_xDataSeries ) ); - for( sal_Int32 nN = 0; nN < aAvailablePlacements.getLength(); nN++ ) - if( aAvailablePlacements[nN] == nLabelPlacement ) + for( sal_Int32 n : aAvailablePlacements ) + if( n == nLabelPlacement ) return nLabelPlacement; //ok //otherwise use the first supported one @@ -910,9 +910,9 @@ bool VDataSeries::isAttributedDataPoint( sal_Int32 index ) const //returns true if the data point assigned by the given index has set its own properties if( index>=m_nPointCount || m_nPointCount==0) return false; - for(sal_Int32 nN=m_aAttributedDataPointIndexList.getLength();nN--;) + for(sal_Int32 n : m_aAttributedDataPointIndexList) { - if(index==m_aAttributedDataPointIndexList[nN]) + if(index == n) return true; } return false; |