summaryrefslogtreecommitdiffstats
path: root/src/path-chemistry.cpp
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-06-08 17:08:50 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-06-08 17:08:50 +0000
commitcb6920745b23c7cb939e348f4c5b9a39c1791fdd (patch)
tree25313f6da0ed42f4190e8b32f8107ab41e08bb2c /src/path-chemistry.cpp
parentPatch from sas to avoid GC warning during vacuum defs (closes LP #236816) (diff)
downloadinkscape-cb6920745b23c7cb939e348f4c5b9a39c1791fdd.tar.gz
inkscape-cb6920745b23c7cb939e348f4c5b9a39c1791fdd.zip
Patch from sas for LP #231690 (crash when combining two paths)
(bzr r5853)
Diffstat (limited to 'src/path-chemistry.cpp')
-rw-r--r--src/path-chemistry.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index 35ba1f087..aac75756e 100644
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
@@ -57,6 +57,7 @@ sp_selected_path_combine(void)
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ SPDocument *doc = sp_desktop_document(desktop);
if (g_slist_length((GSList *) selection->itemList()) < 2) {
sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>at least two objects</b> to combine."));
@@ -68,18 +69,17 @@ sp_selected_path_combine(void)
desktop->setWaitingCursor();
GSList *items = g_slist_copy((GSList *) selection->itemList());
- GSList *already_paths = NULL;
GSList *to_paths = NULL;
for (GSList *i = items; i != NULL; i = i->next) {
SPItem *item = (SPItem *) i->data;
- if (SP_IS_PATH(item))
- already_paths = g_slist_prepend(already_paths, item);
- else
+ if (!SP_IS_PATH(item))
to_paths = g_slist_prepend(to_paths, item);
}
GSList *converted = NULL;
bool did = sp_item_list_to_curves(to_paths, &items, &converted);
- items = g_slist_concat (items, converted);
+ g_slist_free(to_paths);
+ for (GSList *i = converted; i != NULL; i = i->next)
+ items = g_slist_prepend(items, doc->getObjectByRepr((Inkscape::XML::Node*)(i->data)));
items = g_slist_sort(items, (GCompareFunc) sp_item_repr_compare_position);
items = g_slist_reverse(items);