summaryrefslogtreecommitdiffstats
path: root/src/uri-references.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/uri-references.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/uri-references.cpp')
-rw-r--r--src/uri-references.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/uri-references.cpp b/src/uri-references.cpp
index d626d0e41..07f2d168b 100644
--- a/src/uri-references.cpp
+++ b/src/uri-references.cpp
@@ -74,10 +74,11 @@ bool URIReference::_acceptObject(SPObject *obj) const
std::vector<int> positions;
while (owner->cloned) {
int position = 0;
- SPObject *c = owner->parent->firstChild();
- while (c != owner && dynamic_cast<SPObject *>(c)) {
+ for (auto &child: owner->parent->children) {
+ if(&child == owner) {
+ break;
+ }
position++;
- c = c->next;
}
positions.push_back(position);
owner = owner->parent;
@@ -90,7 +91,7 @@ bool URIReference::_acceptObject(SPObject *obj) const
g_warning("cloned object with no known type\n");
return false;
}
- for (int i = positions.size() - 2; i >= 0; i--)
+ for (int i = (int) (positions.size() - 2); i >= 0; i--)
owner = owner->childList(false)[positions[i]];
}
// once we have the "original" object (hopefully) we look at who is referencing it