diff options
| author | Jabiertxof <jtx@jtx> | 2017-01-24 14:17:37 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx> | 2017-01-24 14:17:37 +0000 |
| commit | 6065dda92002a05f31d58ce373bbcccdbe761907 (patch) | |
| tree | 376d1a771f47d66b714ed28cd3563f3d9ad838b4 /src/sp-object.cpp | |
| parent | fixing to new trunk (diff) | |
| parent | Fix a translation bug in rotate copies LPE (diff) | |
| download | inkscape-6065dda92002a05f31d58ce373bbcccdbe761907.tar.gz inkscape-6065dda92002a05f31d58ce373bbcccdbe761907.zip | |
Update to trunk
(bzr r15142.1.39)
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); |
