summaryrefslogtreecommitdiffstats
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2015-12-05 11:33:26 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2015-12-05 11:33:26 +0000
commit151733327589217e84c5ac7006b9076f428c53a0 (patch)
tree795008ca0e01c65760a1dea3258c5d0ae89522ed /src/snap.cpp
parentadded comment + simpler rounding (diff)
downloadinkscape-151733327589217e84c5ac7006b9076f428c53a0.tar.gz
inkscape-151733327589217e84c5ac7006b9076f428c53a0.zip
cppification: GSList replaced by vectors (mostly related to guides and grids)
(bzr r14504.1.1)
Diffstat (limited to '')
-rw-r--r--src/snap.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/snap.cpp b/src/snap.cpp
index 4721283c3..7f0e8d9dc 100644
--- a/src/snap.cpp
+++ b/src/snap.cpp
@@ -69,9 +69,8 @@ SnapManager::SnapperList SnapManager::getGridSnappers() const
SnapperList s;
if (_desktop && _desktop->gridsEnabled() && snapprefs.isTargetSnappable(Inkscape::SNAPTARGET_GRID)) {
- for ( GSList const *l = _named_view->grids; l != NULL; l = l->next) {
- Inkscape::CanvasGrid *grid = (Inkscape::CanvasGrid*) l->data;
- s.push_back(grid->snapper);
+ for(std::vector<Inkscape::CanvasGrid *>::const_iterator it = _named_view->grids.begin(); it != _named_view->grids.end(); ++it) {
+ s.push_back((*it)->snapper);
}
}
@@ -173,8 +172,8 @@ Geom::Point SnapManager::multipleOfGridPitch(Geom::Point const &t, Geom::Point c
// Cannot use getGridSnappers() because we need both the grids AND their snappers
// Therefore we iterate through all grids manually
- for (GSList const *l = _named_view->grids; l != NULL; l = l->next) {
- Inkscape::CanvasGrid *grid = (Inkscape::CanvasGrid*) l->data;
+ for (std::vector<Inkscape::CanvasGrid *>::const_iterator it = _named_view->grids.begin(); it != _named_view->grids.end(); ++it) {
+ Inkscape::CanvasGrid *grid = (*it);
const Inkscape::Snapper* snapper = grid->snapper;
if (snapper && snapper->ThisSnapperMightSnap()) {
// To find the nearest multiple of the grid pitch for a given translation t, we