From 8762aa986dbca42e61cc8fb1b2c1d2ca66bcfcbe Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 21 Apr 2016 10:26:48 +0200 Subject: clang-tidy modernize-loop-convert in b* Change-Id: I8ac6eb59e213eafa78e3dc4578738b53e8adef5b --- basegfx/source/polygon/b2dpolygonclipper.cxx | 4 ++-- basegfx/source/polygon/b2dpolygoncutandtouch.cxx | 3 +-- basegfx/source/polygon/b2dpolypolygon.cxx | 4 ++-- basegfx/source/polygon/b2dpolypolygoncutter.cxx | 4 ++-- basegfx/source/polygon/b2dtrapezoid.cxx | 3 +-- 5 files changed, 8 insertions(+), 10 deletions(-) (limited to 'basegfx') diff --git a/basegfx/source/polygon/b2dpolygonclipper.cxx b/basegfx/source/polygon/b2dpolygonclipper.cxx index d8123edcd881..7b4916993c0b 100644 --- a/basegfx/source/polygon/b2dpolygonclipper.cxx +++ b/basegfx/source/polygon/b2dpolygonclipper.cxx @@ -828,8 +828,8 @@ namespace basegfx else { // the last triangle has not been altered, simply copy to result - for(sal_uInt32 i=0; i<3; ++i) - aResult.append(stack[i]); + for(basegfx::B2DPoint & i : stack) + aResult.append(i); } } } diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx index e72c6ba6b7e5..22ee49622b78 100644 --- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx +++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx @@ -412,9 +412,8 @@ namespace basegfx } // append remapped tempVector entries for edge to tempPoints for edge - for(size_t a(0); a < aTempPointVectorEdge.size(); a++) + for(temporaryPoint & rTempPoint : aTempPointVectorEdge) { - const temporaryPoint& rTempPoint = aTempPointVectorEdge[a]; rTempPointsB.push_back(temporaryPoint(rTempPoint.getPoint(), nIndB, rTempPoint.getCut())); } } diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx index f58dceca6c7a..2f7106608f50 100644 --- a/basegfx/source/polygon/b2dpolypolygon.cxx +++ b/basegfx/source/polygon/b2dpolypolygon.cxx @@ -105,9 +105,9 @@ public: void setClosed(bool bNew) { - for(size_t a(0); a < maPolygons.size(); a++) + for(basegfx::B2DPolygon & maPolygon : maPolygons) { - maPolygons[a].setClosed(bNew); + maPolygon.setClosed(bNew); } } diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx index 3332976e9768..e7bf5a0ba246 100644 --- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx +++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx @@ -1038,9 +1038,9 @@ namespace basegfx B2DPolyPolygonVector aResult; aResult.reserve(aInput.size()); - for(size_t a(0); a < aInput.size(); a++) + for(basegfx::B2DPolyPolygon & a : aInput) { - const basegfx::B2DPolyPolygon aCandidate(prepareForPolygonOperation(aInput[a])); + const basegfx::B2DPolyPolygon aCandidate(prepareForPolygonOperation(a)); if(!aResult.empty()) { diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx index e36d2af4930d..f25b7bfb884e 100644 --- a/basegfx/source/polygon/b2dtrapezoid.cxx +++ b/basegfx/source/polygon/b2dtrapezoid.cxx @@ -423,10 +423,9 @@ namespace basegfx // there were horizontal edges. These can be excluded, but // cuts with other edges need to be solved and added before // ignoring them - for(size_t a = 0; a < rTrDeSimpleEdges.size(); a++) + for(TrDeSimpleEdge & rHorEdge : rTrDeSimpleEdges) { // get horizontal edge as candidate; prepare its range and fixed Y - const TrDeSimpleEdge& rHorEdge = rTrDeSimpleEdges[a]; const B1DRange aRange(rHorEdge.getStart().getX(), rHorEdge.getEnd().getX()); const double fFixedY(rHorEdge.getStart().getY()); -- cgit