diff options
| author | Jabiertxof <jtx@jtx> | 2016-12-28 08:42:19 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx> | 2016-12-28 08:42:19 +0000 |
| commit | 50714133d92da517b5185385ea4c553408c80e54 (patch) | |
| tree | 27ecbc256d57c51e4425bb566da888b825941c10 /src/sp-object.cpp | |
| parent | Fixes bug #1652465 on mirror and copy rotate LPE. (diff) | |
| download | inkscape-50714133d92da517b5185385ea4c553408c80e54.tar.gz inkscape-50714133d92da517b5185385ea4c553408c80e54.zip | |
First attemp working
(bzr r15356.1.1)
Diffstat (limited to 'src/sp-object.cpp')
| -rw-r--r-- | src/sp-object.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sp-object.cpp b/src/sp-object.cpp index e9c60fc7d..c2122e109 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -773,6 +773,20 @@ 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; + } + } + } + return NULL; +} + void SPObject::addChild(Inkscape::XML::Node *child, Inkscape::XML::Node * prev) { g_assert(this->repr); |
