From b95db4b4d6c41793e804a235a869cb5107d35b22 Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Fri, 11 Apr 2008 08:03:13 +0000 Subject: Refactor snapping mechanisms: in seltrans.cpp, a GSList was converted to a std::list in four different places. Now this is handled in only one place (bzr r5407) --- src/snapper.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/snapper.cpp') diff --git a/src/snapper.cpp b/src/snapper.cpp index 31a96a871..803506e76 100644 --- a/src/snapper.cpp +++ b/src/snapper.cpp @@ -104,7 +104,7 @@ void Inkscape::Snapper::freeSnap(SnappedConstraints &sc, std::vector &points_to_snap, SPItem const *it) const { - std::list lit; + std::vector lit; if (it) { lit.push_back(it); } @@ -128,7 +128,7 @@ void Inkscape::Snapper::freeSnap(SnappedConstraints &sc, NR::Point const &p, bool const &first_point, std::vector &points_to_snap, - std::list const &it, + std::vector const &it, std::vector *unselected_nodes) const { if (_snap_enabled == false || getSnapFrom(t) == false) { @@ -160,8 +160,10 @@ void Inkscape::Snapper::constrainedSnap(SnappedConstraints &sc, ConstraintLine const &c, SPItem const *it) const { - std::list lit; - lit.push_back(it); + std::vector lit; + if (it) { + lit.push_back(it); + } constrainedSnap(sc, t, p, first_point, points_to_snap, c, lit); } @@ -183,7 +185,7 @@ void Inkscape::Snapper::constrainedSnap(SnappedConstraints &sc, bool const &first_point, std::vector &points_to_snap, ConstraintLine const &c, - std::list const &it) const + std::vector const &it) const { if (_snap_enabled == false || getSnapFrom(t) == false) { return; -- cgit v1.2.3