diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2017-01-24 08:44:56 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2017-01-24 08:44:56 +0000 |
| commit | f041688b972de984102cd314ce126e3c4eeed76d (patch) | |
| tree | 5dc87da48151fb4044f7bebc1a9fb05c46acfa41 /src/sp-object.cpp | |
| parent | Bug fixes (diff) | |
| parent | merge lp:~inkscape.dev/inkscape/rotatecopies_improvements (diff) | |
| download | inkscape-f041688b972de984102cd314ce126e3c4eeed76d.tar.gz inkscape-f041688b972de984102cd314ce126e3c4eeed76d.zip | |
Update to trunk
(bzr r15295.1.66)
Diffstat (limited to 'src/sp-object.cpp')
| -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); |
