diff options
Diffstat (limited to 'src/sp-clippath.cpp')
| -rw-r--r-- | src/sp-clippath.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp index 915c57e45..b371e15b2 100644 --- a/src/sp-clippath.cpp +++ b/src/sp-clippath.cpp @@ -127,9 +127,9 @@ void SPClipPath::update(SPCtx* ctx, unsigned int flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; GSList *l = NULL; - for ( SPObject *child = this->firstChild(); child; child = child->getNext()) { - sp_object_ref(child); - l = g_slist_prepend(l, child); + for (auto& child: children) { + sp_object_ref(&child); + l = g_slist_prepend(l, &child); } l = g_slist_reverse(l); @@ -166,9 +166,9 @@ void SPClipPath::modified(unsigned int flags) { flags &= SP_OBJECT_MODIFIED_CASCADE; GSList *l = NULL; - for (SPObject *child = this->firstChild(); child; child = child->getNext()) { - sp_object_ref(child); - l = g_slist_prepend(l, child); + for (auto& child: children) { + sp_object_ref(&child); + l = g_slist_prepend(l, &child); } l = g_slist_reverse(l); @@ -199,9 +199,9 @@ Inkscape::DrawingItem *SPClipPath::show(Inkscape::Drawing &drawing, unsigned int Inkscape::DrawingGroup *ai = new Inkscape::DrawingGroup(drawing); display = sp_clippath_view_new_prepend(display, key, ai); - for ( SPObject *child = firstChild() ; child ; child = child->getNext() ) { - if (SP_IS_ITEM(child)) { - Inkscape::DrawingItem *ac = SP_ITEM(child)->invoke_show(drawing, key, SP_ITEM_REFERENCE_FLAGS); + for (auto& child: children) { + if (SP_IS_ITEM(&child)) { + Inkscape::DrawingItem *ac = SP_ITEM(&child)->invoke_show(drawing, key, SP_ITEM_REFERENCE_FLAGS); if (ac) { /* The order is not important in clippath */ @@ -222,9 +222,9 @@ Inkscape::DrawingItem *SPClipPath::show(Inkscape::Drawing &drawing, unsigned int } void SPClipPath::hide(unsigned int key) { - for ( SPObject *child = firstChild() ; child; child = child->getNext() ) { - if (SP_IS_ITEM(child)) { - SP_ITEM(child)->invoke_hide(key); + for (auto& child: children) { + if (SP_IS_ITEM(&child)) { + SP_ITEM(&child)->invoke_hide(key); } } @@ -251,9 +251,9 @@ void SPClipPath::setBBox(unsigned int key, Geom::OptRect const &bbox) { Geom::OptRect SPClipPath::geometricBounds(Geom::Affine const &transform) { Geom::OptRect bbox; - for (SPObject *i = firstChild(); i; i = i->getNext()) { - if (SP_IS_ITEM(i)) { - Geom::OptRect tmp = SP_ITEM(i)->geometricBounds(Geom::Affine(SP_ITEM(i)->transform) * transform); + for (auto& i: children) { + if (SP_IS_ITEM(&i)) { + Geom::OptRect tmp = SP_ITEM(&i)->geometricBounds(Geom::Affine(SP_ITEM(&i)->transform) * transform); bbox.unionWith(tmp); } } |
