diff options
| author | Tomasz Boczkowski <penginsbacon@gmail.com> | 2015-05-02 09:43:24 +0000 |
|---|---|---|
| committer | Tomasz Boczkowski <penginsbacon@gmail.com> | 2015-05-02 09:43:24 +0000 |
| commit | 4ae263b8d394775ff631efaacc835346af1ffdae (patch) | |
| tree | 8c54527cb2698ade852a3286e84692fc29b74ad8 /src/selcue.cpp | |
| parent | merged gtk3 compile fix (diff) | |
| parent | sp-text: Whitespace cleanup (diff) | |
| download | inkscape-4ae263b8d394775ff631efaacc835346af1ffdae.tar.gz inkscape-4ae263b8d394775ff631efaacc835346af1ffdae.zip | |
merge with trunk
(bzr r14059.1.12)
Diffstat (limited to 'src/selcue.cpp')
| -rw-r--r-- | src/selcue.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/selcue.cpp b/src/selcue.cpp index d2fa0970a..c73219b7d 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 std::vector<SPItem*> 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<SPItem *>(l->data); + std::vector<SPItem*> ll=_selection->itemList(); + for (std::vector<SPItem*>::const_iterator l = ll.begin(); l != ll.end(); l++) { + SPItem *item = *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<SPItem *>(l->data); + std::vector<SPItem*> ll=_selection->itemList(); + for (std::vector<SPItem*>::const_iterator l = ll.begin(); l != ll.end(); l++) { + SPItem *item = *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<SPItem *>(l->data); + std::vector<SPItem*> ll = _selection->itemList(); + for (std::vector<SPItem*>::const_iterator l=ll.begin();l!=ll.end();l++) { + SPItem *item = *l; SPCanvasItem* baseline_point = NULL; if (SP_IS_TEXT(item) || SP_IS_FLOWTEXT(item)) { // visualize baseline |
