From c55b8b44d0b477069231a62507d5cbd968a34935 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sat, 28 Oct 2017 19:19:36 +0200 Subject: Bug fixes previous to overlay implementation --- src/selection-chemistry.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 0bd611163..b8a769d1c 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -3096,7 +3096,6 @@ void ObjectSet::toSymbol() SPDocument *doc = document(); Inkscape::XML::Document *xml_doc = doc->getReprDoc(); - // Check if something is selected. if (isEmpty()) { if (desktop()) @@ -3154,8 +3153,11 @@ void ObjectSet::toSymbol() // For a single group, copy relevant attributes. if( single_group ) { - symbol_repr->setAttribute("style", the_group->getAttribute("style")); + symbol_repr->setAttribute("title", the_group->getAttribute("title")); + if (!the_group->getAttribute("title")) { + symbol_repr->setAttribute("title", _("Symbol without title")); + } symbol_repr->setAttribute("class", the_group->getAttribute("class")); Glib::ustring id = the_group->getAttribute("id"); the_group->setAttribute("id", id + "_transform"); @@ -3214,7 +3216,6 @@ void ObjectSet::unSymbol() { SPDocument *doc = document(); Inkscape::XML::Document *xml_doc = doc->getReprDoc(); - // Check if something is selected. if (isEmpty()) { if(desktop()) @@ -3236,8 +3237,12 @@ void ObjectSet::unSymbol() // Create new and insert in current layer Inkscape::XML::Node *group = xml_doc->createElement("svg:g"); - symbol->parent->getRepr()->appendChild(group); - + //TODO: Better handle if no desktop, currently go to defs without it + if(desktop()) { + desktop()->currentLayer()->getRepr()->appendChild(group); + } else { + symbol->parent->getRepr()->appendChild(group); + } // Move all children of symbol to group std::vector children = symbol->childList(false); @@ -3265,6 +3270,7 @@ void ObjectSet::unSymbol() // Copy relevant attributes group->setAttribute("style", symbol->getAttribute("style")); group->setAttribute("class", symbol->getAttribute("class")); + group->setAttribute("title", symbol->getAttribute("title")); group->setAttribute("inkscape:transform-center-x", symbol->getAttribute("inkscape:transform-center-x")); group->setAttribute("inkscape:transform-center-y", -- cgit v1.2.3