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/widgets/star-toolbar.cpp | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'src/widgets/star-toolbar.cpp') diff --git a/src/widgets/star-toolbar.cpp b/src/widgets/star-toolbar.cpp index cf12391c1..37daf69d0 100644 --- a/src/widgets/star-toolbar.cpp +++ b/src/widgets/star-toolbar.cpp @@ -83,9 +83,9 @@ static void sp_stb_magnitude_value_changed( GtkAdjustment *adj, GObject *dataKlu bool modmade = false; Inkscape::Selection *selection = desktop->getSelection(); - GSList const *items = selection->itemList(); - for (; items != NULL; items = items->next) { - SPItem *item = reinterpret_cast(items->data); + SelContainer itemlist=selection->itemList(); + for(SelContainer::const_iterator i=itemlist.begin();i!=itemlist.end();i++){ + SPItem *item = SP_ITEM(*i); if (SP_IS_STAR(item)) { Inkscape::XML::Node *repr = item->getRepr(); sp_repr_set_int(repr,"sodipodi:sides", @@ -128,9 +128,9 @@ static void sp_stb_proportion_value_changed( GtkAdjustment *adj, GObject *dataKl bool modmade = false; Inkscape::Selection *selection = desktop->getSelection(); - GSList const *items = selection->itemList(); - for (; items != NULL; items = items->next) { - SPItem *item = reinterpret_cast(items->data); + SelContainer itemlist=selection->itemList(); + for(SelContainer::const_iterator i=itemlist.begin();i!=itemlist.end();i++){ + SPItem *item = SP_ITEM(*i); if (SP_IS_STAR(item)) { Inkscape::XML::Node *repr = item->getRepr(); @@ -178,7 +178,6 @@ static void sp_stb_sides_flat_state_changed( EgeSelectOneAction *act, GObject *d g_object_set_data( dataKludge, "freeze", GINT_TO_POINTER(TRUE) ); Inkscape::Selection *selection = desktop->getSelection(); - GSList const *items = selection->itemList(); GtkAction* prop_action = GTK_ACTION( g_object_get_data( dataKludge, "prop_action" ) ); bool modmade = false; @@ -186,8 +185,9 @@ static void sp_stb_sides_flat_state_changed( EgeSelectOneAction *act, GObject *d gtk_action_set_sensitive( prop_action, !flat ); } - for (; items != NULL; items = items->next) { - SPItem *item = reinterpret_cast(items->data); + SelContainer itemlist=selection->itemList(); + for(SelContainer::const_iterator i=itemlist.begin();i!=itemlist.end();i++){ + SPItem *item = SP_ITEM(*i); if (SP_IS_STAR(item)) { Inkscape::XML::Node *repr = item->getRepr(); repr->setAttribute("inkscape:flatsided", flat ? "true" : "false" ); @@ -224,9 +224,9 @@ static void sp_stb_rounded_value_changed( GtkAdjustment *adj, GObject *dataKludg bool modmade = false; Inkscape::Selection *selection = desktop->getSelection(); - GSList const *items = selection->itemList(); - for (; items != NULL; items = items->next) { - SPItem *item = reinterpret_cast(items->data); + SelContainer itemlist=selection->itemList(); + for(SelContainer::const_iterator i=itemlist.begin();i!=itemlist.end();i++){ + SPItem *item = SP_ITEM(*i); if (SP_IS_STAR(item)) { Inkscape::XML::Node *repr = item->getRepr(); sp_repr_set_svg_double(repr, "inkscape:rounded", @@ -264,9 +264,9 @@ static void sp_stb_randomized_value_changed( GtkAdjustment *adj, GObject *dataKl bool modmade = false; Inkscape::Selection *selection = desktop->getSelection(); - GSList const *items = selection->itemList(); - for (; items != NULL; items = items->next) { - SPItem *item = reinterpret_cast(items->data); + SelContainer itemlist=selection->itemList(); + for(SelContainer::const_iterator i=itemlist.begin();i!=itemlist.end();i++){ + SPItem *item = SP_ITEM(*i); if (SP_IS_STAR(item)) { Inkscape::XML::Node *repr = item->getRepr(); sp_repr_set_svg_double(repr, "inkscape:randomized", @@ -367,11 +367,9 @@ sp_star_toolbox_selection_changed(Inkscape::Selection *selection, GObject *tbl) purge_repr_listener( tbl, tbl ); - for (GSList const *items = selection->itemList(); - items != NULL; - items = items->next) - { - SPItem* item = reinterpret_cast(items->data); + SelContainer itemlist=selection->itemList(); + for(SelContainer::const_iterator i=itemlist.begin();i!=itemlist.end();i++){ + SPItem *item = SP_ITEM(*i); if (SP_IS_STAR(item)) { n_selected++; repr = item->getRepr(); -- cgit v1.2.3