From bf7c3e8d98b557cb64447804399797d93e1cedc0 Mon Sep 17 00:00:00 2001 From: John Smith Date: Wed, 19 Sep 2012 10:52:19 +0900 Subject: Fix for 643150 : Auto-palette swatches duplicated on copy and paste (bzr r11677) --- src/file.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index dcdae1700..778306d5d 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1142,6 +1142,8 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, place_to_insert = in_doc->getRoot(); } + in_doc->importDefs(doc); + // Construct a new object representing the imported image, // and insert it into the current document. SPObject *new_obj = NULL; @@ -1162,12 +1164,7 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, // don't lose top-level defs or style elements else if (child->getRepr()->type() == Inkscape::XML::ELEMENT_NODE) { const gchar *tag = child->getRepr()->name(); - if (!strcmp(tag, "svg:defs")) { - for ( SPObject *x = child->firstChild(); x; x = x->getNext() ) { - in_defs->getRepr()->addChild(x->getRepr()->duplicate(xml_in_doc), last_def); - } - } - else if (!strcmp(tag, "svg:style")) { + if (!strcmp(tag, "svg:style")) { in_doc->getRoot()->appendChildRepr(child->getRepr()->duplicate(xml_in_doc)); } } -- cgit v1.2.3