summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-10-28 17:19:36 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2017-10-28 17:19:36 +0000
commitc55b8b44d0b477069231a62507d5cbd968a34935 (patch)
treec82ab8d646b2c84324f4b909020884aeb79c6db6 /src/selection-chemistry.cpp
parentRemove CMake blank line (diff)
downloadinkscape-c55b8b44d0b477069231a62507d5cbd968a34935.tar.gz
inkscape-c55b8b44d0b477069231a62507d5cbd968a34935.zip
Bug fixes previous to overlay implementation
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp16
1 files changed, 11 insertions, 5 deletions
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 <g> 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<SPObject*> 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",