summaryrefslogtreecommitdiffstats
path: root/src/snap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/snap.cpp')
-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