From 9d1004a8adea809dee45ebeb038a12c9f343edcf Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Sun, 24 Aug 2008 13:16:51 +0000 Subject: Fix for Bug 238113 (preserve title/desc for various Inkscape operations) (bzr r6712) --- src/path-chemistry.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/path-chemistry.cpp') diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 4c459ba64..32a7968b2 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -339,6 +339,7 @@ sp_item_list_to_curves(const GSList *items, GSList **selected, GSList **to_selec items = items->next) { SPItem *item = SP_ITEM(items->data); + SPDocument *document = item->document; if (SP_IS_PATH(item) && !SP_PATH(item)->original_curve) { continue; // already a path, and no path effect @@ -387,6 +388,10 @@ sp_item_list_to_curves(const GSList *items, GSList **selected, GSList **to_selec Inkscape::XML::Node *parent = SP_OBJECT_REPR(item)->parent(); // remember id char const *id = SP_OBJECT_REPR(item)->attribute("id"); + // remember title + gchar *title = item->title(); + // remember description + gchar *desc = item->desc(); // It's going to resurrect, so we delete without notifying listeners. SP_OBJECT(item)->deleteObject(false); @@ -395,6 +400,16 @@ sp_item_list_to_curves(const GSList *items, GSList **selected, GSList **to_selec repr->setAttribute("id", id); // add the new repr to the parent parent->appendChild(repr); + SPObject* newObj = document->getObjectByRepr(repr); + if (title && newObj) { + newObj->setTitle(title); + g_free(title); + } + if (desc && newObj) { + newObj->setDesc(desc); + g_free(desc); + } + // move to the saved position repr->setPosition(pos > 0 ? pos : 0); -- cgit v1.2.3