summaryrefslogtreecommitdiffstats
path: root/src/sp-pattern.cpp
diff options
context:
space:
mode:
authorAdrian Boguszewski <adrbogus1@student.pg.gda.pl>2016-07-13 11:36:19 +0000
committerAdrian Boguszewski <adrbogus1@student.pg.gda.pl>2016-07-13 11:36:19 +0000
commitd1947e768272c703674129d5c583204ff2b59251 (patch)
treec1bf1563d0c0837cbab3733c18df0c7c82b18ff4 /src/sp-pattern.cpp
parentMerged trunk (diff)
downloadinkscape-d1947e768272c703674129d5c583204ff2b59251.tar.gz
inkscape-d1947e768272c703674129d5c583204ff2b59251.zip
Second part of new SPObject children list
(bzr r14954.1.19)
Diffstat (limited to 'src/sp-pattern.cpp')
-rw-r--r--src/sp-pattern.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp
index 55110f3c5..fde9f90f1 100644
--- a/src/sp-pattern.cpp
+++ b/src/sp-pattern.cpp
@@ -223,8 +223,8 @@ void SPPattern::_getChildren(std::list<SPObject *> &l)
{
for (SPPattern *pat_i = this; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) {
if (pat_i->firstChild()) { // find the first one with children
- for (SPObject *child = pat_i->firstChild(); child; child = child->getNext()) {
- l.push_back(child);
+ for (auto& child: pat_i->_children) {
+ l.push_back(&child);
}
break; // do not go further up the chain if children are found
}
@@ -319,8 +319,8 @@ guint SPPattern::_countHrefs(SPObject *o) const
i++;
}
- for (SPObject *child = o->firstChild(); child != NULL; child = child->next) {
- i += _countHrefs(child);
+ for (auto& child: o->_children) {
+ i += _countHrefs(&child);
}
return i;
@@ -508,13 +508,13 @@ Geom::OptRect SPPattern::viewbox() const
bool SPPattern::_hasItemChildren() const
{
- bool hasChildren = false;
- for (SPObject const *child = firstChild(); child && !hasChildren; child = child->getNext()) {
- if (SP_IS_ITEM(child)) {
- hasChildren = true;
+ for (auto& child: _children) {
+ if (SP_IS_ITEM(&child)) {
+ return true;
}
}
- return hasChildren;
+
+ return false;
}
bool SPPattern::isValid() const
@@ -558,12 +558,12 @@ cairo_pattern_t *SPPattern::pattern_new(cairo_t *base_ct, Geom::OptRect const &b
Inkscape::DrawingGroup *root = new Inkscape::DrawingGroup(drawing);
drawing.setRoot(root);
- for (SPObject *child = shown->firstChild(); child != NULL; child = child->getNext()) {
- if (SP_IS_ITEM(child)) {
+ for (auto& child: shown->_children) {
+ if (SP_IS_ITEM(&child)) {
// for each item in pattern, show it on our drawing, add to the group,
// and connect to the release signal in case the item gets deleted
Inkscape::DrawingItem *cai;
- cai = SP_ITEM(child)->invoke_show(drawing, dkey, SP_ITEM_SHOW_DISPLAY);
+ cai = SP_ITEM(&child)->invoke_show(drawing, dkey, SP_ITEM_SHOW_DISPLAY);
root->appendChild(cai);
}
}
@@ -654,9 +654,9 @@ cairo_pattern_t *SPPattern::pattern_new(cairo_t *base_ct, Geom::OptRect const &b
// Render drawing to pattern_surface via drawing context, this calls root->render
// which is really DrawingItem->render().
drawing.render(dc, one_tile);
- for (SPObject *child = shown->firstChild(); child != NULL; child = child->getNext()) {
- if (SP_IS_ITEM(child)) {
- SP_ITEM(child)->invoke_hide(dkey);
+ for (auto& child: shown->_children) {
+ if (SP_IS_ITEM(&child)) {
+ SP_ITEM(&child)->invoke_hide(dkey);
}
}