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/selcue.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/selcue.cpp') diff --git a/src/selcue.cpp b/src/selcue.cpp index d2fa0970a..0fab6e5a8 100644 --- a/src/selcue.cpp +++ b/src/selcue.cpp @@ -96,15 +96,16 @@ void Inkscape::SelCue::_updateItemBboxes(Inkscape::Preferences *prefs) void Inkscape::SelCue::_updateItemBboxes(gint mode, int prefs_bbox) { - GSList const *items = _selection->itemList(); - if (_item_bboxes.size() != g_slist_length((GSList *) items)) { + const SelContainer items = _selection->itemList(); + if (_item_bboxes.size() != items.size()) { _newItemBboxes(); return; } int bcount = 0; - for (GSList const *l = _selection->itemList(); l != NULL; l = l->next) { - SPItem *item = static_cast(l->data); + SelContainer ll=_selection->itemList(); + for (SelContainer::const_iterator l=ll.begin();l!=ll.end();l++) { + SPItem *item = static_cast(*l); SPCanvasItem* box = _item_bboxes[bcount ++]; if (box) { @@ -145,8 +146,9 @@ void Inkscape::SelCue::_newItemBboxes() int prefs_bbox = prefs->getBool("/tools/bounding_box"); - for (GSList const *l = _selection->itemList(); l != NULL; l = l->next) { - SPItem *item = static_cast(l->data); + SelContainer ll=_selection->itemList(); + for (SelContainer::const_iterator l=ll.begin();l!=ll.end();l++) { + SPItem *item = static_cast(*l); Geom::OptRect const b = (prefs_bbox == 0) ? item->desktopVisualBounds() : item->desktopGeometricBounds(); @@ -199,8 +201,9 @@ void Inkscape::SelCue::_newTextBaselines() } _text_baselines.clear(); - for (GSList const *l = _selection->itemList(); l != NULL; l = l->next) { - SPItem *item = static_cast(l->data); + SelContainer ll=_selection->itemList(); + for (SelContainer::const_iterator l=ll.begin();l!=ll.end();l++) { + SPItem *item = static_cast(*l); SPCanvasItem* baseline_point = NULL; if (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item)) { // visualize baseline -- cgit v1.2.3