From d1947e768272c703674129d5c583204ff2b59251 Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Wed, 13 Jul 2016 13:36:19 +0200 Subject: Second part of new SPObject children list (bzr r14954.1.19) --- src/sp-flowregion.cpp | 53 +++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 5715e5eb1..71e029072 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -63,9 +63,9 @@ void SPFlowregion::update(SPCtx *ctx, unsigned int flags) { 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); @@ -102,9 +102,9 @@ void SPFlowregion::UpdateComputed(void) } computed.clear(); - for (SPObject* child = firstChild() ; child ; child = child->getNext() ) { + for (auto& child: _children) { Shape *shape = 0; - GetDest(child, &shape); + GetDest(&child, &shape); computed.push_back(shape); } } @@ -118,9 +118,9 @@ void SPFlowregion::modified(guint flags) { 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); @@ -145,9 +145,9 @@ Inkscape::XML::Node *SPFlowregion::write(Inkscape::XML::Document *xml_doc, Inksc } GSList *l = NULL; - for ( SPObject *child = this->firstChild() ; child; child = child->getNext() ) { - if ( !dynamic_cast(child) && !dynamic_cast(child) ) { - Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags); + for (auto& child: _children) { + if ( !dynamic_cast(&child) && !dynamic_cast(&child) ) { + Inkscape::XML::Node *crepr = child.updateRepr(xml_doc, NULL, flags); if (crepr) { l = g_slist_prepend(l, crepr); @@ -161,10 +161,9 @@ Inkscape::XML::Node *SPFlowregion::write(Inkscape::XML::Document *xml_doc, Inksc l = g_slist_remove(l, l->data); } - } else { - for ( SPObject *child = this->firstChild() ; child; child = child->getNext() ) { - if ( !dynamic_cast(child) && !dynamic_cast(child) ) { - child->updateRepr(flags); + for (auto& child: _children) { + if ( !dynamic_cast(&child) && !dynamic_cast(&child) ) { + child.updateRepr(flags); } } } @@ -221,9 +220,9 @@ void SPFlowregionExclude::update(SPCtx *ctx, unsigned int flags) { 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); @@ -259,8 +258,8 @@ void SPFlowregionExclude::UpdateComputed(void) computed = NULL; } - for ( SPObject* child = firstChild() ; child ; child = child->getNext() ) { - GetDest(child, &computed); + for (auto& child: _children) { + GetDest(&child, &computed); } } @@ -273,9 +272,9 @@ void SPFlowregionExclude::modified(guint flags) { 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); @@ -301,8 +300,8 @@ Inkscape::XML::Node *SPFlowregionExclude::write(Inkscape::XML::Document *xml_doc 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); @@ -316,8 +315,8 @@ Inkscape::XML::Node *SPFlowregionExclude::write(Inkscape::XML::Document *xml_doc } } else { - for ( SPObject *child = this->firstChild() ; child; child = child->getNext() ) { - child->updateRepr(flags); + for (auto& child: _children) { + child.updateRepr(flags); } } -- cgit v1.2.3 From 24d3f50003ca3cec6a03a7f5267cc4fe5588c69f Mon Sep 17 00:00:00 2001 From: Adrian Boguszewski Date: Thu, 14 Jul 2016 13:17:21 +0200 Subject: Renamed children list in SPObject (bzr r14954.1.21) --- src/sp-flowregion.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 71e029072..716a09914 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -63,7 +63,7 @@ void SPFlowregion::update(SPCtx *ctx, unsigned int flags) { GSList *l = NULL; - for (auto& child: _children) { + for (auto& child: children) { sp_object_ref(&child); l = g_slist_prepend(l, &child); } @@ -102,7 +102,7 @@ void SPFlowregion::UpdateComputed(void) } computed.clear(); - for (auto& child: _children) { + for (auto& child: children) { Shape *shape = 0; GetDest(&child, &shape); computed.push_back(shape); @@ -118,7 +118,7 @@ void SPFlowregion::modified(guint flags) { GSList *l = NULL; - for (auto& child: _children) { + for (auto& child: children) { sp_object_ref(&child); l = g_slist_prepend(l, &child); } @@ -145,7 +145,7 @@ Inkscape::XML::Node *SPFlowregion::write(Inkscape::XML::Document *xml_doc, Inksc } GSList *l = NULL; - for (auto& child: _children) { + for (auto& child: children) { if ( !dynamic_cast(&child) && !dynamic_cast(&child) ) { Inkscape::XML::Node *crepr = child.updateRepr(xml_doc, NULL, flags); @@ -161,7 +161,7 @@ Inkscape::XML::Node *SPFlowregion::write(Inkscape::XML::Document *xml_doc, Inksc l = g_slist_remove(l, l->data); } - for (auto& child: _children) { + for (auto& child: children) { if ( !dynamic_cast(&child) && !dynamic_cast(&child) ) { child.updateRepr(flags); } @@ -220,7 +220,7 @@ void SPFlowregionExclude::update(SPCtx *ctx, unsigned int flags) { GSList *l = NULL; - for (auto& child: _children) { + for (auto& child: children) { sp_object_ref(&child); l = g_slist_prepend(l, &child); } @@ -258,7 +258,7 @@ void SPFlowregionExclude::UpdateComputed(void) computed = NULL; } - for (auto& child: _children) { + for (auto& child: children) { GetDest(&child, &computed); } } @@ -272,7 +272,7 @@ void SPFlowregionExclude::modified(guint flags) { GSList *l = NULL; - for (auto& child: _children) { + for (auto& child: children) { sp_object_ref(&child); l = g_slist_prepend(l, &child); } @@ -300,7 +300,7 @@ Inkscape::XML::Node *SPFlowregionExclude::write(Inkscape::XML::Document *xml_doc GSList *l = NULL; - for (auto& child: _children) { + for (auto& child: children) { Inkscape::XML::Node *crepr = child.updateRepr(xml_doc, NULL, flags); if (crepr) { @@ -315,7 +315,7 @@ Inkscape::XML::Node *SPFlowregionExclude::write(Inkscape::XML::Document *xml_doc } } else { - for (auto& child: _children) { + for (auto& child: children) { child.updateRepr(flags); } } -- cgit v1.2.3