summaryrefslogtreecommitdiffstats
path: root/src/snap.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2015-12-09 15:49:59 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2015-12-09 15:49:59 +0000
commit50ab3a3c4215474d437f9adcc4b725bed26767d7 (patch)
tree0241555b1dc6efe9f35db7696c7e440e8a56bada /src/snap.cpp
parentRemove unused var in header file (diff)
parentupdate to trunk (diff)
downloadinkscape-50ab3a3c4215474d437f9adcc4b725bed26767d7.tar.gz
inkscape-50ab3a3c4215474d437f9adcc4b725bed26767d7.zip
Merge glib_hunt: cppification and removal of many glib GList/GSList/GHashTable
(bzr r14520)
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