diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-10-01 21:57:52 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-10-01 21:57:52 +0000 |
| commit | c20891fabc8c3ee2251e0545878e06545b6f0cdd (patch) | |
| tree | c19727ea5ec4c7fb90b7e4512a3cc5fb89f58945 /src/sp-item.cpp | |
| parent | Merge branch 'master' of gitlab.com:inkscape/inkscape (diff) | |
| download | inkscape-c20891fabc8c3ee2251e0545878e06545b6f0cdd.tar.gz inkscape-c20891fabc8c3ee2251e0545878e06545b6f0cdd.zip | |
First batch
Diffstat (limited to 'src/sp-item.cpp')
| -rw-r--r-- | src/sp-item.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp index dd98ee1a4..a780f1a29 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -711,19 +711,18 @@ Inkscape::XML::Node* SPItem::write(Inkscape::XML::Document *xml_doc, Inkscape::X // in the case of SP_OBJECT_WRITE_BUILD, the item should always be newly created, // so we need to add any children from the underlying object to the new repr if (flags & SP_OBJECT_WRITE_BUILD) { - GSList *l = NULL; + std::vector<Inkscape::XML::Node *>l; for (auto& child: object->children) { if (dynamic_cast<SPTitle *>(&child) || dynamic_cast<SPDesc *>(&child)) { 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((Inkscape::XML::Node *) l->data, NULL); - Inkscape::GC::release((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: object->children) { |
