summaryrefslogtreecommitdiffstats
path: root/src/sp-object.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2017-01-24 09:32:24 +0000
committerjabiertxof <info@marker.es>2017-01-24 09:32:24 +0000
commit7fecbddd1fb8b57f9c6efd3204645e33d9b38d09 (patch)
treece9f038347327a219b55fae5be1f6b30d91d1522 /src/sp-object.cpp
parentRemove some code and make dependant of rotate copies (diff)
downloadinkscape-7fecbddd1fb8b57f9c6efd3204645e33d9b38d09.tar.gz
inkscape-7fecbddd1fb8b57f9c6efd3204645e33d9b38d09.zip
update to trunk
(bzr r15356.1.18)
Diffstat (limited to 'src/sp-object.cpp')
-rw-r--r--src/sp-object.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 75f4657ef..0dc301c49 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -775,6 +775,21 @@ void SPObject::appendChild(Inkscape::XML::Node *child) {
repr->appendChild(child);
}
+SPObject* SPObject::nthChild(unsigned index) {
+ g_assert(this->repr);
+ if (hasChildren()) {
+ std::vector<SPObject*> l;
+ unsigned counter = 0;
+ for (auto& child: children) {
+ if (counter == index) {
+ return &child;
+ }
+ counter++;
+ }
+ }
+ return NULL;
+}
+
void SPObject::addChild(Inkscape::XML::Node *child, Inkscape::XML::Node * prev)
{
g_assert(this->repr);