summaryrefslogtreecommitdiffstats
path: root/src/sp-object-group.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2017-10-02 21:30:11 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2017-10-02 21:30:11 +0000
commit3e075e587aaa712efb1704478cd1a75131882889 (patch)
tree6f13d8df9a58d9895d01b96ef1074ccce7e8fe05 /src/sp-object-group.cpp
parentMerge branch 'master' of gitlab.com:inkscape/inkscape (diff)
downloadinkscape-3e075e587aaa712efb1704478cd1a75131882889.tar.gz
inkscape-3e075e587aaa712efb1704478cd1a75131882889.zip
third batch
Diffstat (limited to 'src/sp-object-group.cpp')
-rw-r--r--src/sp-object-group.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/sp-object-group.cpp b/src/sp-object-group.cpp
index 62c6f7a87..f8ef855e3 100644
--- a/src/sp-object-group.cpp
+++ b/src/sp-object-group.cpp
@@ -49,19 +49,17 @@ Inkscape::XML::Node *SPObjectGroup::write(Inkscape::XML::Document *xml_doc, Inks
repr = xml_doc->createElement("svg:g");
}
- GSList *l = 0;
+ std::vector<Inkscape::XML::Node *> l;
for (auto& child: children) {
Inkscape::XML::Node *crepr = child.updateRepr(xml_doc, NULL, flags);
if (crepr) {
- l = g_slist_prepend(l, crepr);
+ l.push_back(crepr);
}
}
-
- while (l) {
- repr->addChild(static_cast<Inkscape::XML::Node *>(l->data), NULL);
- Inkscape::GC::release(static_cast<Inkscape::XML::Node *>(l->data));
- l = g_slist_remove(l, l->data);
+ for (auto i=l.rbegin();i!=l.rend();++i) {
+ repr->addChild(*i, NULL);
+ Inkscape::GC::release(*i);
}
} else {
for (auto& child: children) {