summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-simplify.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2019-01-02 09:41:30 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2019-01-02 09:41:30 +0000
commit169dff19d4da8d76e69b8e896aa25b0013639c03 (patch)
treea0c070fa95188b5cde708ac285e6a2db9df4a83f /src/live_effects/lpe-simplify.cpp
parentAvoid creating a new document before opening an old document. (diff)
downloadinkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.tar.gz
inkscape-169dff19d4da8d76e69b8e896aa25b0013639c03.zip
modernize loops
Diffstat (limited to 'src/live_effects/lpe-simplify.cpp')
-rw-r--r--src/live_effects/lpe-simplify.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/live_effects/lpe-simplify.cpp b/src/live_effects/lpe-simplify.cpp
index d589f16d1..56647e4e2 100644
--- a/src/live_effects/lpe-simplify.cpp
+++ b/src/live_effects/lpe-simplify.cpp
@@ -155,27 +155,27 @@ LPESimplify::generateHelperPathAndSmooth(Geom::PathVector &result)
}
Geom::PathVector tmp_path;
Geom::CubicBezier const *cubic = nullptr;
- for (Geom::PathVector::iterator path_it = result.begin(); path_it != result.end(); ++path_it) {
- if (path_it->empty()) {
+ for (auto & path_it : result) {
+ if (path_it.empty()) {
continue;
}
- Geom::Path::iterator curve_it1 = path_it->begin(); // incoming curve
- Geom::Path::iterator curve_it2 = ++(path_it->begin());// outgoing curve
- Geom::Path::iterator curve_endit = path_it->end_default(); // this determines when the loop has to stop
+ Geom::Path::iterator curve_it1 = path_it.begin(); // incoming curve
+ Geom::Path::iterator curve_it2 = ++(path_it.begin());// outgoing curve
+ Geom::Path::iterator curve_endit = path_it.end_default(); // this determines when the loop has to stop
SPCurve *nCurve = new SPCurve();
- if (path_it->closed()) {
+ if (path_it.closed()) {
// if the path is closed, maybe we have to stop a bit earlier because the
// closing line segment has zerolength.
const Geom::Curve &closingline =
- path_it->back_closed(); // the closing line segment is always of type
+ path_it.back_closed(); // the closing line segment is always of type
// Geom::LineSegment.
if (are_near(closingline.initialPoint(), closingline.finalPoint())) {
// closingline.isDegenerate() did not work, because it only checks for
// *exact* zero length, which goes wrong for relative coordinates and
// rounding errors...
// the closing line segment has zero-length. So stop before that one!
- curve_endit = path_it->end_open();
+ curve_endit = path_it.end_open();
}
}
if(helper_size > 0) {
@@ -199,7 +199,7 @@ LPESimplify::generateHelperPathAndSmooth(Geom::PathVector &result)
point_at2 = (*cubic)[2];
}
- if(path_it->closed() && curve_it2 == curve_endit) {
+ if(path_it.closed() && curve_it2 == curve_endit) {
point_at4 = start;
}
if(curve_it2 != curve_endit) {
@@ -240,7 +240,7 @@ LPESimplify::generateHelperPathAndSmooth(Geom::PathVector &result)
++curve_it1;
++curve_it2;
}
- if (path_it->closed()) {
+ if (path_it.closed()) {
nCurve->closepath_current();
}
tmp_path.push_back(nCurve->get_pathvector()[0]);