summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/transform-handle-set.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/ui/tool/transform-handle-set.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/ui/tool/transform-handle-set.cpp')
-rw-r--r--src/ui/tool/transform-handle-set.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ui/tool/transform-handle-set.cpp b/src/ui/tool/transform-handle-set.cpp
index 781675a99..c1d6692bc 100644
--- a/src/ui/tool/transform-handle-set.cpp
+++ b/src/ui/tool/transform-handle-set.cpp
@@ -154,8 +154,8 @@ bool TransformHandle::grabbed(GdkEventMotion *)
_all_snap_sources_sorted = _snap_points;
// Calculate and store the distance to the reference point for each snap candidate point
- for(std::vector<Inkscape::SnapCandidatePoint>::iterator i = _all_snap_sources_sorted.begin(); i != _all_snap_sources_sorted.end(); ++i) {
- (*i).setDistance(Geom::L2((*i).getPoint() - _origin));
+ for(auto & i : _all_snap_sources_sorted) {
+ i.setDistance(Geom::L2(i.getPoint() - _origin));
}
// Sort them ascending, using the distance calculated above as the single criteria
@@ -724,8 +724,8 @@ TransformHandleSet::TransformHandleSet(SPDesktop *d, SPCanvasGroup *th_group)
TransformHandleSet::~TransformHandleSet()
{
- for (unsigned i = 0; i < 17; ++i) {
- delete _handles[i];
+ for (auto & _handle : _handles) {
+ delete _handle;
}
}
@@ -844,9 +844,9 @@ void TransformHandleSet::_updateVisibility(bool v)
_center->setVisible(show_rotate /*&& bp[Geom::X] > handle_size[Geom::X]
&& bp[Geom::Y] > handle_size[Geom::Y]*/);
} else {
- for (unsigned i = 0; i < 17; ++i) {
- if (_handles[i] != _active)
- _handles[i]->setVisible(false);
+ for (auto & _handle : _handles) {
+ if (_handle != _active)
+ _handle->setVisible(false);
}
}