summaryrefslogtreecommitdiffstats
path: root/src/sp-mesh-array.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2017-10-01 21:57:52 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2017-10-01 21:57:52 +0000
commitc20891fabc8c3ee2251e0545878e06545b6f0cdd (patch)
treec19727ea5ec4c7fb90b7e4512a3cc5fb89f58945 /src/sp-mesh-array.cpp
parentMerge branch 'master' of gitlab.com:inkscape/inkscape (diff)
downloadinkscape-c20891fabc8c3ee2251e0545878e06545b6f0cdd.tar.gz
inkscape-c20891fabc8c3ee2251e0545878e06545b6f0cdd.zip
First batch
Diffstat (limited to 'src/sp-mesh-array.cpp')
-rw-r--r--src/sp-mesh-array.cpp29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/sp-mesh-array.cpp b/src/sp-mesh-array.cpp
index c89cfcc6f..a8d9e589c 100644
--- a/src/sp-mesh-array.cpp
+++ b/src/sp-mesh-array.cpp
@@ -936,31 +936,26 @@ void SPMeshNodeArray::write( SPMeshGradient *mg ) {
}
// First we must delete reprs for old mesh rows and patches.
- GSList *descendant_reprs = NULL;
- GSList *descendant_objects = NULL;
+ std::vector<SPObject*> descendant_objects;
+ std::vector<Inkscape::XML::Node *> descendant_reprs;
for (auto& row: mg_array->children) {
- descendant_reprs = g_slist_prepend (descendant_reprs, row.getRepr());
- descendant_objects = g_slist_prepend (descendant_objects, &row);
+ descendant_reprs.push_back(row.getRepr());
+ descendant_objects.push_back(&row);
for (auto& patch: row.children) {
- descendant_reprs = g_slist_prepend (descendant_reprs, patch.getRepr());
- descendant_objects = g_slist_prepend (descendant_objects, &patch);
+ descendant_reprs.push_back(patch.getRepr());
+ descendant_objects.push_back(&patch);
for (auto& stop: patch.children) {
- descendant_reprs = g_slist_prepend (descendant_reprs, stop.getRepr());
- descendant_objects = g_slist_prepend (descendant_objects, &stop);
+ descendant_reprs.push_back(stop.getRepr());
+ descendant_objects.push_back(&stop);
}
}
}
- for ( GSList *i = descendant_objects; i != NULL; i = i->next ) {
- SPObject *descendant = SP_OBJECT (i->data);
- descendant->deleteObject();
- }
-
- for ( GSList *i = descendant_reprs; i != NULL; i = i->next ) {
- Inkscape::XML::Node *repr = (Inkscape::XML::Node *) i->data;
- sp_repr_unparent( repr );
- }
+ for (auto i:descendant_objects)
+ i->deleteObject();
+ for (auto i:descendant_reprs)
+ sp_repr_unparent(i);
// Now we build new reprs
Inkscape::XML::Node *mesh = mg->getRepr();