From 898cbb22f07a2c1487700326f134fe54e7a13f4d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 15 May 2020 09:56:35 +0200 Subject: use for-range on Sequence in basctl..canvas Change-Id: Idad3d8fbe785c7b1b8b287a3227372adb2757de8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94260 Tested-by: Jenkins Reviewed-by: Noel Grandin --- canvas/source/directx/dx_impltools.cxx | 9 ++++----- canvas/source/tools/canvastools.cxx | 6 +++--- canvas/source/tools/parametricpolypolygon.cxx | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) (limited to 'canvas') diff --git a/canvas/source/directx/dx_impltools.cxx b/canvas/source/directx/dx_impltools.cxx index 18113ee34394..21778b4843fb 100644 --- a/canvas/source/directx/dx_impltools.cxx +++ b/canvas/source/directx/dx_impltools.cxx @@ -408,10 +408,9 @@ namespace dxcanvas GraphicsPathSharedPtr pRes = std::make_shared(); std::vector< Gdiplus::PointF > aPoints; - sal_Int32 nCurrPoly; - for( nCurrPoly=0; nCurrPoly const & seqPoints : points ) { - const sal_Int32 nCurrSize( points[nCurrPoly].getLength() ); + const sal_Int32 nCurrSize( seqPoints.getLength() ); if( nCurrSize ) { aPoints.resize( nCurrSize ); @@ -419,8 +418,8 @@ namespace dxcanvas // TODO(F1): Closed/open polygons // convert from RealPoint2D array to Gdiplus::PointF array - std::transform( points[nCurrPoly].getConstArray(), - points[nCurrPoly].getConstArray()+nCurrSize, + std::transform( seqPoints.getConstArray(), + seqPoints.getConstArray()+nCurrSize, aPoints.begin(), implGdiPlusPointFromRealPoint2D ); diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx index 2ca1b5081724..53ab7e71f0c5 100644 --- a/canvas/source/tools/canvastools.cxx +++ b/canvas/source/tools/canvastools.cxx @@ -1314,10 +1314,10 @@ namespace canvas::tools void extractExtraFontProperties(const uno::Sequence& rExtraFontProperties, sal_uInt32 &rEmphasisMark) { - for(sal_Int32 nIdx = 0; nIdx < rExtraFontProperties.getLength(); ++nIdx) + for(const beans::PropertyValue& rPropVal : rExtraFontProperties) { - if (rExtraFontProperties[nIdx].Name == "EmphasisMark") - rExtraFontProperties[nIdx].Value >>= rEmphasisMark; + if (rPropVal.Name == "EmphasisMark") + rPropVal.Value >>= rEmphasisMark; } } diff --git a/canvas/source/tools/parametricpolypolygon.cxx b/canvas/source/tools/parametricpolypolygon.cxx index 5bbd50576f2e..a0a9a7880219 100644 --- a/canvas/source/tools/parametricpolypolygon.cxx +++ b/canvas/source/tools/parametricpolypolygon.cxx @@ -58,10 +58,10 @@ namespace canvas colorStops[1] = 1; // extract args - for( sal_Int32 i=0; i>= aProp ) + if( rArg >>= aProp ) { if ( aProp.Name == "Colors" ) { -- cgit