From a7f2b2ba3f13ceb60376802f4a31e104153839e8 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 17 Feb 2015 03:00:37 +0100 Subject: At first, I was thinking "I just have to go to the selection file, and change that GSList* with a std::list, then resolve the few problems" So, i tried that. And I will continue tomorrow, and the days after, on and on. (bzr r13922.1.1) --- src/helper/png-write.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/helper/png-write.cpp') diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp index 32e50b537..55fef5a4c 100644 --- a/src/helper/png-write.cpp +++ b/src/helper/png-write.cpp @@ -361,19 +361,19 @@ sp_export_get_rows(guchar const **rows, void **to_free, int row, int num_rows, v /** * Hide all items that are not listed in list, recursively, skipping groups and defs. */ -static void hide_other_items_recursively(SPObject *o, GSList *list, unsigned dkey) +static void hide_other_items_recursively(SPObject *o, const SelContainer &list, unsigned dkey) { if ( SP_IS_ITEM(o) && !SP_IS_DEFS(o) && !SP_IS_ROOT(o) && !SP_IS_GROUP(o) - && !g_slist_find(list, o) ) + && list.end()==find(list.begin(),list.end(),o)) { SP_ITEM(o)->invoke_hide(dkey); } // recurse - if (!g_slist_find(list, o)) { + if (list.end()==find(list.begin(),list.end(),o)) { for ( SPObject *child = o->firstChild() ; child; child = child->getNext() ) { hide_other_items_recursively(child, list, dkey); } @@ -387,7 +387,7 @@ ExportResult sp_export_png_file(SPDocument *doc, gchar const *filename, unsigned long bgcolor, unsigned int (*status) (float, void *), void *data, bool force_overwrite, - GSList *items_only) + const SelContainer &items_only) { return sp_export_png_file(doc, filename, Geom::Rect(Geom::Point(x0,y0),Geom::Point(x1,y1)), width, height, xdpi, ydpi, bgcolor, status, data, force_overwrite, items_only); @@ -399,7 +399,7 @@ ExportResult sp_export_png_file(SPDocument *doc, gchar const *filename, unsigned long bgcolor, unsigned (*status)(float, void *), void *data, bool force_overwrite, - GSList *items_only) + const SelContainer &items_only) { g_return_val_if_fail(doc != NULL, EXPORT_ERROR); g_return_val_if_fail(filename != NULL, EXPORT_ERROR); @@ -457,7 +457,7 @@ ExportResult sp_export_png_file(SPDocument *doc, gchar const *filename, // We show all and then hide all items we don't want, instead of showing only requested items, // because that would not work if the shown item references something in defs - if (items_only) { + if (!items_only.empty()) { hide_other_items_recursively(doc->getRoot(), items_only, dkey); } -- cgit v1.2.3 From 5fd00cab14d48beaf2279a2b8f3ad5b02b76c87b Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 19 Feb 2015 04:25:21 +0100 Subject: Put a few std::vector (bzr r13922.1.5) --- src/helper/png-write.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/helper/png-write.cpp') diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp index 55fef5a4c..fc365c435 100644 --- a/src/helper/png-write.cpp +++ b/src/helper/png-write.cpp @@ -361,7 +361,7 @@ sp_export_get_rows(guchar const **rows, void **to_free, int row, int num_rows, v /** * Hide all items that are not listed in list, recursively, skipping groups and defs. */ -static void hide_other_items_recursively(SPObject *o, const SelContainer &list, unsigned dkey) +static void hide_other_items_recursively(SPObject *o, const std::vector &list, unsigned dkey) { if ( SP_IS_ITEM(o) && !SP_IS_DEFS(o) @@ -387,7 +387,7 @@ ExportResult sp_export_png_file(SPDocument *doc, gchar const *filename, unsigned long bgcolor, unsigned int (*status) (float, void *), void *data, bool force_overwrite, - const SelContainer &items_only) + const std::vector &items_only) { return sp_export_png_file(doc, filename, Geom::Rect(Geom::Point(x0,y0),Geom::Point(x1,y1)), width, height, xdpi, ydpi, bgcolor, status, data, force_overwrite, items_only); @@ -399,7 +399,7 @@ ExportResult sp_export_png_file(SPDocument *doc, gchar const *filename, unsigned long bgcolor, unsigned (*status)(float, void *), void *data, bool force_overwrite, - const SelContainer &items_only) + const std::vector &items_only) { g_return_val_if_fail(doc != NULL, EXPORT_ERROR); g_return_val_if_fail(filename != NULL, EXPORT_ERROR); -- cgit v1.2.3