Code

Updated cases for attributes added in <color-profile> support
[inkscape.git] / src / path-chemistry.cpp
index 9a1193983ef094db05ace132d84036448aa402b8..663cd6da4031b2542dac0399a274f1f3beabe924 100644 (file)
@@ -321,6 +321,9 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 text_grouping_policy)
                                                  SP_OBJECT_STYLE(SP_OBJECT_PARENT(item)));
     repr->setAttribute("style", style_str);
     g_free(style_str);
+    /* Rotation center */
+    sp_repr_set_attr(repr, "inkscape:transform-center-x", SP_OBJECT_REPR(item)->attribute("inkscape:transform-center-x"));
+    sp_repr_set_attr(repr, "inkscape:transform-center-y", SP_OBJECT_REPR(item)->attribute("inkscape:transform-center-y"));
 
     /* Definition */
     gchar *def_str = sp_svg_write_path(curve->bpath);
@@ -338,7 +341,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 +350,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);
     }