From fbe59eb1913a779115d9c4769a4066d08e30ff44 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 8 May 2015 00:25:20 +0200 Subject: better fix, using std::remove instead of std::erase (bzr r14122) --- src/selection-chemistry.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 3a68b03e5..1e3afc6a8 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -3922,9 +3922,7 @@ void sp_selection_set_mask(SPDesktop *desktop, bool apply_clip_path, bool apply_ for (GSList *i = apply_to_items ; NULL != i ; i = i->next) { reprs_to_group.push_back(static_cast(i->data)->getRepr()); - std::vector::iterator element = find(items_to_select.begin(),items_to_select.end(),static_cast(i->data)); - if(element != items_to_select.end()) - items_to_select.erase(element); + remove(items_to_select.begin(),items_to_select.end(),static_cast(i->data)); } sp_selection_group_impl(reprs_to_group, group, xml_doc, doc); @@ -3974,9 +3972,7 @@ void sp_selection_set_mask(SPDesktop *desktop, bool apply_clip_path, bool apply_ Inkscape::XML::Node *spnew = current->duplicate(xml_doc); gint position = current->position(); - std::vector::iterator element = find(items_to_select.begin(),items_to_select.end(),item); - if(element != items_to_select.end()) - items_to_select.erase(element); + remove(items_to_select.begin(),items_to_select.end(),item); current->parent()->appendChild(group); sp_repr_unparent(current); group->appendChild(spnew); @@ -4000,9 +3996,7 @@ void sp_selection_set_mask(SPDesktop *desktop, bool apply_clip_path, bool apply_ for (GSList *i = items_to_delete; NULL != i; i = i->next) { SPObject *item = reinterpret_cast(i->data); item->deleteObject(false); - std::vector::iterator element = find(items_to_select.begin(),items_to_select.end(),item); - if(element != items_to_select.end()) - items_to_select.erase(element); + remove(items_to_select.begin(),items_to_select.end(),item); } g_slist_free(items_to_delete); @@ -4127,9 +4121,7 @@ void sp_selection_unset_mask(SPDesktop *desktop, bool apply_clip_path) { for (GSList *i = items_to_ungroup ; NULL != i ; i = i->next) { SPGroup *group = dynamic_cast(static_cast(i->data)); if (group) { - std::vector::iterator element = find(items_to_select.begin(),items_to_select.end(),group); - if(element != items_to_select.end()) - items_to_select.erase(element); + remove(items_to_select.begin(),items_to_select.end(),group); std::vector children; sp_item_group_ungroup(group, children, false); items_to_select.insert(items_to_select.end(),children.rbegin(),children.rend()); -- cgit v1.2.3