summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2013-11-12 22:13:31 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2013-11-12 22:13:31 +0000
commit1354af483528b94b486ec4bf12f0e2301bcf7b08 (patch)
treed409d37cfcfef0c1d497507330db5fe771950737 /src
parentpart of patch by David Evans to fix C++11 build (diff)
downloadinkscape-1354af483528b94b486ec4bf12f0e2301bcf7b08.tar.gz
inkscape-1354af483528b94b486ec4bf12f0e2301bcf7b08.zip
part of patch by David Evans to fix C++11 build
Fixed bugs: - https://launchpad.net/bugs/1244295 (bzr r12802)
Diffstat (limited to 'src')
-rw-r--r--src/remove-last.h7
-rw-r--r--src/sp-item-rm-unsatisfied-cns.cpp6
2 files changed, 6 insertions, 7 deletions
diff --git a/src/remove-last.h b/src/remove-last.h
index a5bbd89f8..8c84d0ed4 100644
--- a/src/remove-last.h
+++ b/src/remove-last.h
@@ -8,12 +8,9 @@
template<class T>
inline void remove_last(std::vector<T> &seq, T const &elem)
{
- using std::vector;
-
- typename vector<T>::reverse_iterator i(find(seq.rbegin(), seq.rend(), elem));
+ typename std::vector<T>::reverse_iterator i(find(seq.rbegin(), seq.rend(), elem));
g_assert( i != seq.rend() );
- typename vector<T>::iterator ii(&*i);
- seq.erase(ii);
+ seq.erase(i.base());
}
diff --git a/src/sp-item-rm-unsatisfied-cns.cpp b/src/sp-item-rm-unsatisfied-cns.cpp
index 8fb171c08..7a712b083 100644
--- a/src/sp-item-rm-unsatisfied-cns.cpp
+++ b/src/sp-item-rm-unsatisfied-cns.cpp
@@ -24,10 +24,12 @@ void sp_item_rm_unsatisfied_cns(SPItem &item)
g_assert( snappoint_ix < int(snappoints.size()) );
if (!Geom::are_near(cn.g->getDistanceFrom(snappoints[snappoint_ix].getPoint()), 0, 1e-2)) {
+
remove_last(cn.g->attached_items, SPGuideAttachment(&item, cn.snappoint_ix));
+
g_assert( i < item.constraints.size() );
- vector<SPGuideConstraint>::iterator const ei(&item.constraints[i]);
- item.constraints.erase(ei);
+
+ item.constraints.erase(item.constraints.begin() + i);
}
}
}