From e0957537cd0938313803c290a2f3922a3889e6f1 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 1 Oct 2017 17:49:26 +0200 Subject: Removed all GSList occurences in .h files --- src/libnrtype/Layout-TNG-Output.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/libnrtype') diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp index 7f20dee95..9a73b9eca 100644 --- a/src/libnrtype/Layout-TNG-Output.cpp +++ b/src/libnrtype/Layout-TNG-Output.cpp @@ -800,7 +800,7 @@ void Layout::fitToPathAlign(SVGLength const &startOffset, Path const &path) SPCurve *Layout::convertToCurves(iterator const &from_glyph, iterator const &to_glyph) const { - GSList *cc = NULL; + std::list cc; for (int glyph_index = from_glyph._glyph_index ; glyph_index < to_glyph._glyph_index ; glyph_index++) { Geom::Affine glyph_matrix; @@ -811,22 +811,14 @@ SPCurve *Layout::convertToCurves(iterator const &from_glyph, iterator const &to_ if (pathv) { Geom::PathVector pathv_trans = (*pathv) * glyph_matrix; SPCurve *c = new SPCurve(pathv_trans); - if (c) cc = g_slist_prepend(cc, c); + if (c) cc.push_back(c); } } - cc = g_slist_reverse(cc); + SPCurve *curve = new SPCurve(cc); - SPCurve *curve; - if ( cc ) { - curve = SPCurve::concat(cc); - } else { - curve = new SPCurve(); - } - - while (cc) { + for (auto i:cc) { /* fixme: This is dangerous, as we are mixing art_alloc and g_new */ - reinterpret_cast(cc->data)->unref(); - cc = g_slist_remove(cc, cc->data); + i->unref(); } return curve; -- cgit v1.2.3