summaryrefslogtreecommitdiffstats
path: root/src/sp-defs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp-defs.cpp')
-rw-r--r--src/sp-defs.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sp-defs.cpp b/src/sp-defs.cpp
index dd779c0da..865c6891e 100644
--- a/src/sp-defs.cpp
+++ b/src/sp-defs.cpp
@@ -54,9 +54,9 @@ void SPDefs::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);
@@ -79,8 +79,8 @@ Inkscape::XML::Node* SPDefs::write(Inkscape::XML::Document *xml_doc, Inkscape::X
}
GSList *l = NULL;
- for ( SPObject *child = this->firstChild() ; child; child = child->getNext() ) {
- Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags);
+ for (auto& child: children) {
+ Inkscape::XML::Node *crepr = child.updateRepr(xml_doc, NULL, flags);
if (crepr) {
l = g_slist_prepend(l, crepr);
}
@@ -93,8 +93,8 @@ Inkscape::XML::Node* SPDefs::write(Inkscape::XML::Document *xml_doc, Inkscape::X
}
} else {
- for ( SPObject *child = this->firstChild() ; child; child = child->getNext() ) {
- child->updateRepr(flags);
+ for (auto& child: children) {
+ child.updateRepr(flags);
}
}