summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-03-10 17:00:23 +0100
committerJulien Nabet <serval2412@yahoo.fr>2018-03-11 00:15:19 +0100
commit5a341e126709e3c9ef01680e116d5ce0d55d9f8c (patch)
tree85b5614a2e120e8a35b6bee861c4cf29dd8f5fcc /drawinglayer
parente9171066136868fe89947dda5095e9479d5e50e7 (diff)
Use for-range loops in drawinglayer and dtrans
Change-Id: I4d3368e2ffa4d98c04d69b8f5ef485558d812fda Reviewed-on: https://gerrit.libreoffice.org/51047 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx4
-rw-r--r--drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx4
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx13
3 files changed, 10 insertions, 11 deletions
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);