From 5a341e126709e3c9ef01680e116d5ce0d55d9f8c Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 10 Mar 2018 17:00:23 +0100 Subject: Use for-range loops in drawinglayer and dtrans Change-Id: I4d3368e2ffa4d98c04d69b8f5ef485558d812fda Reviewed-on: https://gerrit.libreoffice.org/51047 Tested-by: Jenkins Reviewed-by: Julien Nabet --- drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx | 4 ++-- drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx | 4 ++-- drawinglayer/source/processor2d/vclprocessor2d.cxx | 13 ++++++------- 3 files changed, 10 insertions(+), 11 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx index f7d4e619488d..d9865d100e4a 100644 --- a/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx @@ -99,9 +99,9 @@ namespace drawinglayer if(getPositions().size()) { // get the basic range from the position vector - for(std::vector< basegfx::B2DPoint >::const_iterator aIter(getPositions().begin()), aEnd(getPositions().end()); aIter != aEnd; ++aIter) + for (auto const& pos : getPositions()) { - aRetval.expand(*aIter); + aRetval.expand(pos); } if(!getMarker().IsEmpty()) diff --git a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx index e32942661042..86292fd8e308 100644 --- a/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx @@ -58,9 +58,9 @@ namespace drawinglayer basegfx::B2DRange aNewRange; // get the basic range from the position vector - for(std::vector< basegfx::B2DPoint >::const_iterator aIter(getPositions().begin()), aEnd(getPositions().end()); aIter != aEnd; ++aIter) + for (auto const& pos : getPositions()) { - aNewRange.expand(*aIter); + aNewRange.expand(pos); } // assign to buffered value diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 784ae2a4ff8c..df0b95b7cdec 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -235,10 +235,9 @@ namespace drawinglayer const basegfx::B2DVector aPixelVector(maCurrentTransformation * basegfx::B2DVector(1.0, 0.0)); const double fPixelVectorFactor(aPixelVector.getLength()); - for(std::vector< double >::const_iterator aStart(rTextCandidate.getDXArray().begin()); - aStart != rTextCandidate.getDXArray().end(); ++aStart) + for (auto const& elem : rTextCandidate.getDXArray()) { - aTransformedDXArray.push_back(basegfx::fround((*aStart) * fPixelVectorFactor)); + aTransformedDXArray.push_back(basegfx::fround(elem * fPixelVectorFactor)); } } @@ -921,9 +920,9 @@ namespace drawinglayer mpOutputDevice->EnableMapMode(false); - for(std::vector< basegfx::B2DPoint >::const_iterator aIter(rPositions.begin()); aIter != rPositions.end(); ++aIter) + for (auto const& pos : rPositions) { - const basegfx::B2DPoint aDiscreteTopLeft((maCurrentTransformation * (*aIter)) - aDiscreteHalfSize); + const basegfx::B2DPoint aDiscreteTopLeft((maCurrentTransformation * pos) - aDiscreteHalfSize); const Point aDiscretePoint(basegfx::fround(aDiscreteTopLeft.getX()), basegfx::fround(aDiscreteTopLeft.getY())); mpOutputDevice->DrawBitmapEx(aDiscretePoint + aOrigin, rMarker); @@ -941,9 +940,9 @@ namespace drawinglayer const basegfx::BColor aRGBColor(maBColorModifierStack.getModifiedColor(rPointArrayCandidate.getRGBColor())); const Color aVCLColor(aRGBColor); - for(std::vector< basegfx::B2DPoint >::const_iterator aIter(rPositions.begin()); aIter != rPositions.end(); ++aIter) + for (auto const& pos : rPositions) { - const basegfx::B2DPoint aViewPosition(maCurrentTransformation * (*aIter)); + const basegfx::B2DPoint aViewPosition(maCurrentTransformation * pos); const Point aPos(basegfx::fround(aViewPosition.getX()), basegfx::fround(aViewPosition.getY())); mpOutputDevice->DrawPixel(aPos, aVCLColor); -- cgit