summaryrefslogtreecommitdiffstats
path: root/src/sp-root.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-10-03 20:51:05 +0000
committerjabiertxof <info@marker.es>2016-10-03 20:51:05 +0000
commit4db35e8a6706ddece9e977e5f26d4a6867ff8cbe (patch)
treef9711f260f694d96e26bf3216fb64f2b38611b2b /src/sp-root.cpp
parentupdate to trunk (diff)
parentMerge in jabiertxof's hover information for measure tool (diff)
downloadinkscape-4db35e8a6706ddece9e977e5f26d4a6867ff8cbe.tar.gz
inkscape-4db35e8a6706ddece9e977e5f26d4a6867ff8cbe.zip
Update to trunk
(bzr r15017.1.35)
Diffstat (limited to 'src/sp-root.cpp')
-rw-r--r--src/sp-root.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/sp-root.cpp b/src/sp-root.cpp
index 98eae2159..34047054a 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 <defs> 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 <defs> 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 <defs> 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;