diff options
author | Mario J. Rugiero <mrugiero@gmail.com> | 2015-10-30 01:13:55 -0300 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-30 06:02:53 +0000 |
commit | 26d5407a5f653e55ec9255117760886bcec4fe15 (patch) | |
tree | aad48e7e4c9a186032dcc771af8fa0e68a49eac8 /basegfx | |
parent | c7e8f21a538c409abe70b90d7bba38386e90a876 (diff) |
basegfx tree cleanup
- Eliminated an unnecessary boost/bind.hxx include.
- Replaced simple old-style for loops that iterated over a container by ranged based for loops.
- Replaced for_each by ranged based for loops wherever valid.
Change-Id: Ib5c8291cf6d417047b350560f0428723efeccd1c
Reviewed-on: https://gerrit.libreoffice.org/19679
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basegfx')
-rw-r--r-- | basegfx/inc/pch/precompiled_basegfx.hxx | 1 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dpolypolygon.cxx | 21 | ||||
-rw-r--r-- | basegfx/source/polygon/b3dpolypolygon.cxx | 46 | ||||
-rw-r--r-- | basegfx/source/range/b2drangeclipper.cxx | 14 | ||||
-rw-r--r-- | basegfx/test/boxclipper.cxx | 6 |
5 files changed, 30 insertions, 58 deletions
diff --git a/basegfx/inc/pch/precompiled_basegfx.hxx b/basegfx/inc/pch/precompiled_basegfx.hxx index c393169294b0..b13cf7875020 100644 --- a/basegfx/inc/pch/precompiled_basegfx.hxx +++ b/basegfx/inc/pch/precompiled_basegfx.hxx @@ -15,7 +15,6 @@ */ #include <algorithm> -#include <boost/bind.hpp> #include <boost/tuple/tuple.hpp> #include <boost/noncopyable.hpp> #include <com/sun/star/awt/Point.hpp> diff --git a/basegfx/source/polygon/b2dpolypolygon.cxx b/basegfx/source/polygon/b2dpolypolygon.cxx index a77652d74ac6..d640c5383538 100644 --- a/basegfx/source/polygon/b2dpolypolygon.cxx +++ b/basegfx/source/polygon/b2dpolypolygon.cxx @@ -113,31 +113,26 @@ public: void flip() { - std::for_each( maPolygons.begin(), - maPolygons.end(), - std::mem_fun_ref( &basegfx::B2DPolygon::flip )); + for (auto& aPolygon : maPolygons) + aPolygon.flip(); } void removeDoublePoints() { - std::for_each( maPolygons.begin(), - maPolygons.end(), - std::mem_fun_ref( &basegfx::B2DPolygon::removeDoublePoints )); + for (auto& aPolygon : maPolygons) + aPolygon.removeDoublePoints(); } void transform(const basegfx::B2DHomMatrix& rMatrix) { - for(size_t a(0L); a < maPolygons.size(); a++) - { - maPolygons[a].transform(rMatrix); - } + for (auto& aPolygon : maPolygons) + aPolygon.transform(rMatrix); } void makeUnique() { - std::for_each( maPolygons.begin(), - maPolygons.end(), - std::mem_fun_ref( &basegfx::B2DPolygon::makeUnique )); + for (auto& aPolygon : maPolygons) + aPolygon.makeUnique(); } const basegfx::B2DPolygon* begin() const diff --git a/basegfx/source/polygon/b3dpolypolygon.cxx b/basegfx/source/polygon/b3dpolypolygon.cxx index 3c6e672f478a..98bc7ca2959d 100644 --- a/basegfx/source/polygon/b3dpolypolygon.cxx +++ b/basegfx/source/polygon/b3dpolypolygon.cxx @@ -107,64 +107,50 @@ public: void flip() { - std::for_each( maPolygons.begin(), - maPolygons.end(), - std::mem_fun_ref( &::basegfx::B3DPolygon::flip )); + for (auto& aPolygon : maPolygons) + aPolygon.flip(); } void removeDoublePoints() { - std::for_each( maPolygons.begin(), - maPolygons.end(), - std::mem_fun_ref( &::basegfx::B3DPolygon::removeDoublePoints )); + for (auto& aPolygon : maPolygons) + aPolygon.removeDoublePoints(); } void transform(const ::basegfx::B3DHomMatrix& rMatrix) { - for(size_t a(0L); a < maPolygons.size(); a++) - { - maPolygons[a].transform(rMatrix); - } + for (auto& aPolygon : maPolygons) + aPolygon.transform(rMatrix); } void clearBColors() { - for(size_t a(0L); a < maPolygons.size(); a++) - { - maPolygons[a].clearBColors(); - } + for (auto& aPolygon : maPolygons) + aPolygon.clearBColors(); } void transformNormals(const ::basegfx::B3DHomMatrix& rMatrix) { - for(size_t a(0L); a < maPolygons.size(); a++) - { - maPolygons[a].transformNormals(rMatrix); - } + for (auto& aPolygon : maPolygons) + aPolygon.transformNormals(rMatrix); } void clearNormals() { - for(size_t a(0L); a < maPolygons.size(); a++) - { - maPolygons[a].clearNormals(); - } + for (auto& aPolygon : maPolygons) + aPolygon.clearNormals(); } void transformTextureCoordinates(const ::basegfx::B2DHomMatrix& rMatrix) { - for(size_t a(0L); a < maPolygons.size(); a++) - { - maPolygons[a].transformTextureCoordinates(rMatrix); - } + for (auto& aPolygon : maPolygons) + aPolygon.transformTextureCoordinates(rMatrix); } void clearTextureCoordinates() { - for(size_t a(0L); a < maPolygons.size(); a++) - { - maPolygons[a].clearTextureCoordinates(); - } + for (auto& aPolygon : maPolygons) + aPolygon.clearTextureCoordinates(); } const basegfx::B3DPolygon* begin() const diff --git a/basegfx/source/range/b2drangeclipper.cxx b/basegfx/source/range/b2drangeclipper.cxx index 7ddc85c8bd94..254912e50443 100644 --- a/basegfx/source/range/b2drangeclipper.cxx +++ b/basegfx/source/range/b2drangeclipper.cxx @@ -493,9 +493,8 @@ namespace basegfx B2DPolygon getPolygon() const { B2DPolygon aRes; - std::for_each( maPoints.begin(), - maPoints.end(), - [&aRes](const B2DPoint& aPoint) mutable { aRes.append(aPoint, 1); }); + for (auto const& aPoint : maPoints) + aRes.append(aPoint, 1); aRes.setClosed( true ); return aRes; } @@ -897,13 +896,8 @@ namespace basegfx // sometimes not enough, but a usable compromise aPolygonPool.reserve( rRanges.size() ); - std::for_each( aSweepLineEvents.begin(), - aSweepLineEvents.end(), - [&](SweepLineEvent& aSweepLineEvent) mutable { handleSweepLineEvent( - aSweepLineEvent, - aActiveEdgeList, - aPolygonPool, - aRes); } ); + for (auto& aSweepLineEvent : aSweepLineEvents) + handleSweepLineEvent(aSweepLineEvent, aActiveEdgeList, aPolygonPool, aRes); return aRes; } diff --git a/basegfx/test/boxclipper.cxx b/basegfx/test/boxclipper.cxx index 7e0bfa5196bf..406f6b23737e 100644 --- a/basegfx/test/boxclipper.cxx +++ b/basegfx/test/boxclipper.cxx @@ -164,10 +164,8 @@ public: tools::importFromSvgD( randomPoly, OUString::createFromAscii(randomSvg), false, 0); - std::for_each(randomPoly.begin(), - randomPoly.end(), - [this](const B2DPolygon& aPolygon) mutable { - this->aRandomIntersections.appendElement(aPolygon.getB2DRange(), B2VectorOrientation::Negative); } ); + for (auto const& aPolygon : randomPoly) + aRandomIntersections.appendElement(aPolygon.getB2DRange(), B2VectorOrientation::Negative); #endif } |