summaryrefslogtreecommitdiffstats
path: root/src/widgets/star-toolbar.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <mc@localhost.localdomain>2015-02-17 02:00:37 +0000
committerMarc Jeanmougin <mc@localhost.localdomain>2015-02-17 02:00:37 +0000
commita7f2b2ba3f13ceb60376802f4a31e104153839e8 (patch)
tree6db393e9e5a0a9ab7916a0e7ed29d875efa39ea1 /src/widgets/star-toolbar.cpp
parentdevice-manager: Get rid of GLists (diff)
downloadinkscape-a7f2b2ba3f13ceb60376802f4a31e104153839e8.tar.gz
inkscape-a7f2b2ba3f13ceb60376802f4a31e104153839e8.zip
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)
Diffstat (limited to 'src/widgets/star-toolbar.cpp')
-rw-r--r--src/widgets/star-toolbar.cpp38
1 files changed, 18 insertions, 20 deletions
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<SPItem*>(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<SPItem *>(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<SPItem *>(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<SPItem*>(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<SPItem *>(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<SPItem *>(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();