summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorJabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es>2017-11-16 10:44:52 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx-desktop.markerlab.es>2017-11-16 10:44:52 +0000
commite068794cdcfb86203db5ab72f6f1d632b5d900d9 (patch)
treee675f4f455f495af2684bd884521b097d44258c3 /src/selection-chemistry.cpp
parentWorking on fix (diff)
downloadinkscape-e068794cdcfb86203db5ab72f6f1d632b5d900d9.tar.gz
inkscape-e068794cdcfb86203db5ab72f6f1d632b5d900d9.zip
Fix title problems
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index e6fa11c4c..b18cea034 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -3150,27 +3150,34 @@ void ObjectSet::toSymbol()
Inkscape::XML::Node *defsrepr = doc->getDefs()->getRepr();
Inkscape::XML::Node *symbol_repr = xml_doc->createElement("svg:symbol");
Inkscape::XML::Node *title_repr = xml_doc->createElement("svg:title");
- Inkscape::XML::Node *desc_repr = xml_doc->createElement("svg:desc");
+
defsrepr->appendChild(symbol_repr);
bool settitle = false;
// For a single group, copy relevant attributes.
if( single_group ) {
+ Glib::ustring id = the_group->getAttribute("id");
symbol_repr->setAttribute("style", the_group->getAttribute("style"));
- symbol_repr->appendChild(title_repr);
gchar * title = the_group->title();
if (title) {
- title_repr->setContent(title);
- } else {
- title_repr->setContent(_("Symbol without title"));
+ symbol_repr->appendChild(title_repr);
+ title_repr->appendChild(xml_doc->createTextNode(title));
+ title_repr->setPosition(0);
+ Inkscape::GC::release(title_repr);
}
+ g_free(title);
+
gchar * desc = the_group->desc();
if (desc) {
+ Inkscape::XML::Node *desc_repr = xml_doc->createElement("svg:desc");
desc_repr->setContent(desc);
+ desc_repr->appendChild(xml_doc->createTextNode(desc));
symbol_repr->appendChild(desc_repr);
+ desc_repr->setPosition(1);
+ Inkscape::GC::release(desc_repr);
}
+ g_free(desc);
symbol_repr->setAttribute("class", the_group->getAttribute("class"));
- Glib::ustring id = the_group->getAttribute("id");
the_group->setAttribute("id", id + "_transform");
symbol_repr->setAttribute("id", id);
@@ -3190,24 +3197,26 @@ void ObjectSet::toSymbol()
gchar* title = (*i)->title();
if (!single_group && !settitle && title) {
symbol_repr->appendChild(title_repr);
- title_repr->setContent(title);
+ title_repr->appendChild(xml_doc->createTextNode(title));
+ title_repr->setPosition(0);
+ Inkscape::GC::release(title_repr);
gchar * desc = (*i)->desc();
if (desc) {
- desc_repr->setContent(desc);
+ Inkscape::XML::Node *desc_repr = xml_doc->createElement("svg:desc");
+ desc_repr->appendChild(xml_doc->createTextNode(desc));
symbol_repr->appendChild(desc_repr);
+ Inkscape::GC::release(desc_repr);
+ desc_repr->setPosition(1);
}
+ g_free(desc);
settitle = true;
}
+ g_free(title);
Inkscape::XML::Node *repr = (*i)->getRepr();
repr->parent()->removeChild(repr);
symbol_repr->addChild(repr, NULL);
}
- if (!settitle) {
- symbol_repr->appendChild(title_repr);
- title_repr->setContent(_("Symbol without title"));
- }
-
if( single_group && transform.isTranslation() ) {
the_group->deleteObject(true);
}