summaryrefslogtreecommitdiffstats
path: root/src/sp-object.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-12-05 20:55:14 +0000
committerjabiertxof <info@marker.es>2016-12-05 20:55:14 +0000
commit1361cbe77c067e59ccbd25ed5eb1c50e177f8b34 (patch)
tree8f7ca25402cc6199c8dc9b2a54fd46f31cb38d02 /src/sp-object.cpp
parentRollback a unwanted modified file (diff)
downloadinkscape-1361cbe77c067e59ccbd25ed5eb1c50e177f8b34.tar.gz
inkscape-1361cbe77c067e59ccbd25ed5eb1c50e177f8b34.zip
Working on mirror LPE
(bzr r15295.1.6)
Diffstat (limited to 'src/sp-object.cpp')
-rw-r--r--src/sp-object.cpp14
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);