From 5401a129da2f319316221727fef5c516c3a72906 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 8 Jun 2016 11:16:29 +0200 Subject: Only update inkscape.version on successful file write. (bzr r14965) --- src/sp-root.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/sp-root.cpp') diff --git a/src/sp-root.cpp b/src/sp-root.cpp index 8bedec0a5..98eae2159 100644 --- a/src/sp-root.cpp +++ b/src/sp-root.cpp @@ -313,9 +313,11 @@ Inkscape::XML::Node *SPRoot::write(Inkscape::XML::Document *xml_doc, Inkscape::X repr = xml_doc->createElement("svg:svg"); } - if (flags & SP_OBJECT_WRITE_EXT) { - repr->setAttribute("inkscape:version", Inkscape::version_string); - } + /* Only update version string on successful write to file. This is handled by 'file_save()'. + * if (flags & SP_OBJECT_WRITE_EXT) { + * repr->setAttribute("inkscape:version", Inkscape::version_string); + * } + */ if (!repr->attribute("version")) { gchar *myversion = sp_version_to_string(this->version.svg); -- cgit v1.2.3 From d1947e768272c703674129d5c583204ff2b59251 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 13 Jul 2016 13:36:19 +0200 Subject: Second part of new SPObject children list (bzr r14954.1.19) --- src/sp-root.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/sp-root.cpp') diff --git a/src/sp-root.cpp b/src/sp-root.cpp index 98eae2159..cfd0ced10 100644 --- a/src/sp-root.cpp +++ b/src/sp-root.cpp @@ -73,9 +73,9 @@ void SPRoot::build(SPDocument *document, Inkscape::XML::Node *repr) SPGroup::build(document, repr); // Search for first node - for (SPObject *o = this->firstChild() ; o ; o = o->getNext()) { - if (SP_IS_DEFS(o)) { - this->defs = SP_DEFS(o); + for (auto& o: _children) { + if (SP_IS_DEFS(&o)) { + this->defs = SP_DEFS(&o); break; } } @@ -174,9 +174,9 @@ void SPRoot::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) if (co && SP_IS_DEFS(co)) { // We search for first node - it is not beautiful, but works - for (SPObject *c = this->firstChild() ; c ; c = c->getNext()) { - if (SP_IS_DEFS(c)) { - this->defs = SP_DEFS(c); + for (auto& c: _children) { + if (SP_IS_DEFS(&c)) { + this->defs = SP_DEFS(&c); break; } } @@ -189,7 +189,8 @@ void SPRoot::remove_child(Inkscape::XML::Node *child) SPObject *iter = 0; // We search for first remaining node - it is not beautiful, but works - for (iter = this->firstChild() ; iter ; iter = iter->getNext()) { + for (auto& child: _children) { + iter = &child; if (SP_IS_DEFS(iter) && (SPDefs *)iter != this->defs) { this->defs = (SPDefs *)iter; break; -- cgit v1.2.3 From 24d3f50003ca3cec6a03a7f5267cc4fe5588c69f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Jul 2016 13:17:21 +0200 Subject: Renamed children list in SPObject (bzr r14954.1.21) --- src/sp-root.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sp-root.cpp') diff --git a/src/sp-root.cpp b/src/sp-root.cpp index cfd0ced10..34047054a 100644 --- a/src/sp-root.cpp +++ b/src/sp-root.cpp @@ -73,7 +73,7 @@ void SPRoot::build(SPDocument *document, Inkscape::XML::Node *repr) SPGroup::build(document, repr); // Search for first node - for (auto& o: _children) { + for (auto& o: children) { if (SP_IS_DEFS(&o)) { this->defs = SP_DEFS(&o); break; @@ -174,7 +174,7 @@ void SPRoot::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) if (co && SP_IS_DEFS(co)) { // We search for first node - it is not beautiful, but works - for (auto& c: _children) { + for (auto& c: children) { if (SP_IS_DEFS(&c)) { this->defs = SP_DEFS(&c); break; @@ -189,7 +189,7 @@ void SPRoot::remove_child(Inkscape::XML::Node *child) SPObject *iter = 0; // We search for first remaining node - it is not beautiful, but works - for (auto& child: _children) { + for (auto& child: children) { iter = &child; if (SP_IS_DEFS(iter) && (SPDefs *)iter != this->defs) { this->defs = (SPDefs *)iter; -- cgit v1.2.3