summaryrefslogtreecommitdiffstats
path: root/src/uri-references.cpp
diff options
context:
space:
mode:
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