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.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/uri-references.cpp b/src/uri-references.cpp
index db46a156f..07f2d168b 100644
--- a/src/uri-references.cpp
+++ b/src/uri-references.cpp
@@ -12,7 +12,6 @@
#include <iostream>
#include <cstring>
-#include <string>
#include "document.h"
#include "sp-object.h"
@@ -21,7 +20,6 @@
#include "extract-uri.h"
#include "sp-tag-use.h"
#include <glibmm/miscutils.h>
-#include <sigc++/functors/mem_fun.h>
namespace Inkscape {
@@ -76,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;
@@ -92,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