diff options
| author | Marc Jeanmougin <mc@localhost.localdomain> | 2015-02-17 02:00:37 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <mc@localhost.localdomain> | 2015-02-17 02:00:37 +0000 |
| commit | a7f2b2ba3f13ceb60376802f4a31e104153839e8 (patch) | |
| tree | 6db393e9e5a0a9ab7916a0e7ed29d875efa39ea1 /src/ui/dialog/clonetiler.cpp | |
| parent | device-manager: Get rid of GLists (diff) | |
| download | inkscape-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/ui/dialog/clonetiler.cpp')
| -rw-r--r-- | src/ui/dialog/clonetiler.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index fede30b26..abfab8b19 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -1359,7 +1359,7 @@ void CloneTiler::clonetiler_change_selection(Inkscape::Selection *selection, Gtk return; } - if (g_slist_length ((GSList *) selection->itemList()) > 1) { + if (selection->itemList().size() > 1) { gtk_widget_set_sensitive (buttons, FALSE); gtk_label_set_markup (GTK_LABEL(status), _("<small>More than one object selected.</small>")); return; @@ -2096,7 +2096,7 @@ void CloneTiler::clonetiler_unclump(GtkWidget */*widget*/, void *) Inkscape::Selection *selection = desktop->getSelection(); // check if something is selected - if (selection->isEmpty() || g_slist_length((GSList *) selection->itemList()) > 1) { + if (selection->isEmpty() || selection->itemList().size() > 1) { desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>one object</b> whose tiled clones to unclump.")); return; } @@ -2104,11 +2104,11 @@ void CloneTiler::clonetiler_unclump(GtkWidget */*widget*/, void *) SPObject *obj = selection->singleItem(); SPObject *parent = obj->parent; - GSList *to_unclump = NULL; // not including the original + SelContainer to_unclump; // not including the original for (SPObject *child = parent->firstChild(); child != NULL; child = child->next) { if (clonetiler_is_a_clone_of (child, obj)) { - to_unclump = g_slist_prepend (to_unclump, child); + to_unclump.push_front(child); } } @@ -2116,8 +2116,6 @@ void CloneTiler::clonetiler_unclump(GtkWidget */*widget*/, void *) unclump (to_unclump); - g_slist_free (to_unclump); - DocumentUndo::done(desktop->getDocument(), SP_VERB_DIALOG_CLONETILER, _("Unclump tiled clones")); } @@ -2147,7 +2145,7 @@ void CloneTiler::clonetiler_remove(GtkWidget */*widget*/, GtkWidget *dlg, bool d Inkscape::Selection *selection = desktop->getSelection(); // check if something is selected - if (selection->isEmpty() || g_slist_length((GSList *) selection->itemList()) > 1) { + if (selection->isEmpty() || selection->itemList().size() > 1) { desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>one object</b> whose tiled clones to remove.")); return; } @@ -2225,7 +2223,7 @@ void CloneTiler::clonetiler_apply(GtkWidget */*widget*/, GtkWidget *dlg) } // Check if more than one object is selected. - if (g_slist_length((GSList *) selection->itemList()) > 1) { + if (selection->itemList().size() > 1) { desktop->getMessageStack()->flash(Inkscape::ERROR_MESSAGE, _("If you want to clone several objects, <b>group</b> them and <b>clone the group</b>.")); return; } |
