diff options
| author | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-07-11 12:24:52 +0000 |
|---|---|---|
| committer | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-07-11 12:24:52 +0000 |
| commit | 058e95a59ccb2ab1748392acdfdbbffd516c9c81 (patch) | |
| tree | 86e3958aaad129307f45e590269924b14bca303d /src/object-set.cpp | |
| parent | Added simple test for SPObject (diff) | |
| download | inkscape-058e95a59ccb2ab1748392acdfdbbffd516c9c81.tar.gz inkscape-058e95a59ccb2ab1748392acdfdbbffd516c9c81.zip | |
First part of new SPObject children list
(bzr r14954.1.17)
Diffstat (limited to 'src/object-set.cpp')
| -rw-r--r-- | src/object-set.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/object-set.cpp b/src/object-set.cpp index 07f9ea0c8..b7b84e163 100644 --- a/src/object-set.cpp +++ b/src/object-set.cpp @@ -93,14 +93,14 @@ bool ObjectSet::_anyAncestorIsInSet(SPObject *object) { } void ObjectSet::_removeDescendantsFromSet(SPObject *object) { - for (auto& child: object->childList(false)) { - if (includes(child)) { - _remove(child); + for (auto& child: object->_children) { + if (includes(&child)) { + _remove(&child); // there is certainly no children of this child in the set continue; } - _removeDescendantsFromSet(child); + _removeDescendantsFromSet(&child); } } @@ -130,8 +130,8 @@ SPObject *ObjectSet::_getMutualAncestor(SPObject *object) { bool flag = true; while (o->parent != nullptr) { - for (auto &child: o->parent->childList(false)) { - if(child != o && !includes(child)) { + for (auto &child: o->parent->_children) { + if(&child != o && !includes(&child)) { flag = false; break; } @@ -147,9 +147,9 @@ SPObject *ObjectSet::_getMutualAncestor(SPObject *object) { void ObjectSet::_removeAncestorsFromSet(SPObject *object) { SPObject* o = object; while (o->parent != nullptr) { - for (auto &child: o->parent->childList(false)) { - if (child != o) { - _add(child); + for (auto &child: o->parent->_children) { + if (&child != o) { + _add(&child); } } if (includes(o->parent)) { |
