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 From 2659ce5a325688a3db9900d6d662e92048f0539e Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 7 Nov 2017 13:55:26 -0500 Subject: Misc. typos Found using `codespell -q 3 -w --skip="*.svg,*.po,*.ts,./share/tutorials,./src/libavoid,./packaging/win32/languages,./man,./src/2geom" -I ../inkscape-whitelist.txt` whereby whitelist file contained: ``` dum iff glight substract te upto ``` --- src/selection-chemistry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/selection-chemistry.cpp') diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index b8a769d1c..efc378845 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1,5 +1,5 @@ /** @file - * Miscellanous operations on selected items. + * Miscellaneous operations on selected items. */ /* Authors: * Lauris Kaplinski @@ -1998,7 +1998,7 @@ std::vector sp_get_same_fill_or_stroke_color(SPItem *sel, std::vectorstyle->fill) : &(iter->style->stroke); match = false; - if (sel_paint->isColor() && iter_paint->isColor() // color == color comparision doesnt seem to work here. + if (sel_paint->isColor() && iter_paint->isColor() // color == color comparison doesn't seem to work here. && (sel_paint->value.color.toRGBA32(1.0) == iter_paint->value.color.toRGBA32(1.0))) { match = true; } else if (sel_paint->isPaintserver() && iter_paint->isPaintserver()) { -- cgit v1.2.3