diff options
| author | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-08-15 03:59:18 +0000 |
|---|---|---|
| committer | kamalpreetgrewal <grewalkamal005@gmail.com> | 2016-08-15 03:59:18 +0000 |
| commit | 25a9ed4f38121eeb59cf15dbf19391aaef45bba3 (patch) | |
| tree | e123aeae50d98a52e1ad4575b29bf3c199619e33 /src/sp-gradient.cpp | |
| parent | Solve crash when deleting CSS property (diff) | |
| parent | inkview: Convert to ApplicationWindow (diff) | |
| download | inkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.tar.gz inkscape-25a9ed4f38121eeb59cf15dbf19391aaef45bba3.zip | |
Merge changes from trunk
(bzr r14949.1.64)
Diffstat (limited to 'src/sp-gradient.cpp')
| -rw-r--r-- | src/sp-gradient.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp index 49143bda4..f24e25ab1 100644 --- a/src/sp-gradient.cpp +++ b/src/sp-gradient.cpp @@ -269,8 +269,8 @@ void SPGradient::build(SPDocument *document, Inkscape::XML::Node *repr) SPPaintServer::build(document, repr); - for ( SPObject *ochild = this->firstChild() ; ochild ; ochild = ochild->getNext() ) { - if (SP_IS_STOP(ochild)) { + for (auto& ochild: children) { + if (SP_IS_STOP(&ochild)) { this->has_stops = TRUE; break; } @@ -474,8 +474,8 @@ void SPGradient::remove_child(Inkscape::XML::Node *child) SPPaintServer::remove_child(child); this->has_stops = FALSE; - for ( SPObject *ochild = this->firstChild() ; ochild ; ochild = ochild->getNext() ) { - if (SP_IS_STOP(ochild)) { + for (auto& ochild: children) { + if (SP_IS_STOP(&ochild)) { this->has_stops = TRUE; break; } @@ -529,9 +529,9 @@ void SPGradient::modified(guint flags) // FIXME: climb up the ladder of hrefs 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); @@ -550,10 +550,11 @@ void SPGradient::modified(guint flags) SPStop* SPGradient::getFirstStop() { - SPStop* first = 0; - for (SPObject *ochild = firstChild(); ochild && !first; ochild = ochild->getNext()) { - if (SP_IS_STOP(ochild)) { - first = SP_STOP(ochild); + SPStop* first = nullptr; + for (auto& ochild: children) { + if (SP_IS_STOP(&ochild)) { + first = SP_STOP(&ochild); + break; } } return first; @@ -580,8 +581,8 @@ Inkscape::XML::Node *SPGradient::write(Inkscape::XML::Document *xml_doc, Inkscap if (flags & SP_OBJECT_WRITE_BUILD) { 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); @@ -908,8 +909,8 @@ bool SPGradient::invalidateArray() void SPGradient::rebuildVector() { gint len = 0; - for ( SPObject *child = firstChild() ; child ; child = child->getNext() ) { - if (SP_IS_STOP(child)) { + for (auto& child: children) { + if (SP_IS_STOP(&child)) { len ++; } } @@ -930,9 +931,9 @@ void SPGradient::rebuildVector() } } - for ( SPObject *child = firstChild(); child; child = child->getNext() ) { - if (SP_IS_STOP(child)) { - SPStop *stop = SP_STOP(child); + for (auto& child: children) { + if (SP_IS_STOP(&child)) { + SPStop *stop = SP_STOP(&child); SPGradientStop gstop; if (!vector.stops.empty()) { @@ -1015,8 +1016,8 @@ void SPGradient::rebuildArray() array.read( SP_MESH( this ) ); has_patches = false; - for ( SPObject *ro = firstChild() ; ro ; ro = ro->getNext() ) { - if (SP_IS_MESHROW(ro)) { + for (auto& ro: children) { + if (SP_IS_MESHROW(&ro)) { has_patches = true; // std::cout << " Has Patches" << std::endl; break; |
