diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2017-01-25 09:46:27 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2017-01-25 09:46:27 +0000 |
| commit | 59ed5cf5fae750ea136fe8f5a37df23b541f80d5 (patch) | |
| tree | 08fd8c0ac7d70c22fe8e2c1edc960235e2710010 /src/sp-object.cpp | |
| parent | Update to trunk (diff) | |
| parent | Comented one of the shortcuts for doc rotate because bad response now interac... (diff) | |
| download | inkscape-59ed5cf5fae750ea136fe8f5a37df23b541f80d5.tar.gz inkscape-59ed5cf5fae750ea136fe8f5a37df23b541f80d5.zip | |
update to trunk
(bzr r13645.1.168)
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); |
