summaryrefslogtreecommitdiffstats
path: root/src/sp-root.cpp
diff options
context:
space:
mode:
authorAdrian Boguszewski <adrbogus1@student.pg.gda.pl>2016-08-09 09:58:51 +0000
committerAdrian Boguszewski <adrbogus1@student.pg.gda.pl>2016-08-09 09:58:51 +0000
commite5143d65bb57d4ce623e6220585b099e6d2ee453 (patch)
tree4ff78f6fa8f0c1b740fd43b0ade2b91dbf9226d0 /src/sp-root.cpp
parentRemove deprecated Autotools and btool files. Please use CMake instead (diff)
parentMerged trunk (diff)
downloadinkscape-e5143d65bb57d4ce623e6220585b099e6d2ee453.tar.gz
inkscape-e5143d65bb57d4ce623e6220585b099e6d2ee453.zip
Merged gsoc work. Created better data structure for selections, replaced SPObject children list, improved spray tool, split tests to separate executables
(bzr r15047)
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;