summaryrefslogtreecommitdiffstats
path: root/src/extension/implementation
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/extension/implementation
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/extension/implementation')
-rw-r--r--src/extension/implementation/implementation.cpp7
-rw-r--r--src/extension/implementation/script.cpp7
2 files changed, 6 insertions, 8 deletions
diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp
index 52f63499a..6eff3ede3 100644
--- a/src/extension/implementation/implementation.cpp
+++ b/src/extension/implementation/implementation.cpp
@@ -48,11 +48,10 @@ Gtk::Widget *Implementation::prefs_effect(Inkscape::Extension::Effect *module, I
SPDocument * current_document = view->doc();
using Inkscape::Util::GSListConstIterator;
- // FIXME very unsafe cast
- GSListConstIterator<SPItem *> selected = ((SPDesktop *)view)->getSelection()->itemList();
+ SelContainer selected = ((SPDesktop *)view)->getSelection()->itemList();
Inkscape::XML::Node const* first_select = NULL;
- if (selected != NULL) {
- const SPItem * item = *selected;
+ if (!selected.empty()) {
+ const SPItem * item = SP_ITEM(selected.front());
first_select = item->getRepr();
}
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index bbc567f75..f396e9848 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -689,14 +689,13 @@ void Script::effect(Inkscape::Extension::Effect *module,
return;
}
- Inkscape::Util::GSListConstIterator<SPItem *> selected =
+ SelContainer selected =
desktop->getSelection()->itemList(); //desktop should not be NULL since doc was checked and desktop is a casted pointer
- while ( selected != NULL ) {
+ for(SelContainer::const_iterator x=selected.begin();x!=selected.end();x++){
Glib::ustring selected_id;
selected_id += "--id=";
- selected_id += (*selected)->getId();
+ selected_id += (*x)->getId();
params.insert(params.begin(), selected_id);
- ++selected;
}
file_listener fileout;