diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index f7e60af3b1e79a43d03f919a0ee8835e8e11c951..0aae58d0cbef0c82fabee37e6bcd51121ff19d7b 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -661,56 +661,6 @@ void Script::copy_doc (Inkscape::XML::Node * oldroot, Inkscape::XML::Node * newr g_warning("Error on copy_doc: NULL pointer input."); return; } - - // For copying attributes in root and in namedview - std::vector attribs; - - // Must explicitly copy root attributes. This must be done first since - // copying grid lines calls "SPGuide::set()" which needs to know the - // width, height, and viewBox of the root element. - - // Make a list of all attributes of the old root node. - for (const auto & iter : oldroot->attributeList()) { - attribs.push_back(g_quark_to_string(iter.key)); - } - - // Delete the attributes of the old root node. - for (auto attrib : attribs) { - oldroot->removeAttribute(attrib); - } - - // Set the new attributes. - for (const auto & iter : newroot->attributeList()) { - gchar const *name = g_quark_to_string(iter.key); - oldroot->setAttribute(name, newroot->attribute(name)); - } - - // Question: Why is the "sodipodi:namedview" special? Treating it as a normal - // element results in crashes. - // Seems to be a bug: - // http://inkscape.13.x6.nabble.com/Effect-that-modifies-the-document-properties-tt2822126.html - - std::vector delete_list; - - // Make list - for (Inkscape::XML::Node * child = oldroot->firstChild(); - child != nullptr; - child = child->next()) { - if (!strcmp("sodipodi:namedview", child->name())) { - for (Inkscape::XML::Node * oldroot_namedview_child = child->firstChild(); - oldroot_namedview_child != nullptr; - oldroot_namedview_child = oldroot_namedview_child->next()) { - delete_list.push_back(oldroot_namedview_child); - } - break; - } - } - - // Unparent (delete) - for (auto & i : delete_list) { - sp_repr_unparent(i); - } - attribs.clear(); oldroot->mergeFrom(newroot, "id", true, true); }