summaryrefslogtreecommitdiffstats
path: root/src/path-chemistry.cpp
diff options
context:
space:
mode:
authorPeter Moulder <peter.moulder@monash.edu>2006-03-09 07:18:12 +0000
committerpjrm <pjrm@users.sourceforge.net>2006-03-09 07:18:12 +0000
commitb2181e0be4dd063bab086c0687917f15ea7d6c70 (patch)
tree4f238f0bd1e19ae7a192a7999df9b4f79b0ae832 /src/path-chemistry.cpp
parentCodingStyle: whitespace (diff)
downloadinkscape-b2181e0be4dd063bab086c0687917f15ea7d6c70.tar.gz
inkscape-b2181e0be4dd063bab086c0687917f15ea7d6c70.zip
(sp_selected_path_reverse): Fix when multiple paths are selected. Also fix a small memory leak.
(bzr r219)
Diffstat (limited to 'src/path-chemistry.cpp')
-rw-r--r--src/path-chemistry.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index 9a1193983..70a30c185 100644
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
@@ -338,7 +338,7 @@ sp_selected_path_reverse()
Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
GSList *items = (GSList *) selection->itemList();
- if (g_slist_length(items) == 0) {
+ if (!items) {
SP_DT_MSGSTACK(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>path(s)</b> to reverse."));
return;
}
@@ -347,16 +347,17 @@ sp_selected_path_reverse()
bool did = false;
for (GSList *i = items; i != NULL; i = i->next) {
- if (!SP_IS_SHAPE(items->data))
+ if (!SP_IS_SHAPE(i->data))
continue;
did = true;
- SPShape *shape = SP_SHAPE(items->data);
+ SPShape *shape = SP_SHAPE(i->data);
SPCurve *rcurve = sp_curve_reverse(shape->curve);
- char *str = sp_svg_write_path(rcurve->bpath);
+ gchar *str = sp_svg_write_path(rcurve->bpath);
SP_OBJECT_REPR(shape)->setAttribute("d", str);
+ g_free(str);
sp_curve_unref(rcurve);
}