summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2015-05-07 22:12:09 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2015-05-07 22:12:09 +0000
commita06c4852edb10e38fce19fd2df3833c03b6a15e4 (patch)
treeeeaf2609e71a71657eab53b23a0196d3500b930c /src/selection-chemistry.cpp
parentExporting. Fix for Bug #1452560 (Rectangles missing from saved SIF). (diff)
downloadinkscape-a06c4852edb10e38fce19fd2df3833c03b6a15e4.tar.gz
inkscape-a06c4852edb10e38fce19fd2df3833c03b6a15e4.zip
fix crash when converting a group of objects to path
(bzr r14121)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 8bc62d4b9..3a68b03e5 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -3922,7 +3922,9 @@ 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<SPObject*>(i->data)->getRepr());
- items_to_select.erase(find(items_to_select.begin(),items_to_select.end(),static_cast<SPObject*>(i->data)));
+ std::vector<SPItem*>::iterator element = find(items_to_select.begin(),items_to_select.end(),static_cast<SPObject*>(i->data));
+ if(element != items_to_select.end())
+ items_to_select.erase(element);
}
sp_selection_group_impl(reprs_to_group, group, xml_doc, doc);
@@ -3972,7 +3974,9 @@ 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();
- items_to_select.erase(find(items_to_select.begin(),items_to_select.end(),item));
+ std::vector<SPItem*>::iterator element = find(items_to_select.begin(),items_to_select.end(),item);
+ if(element != items_to_select.end())
+ items_to_select.erase(element);
current->parent()->appendChild(group);
sp_repr_unparent(current);
group->appendChild(spnew);
@@ -3996,7 +4000,9 @@ 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<SPObject*>(i->data);
item->deleteObject(false);
- items_to_select.erase(find(items_to_select.begin(),items_to_select.end(),item));
+ std::vector<SPItem*>::iterator element = find(items_to_select.begin(),items_to_select.end(),item);
+ if(element != items_to_select.end())
+ items_to_select.erase(element);
}
g_slist_free(items_to_delete);
@@ -4121,7 +4127,9 @@ 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<SPGroup *>(static_cast<SPObject *>(i->data));
if (group) {
- items_to_select.erase(find(items_to_select.begin(),items_to_select.end(),group));
+ std::vector<SPItem*>::iterator element = find(items_to_select.begin(),items_to_select.end(),group);
+ if(element != items_to_select.end())
+ items_to_select.erase(element);
std::vector<SPItem*> children;
sp_item_group_ungroup(group, children, false);
items_to_select.insert(items_to_select.end(),children.rbegin(),children.rend());