X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fpath-chemistry.cpp;h=9a8eb3e9237b16ed1318d8aa5cca929b9ce2270b;hb=9750c2b6fc6843862effd2be59402193fe7171a1;hp=ba181476f8add21aa3660c6c1ceb04888de58410;hpb=815e3fc44098466b138092ef35137c5f71de14f9;p=inkscape.git
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index ba181476f..9a8eb3e92 100644
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
@@ -28,6 +28,7 @@
#include "text-editing.h"
#include "style.h"
#include "inkscape.h"
+#include "desktop.h"
#include "document.h"
#include "message-stack.h"
#include "selection.h"
@@ -118,7 +119,8 @@ sp_selected_path_combine(void)
g_slist_free(items);
- Inkscape::XML::Node *repr = sp_repr_new("svg:path");
+ Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc());
+ Inkscape::XML::Node *repr = xml_doc->createElement("svg:path");
// restore id
repr->setAttribute("id", id);
@@ -135,7 +137,8 @@ sp_selected_path_combine(void)
// move to the position of the topmost, reduced by the number of deleted items
repr->setPosition(topmost > 0 ? topmost + 1 : 0);
- sp_document_done(sp_desktop_document(desktop));
+ sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_COMBINE,
+ _("Combine"));
selection->set(repr);
@@ -197,7 +200,7 @@ sp_selected_path_break_apart(void)
for (GSList *l = list; l != NULL; l = l->next) {
curve = (SPCurve *) l->data;
- Inkscape::XML::Node *repr = sp_repr_new("svg:path");
+ Inkscape::XML::Node *repr = parent->document()->createElement("svg:path");
repr->setAttribute("style", style);
gchar *str = sp_svg_write_path(SP_CURVE_BPATH(curve));
@@ -228,7 +231,8 @@ sp_selected_path_break_apart(void)
}
if (did) {
- sp_document_done(sp_desktop_document(desktop));
+ sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_BREAK_APART,
+ _("Break apart"));
} else {
sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("No path(s) to break apart in the selection."));
return;
@@ -294,7 +298,8 @@ sp_selected_path_to_curves0(gboolean interactive, guint32 text_grouping_policy)
if (interactive) {
if (did) {
- sp_document_done(sp_desktop_document(desktop));
+ sp_document_done(sp_desktop_document(desktop), SP_VERB_OBJECT_TO_CURVE,
+ _("Object to path"));
} else {
sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("No objects to convert to path in the selection."));
return;
@@ -318,7 +323,8 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 text_grouping_policy)
if (!curve)
return NULL;
- Inkscape::XML::Node *repr = sp_repr_new("svg:path");
+ Inkscape::XML::Document *xml_doc = SP_OBJECT_REPR(item)->document();
+ Inkscape::XML::Node *repr = xml_doc->createElement("svg:path");
/* Transformation */
repr->setAttribute("transform", SP_OBJECT_REPR(item)->attribute("transform"));
/* Style */
@@ -326,6 +332,17 @@ 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);
+
+ /* Mask */
+ gchar *mask_str = (gchar *) SP_OBJECT_REPR(item)->attribute("mask");
+ if ( mask_str )
+ repr->setAttribute("mask", mask_str);
+
+ /* Clip path */
+ gchar *clip_path_str = (gchar *) SP_OBJECT_REPR(item)->attribute("clip-path");
+ if ( clip_path_str )
+ repr->setAttribute("clip-path", clip_path_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"));
@@ -371,7 +388,8 @@ sp_selected_path_reverse()
}
if (did) {
- sp_document_done(sp_desktop_document(desktop));
+ sp_document_done(sp_desktop_document(desktop), SP_VERB_SELECTION_REVERSE,
+ _("Reverse path"));
} else {
sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("No paths to reverse in the selection."));
}