diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2017-01-24 09:32:24 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2017-01-24 09:32:24 +0000 |
| commit | 7fecbddd1fb8b57f9c6efd3204645e33d9b38d09 (patch) | |
| tree | ce9f038347327a219b55fae5be1f6b30d91d1522 /src/sp-object.cpp | |
| parent | Remove some code and make dependant of rotate copies (diff) | |
| download | inkscape-7fecbddd1fb8b57f9c6efd3204645e33d9b38d09.tar.gz inkscape-7fecbddd1fb8b57f9c6efd3204645e33d9b38d09.zip | |
update to trunk
(bzr r15356.1.18)
Diffstat (limited to '')
| -rw-r--r-- | src/sp-object.cpp | 15 |
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); |
