diff options
Diffstat (limited to 'src/ui/dialog/transformation.cpp')
| -rw-r--r-- | src/ui/dialog/transformation.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 233d99750..498ad7822 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -15,10 +15,6 @@ # include <config.h> #endif -#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H -#include <glibmm/threads.h> -#endif - #include <gtkmm/dialog.h> #include <gtkmm/stock.h> #include <2geom/transforms.h> @@ -655,7 +651,7 @@ void Transformation::updatePageTransform(Inkscape::Selection *selection) { if (selection && !selection->isEmpty()) { if (_check_replace_matrix.get_active()) { - Geom::Affine current (SP_ITEM(selection->itemList()->data)->transform); // take from the first item in selection + Geom::Affine current (selection->itemList()[0]->transform); // take from the first item in selection Geom::Affine new_displayed = current; @@ -740,20 +736,19 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) if (_check_move_relative.get_active()) { // shift each object relatively to the previous one - using Inkscape::Util::GSListConstIterator; - std::list<SPItem *> selected; - selected.insert<GSListConstIterator<SPItem *> >(selected.end(), selection->itemList(), NULL); + std::vector<SPItem*> selected(selection->itemList()); if (selected.empty()) return; if (fabs(x) > 1e-6) { std::vector< BBoxSort > sorted; - for (std::list<SPItem *>::iterator it(selected.begin()); + for (std::vector<SPItem*>::iterator it(selected.begin()); it != selected.end(); ++it) { - Geom::OptRect bbox = (*it)->desktopPreferredBounds(); + SPItem* item = *it; + Geom::OptRect bbox = item->desktopPreferredBounds(); if (bbox) { - sorted.push_back(BBoxSort(*it, *bbox, Geom::X, x > 0? 1. : 0., x > 0? 0. : 1.)); + sorted.push_back(BBoxSort(item, *bbox, Geom::X, x > 0? 1. : 0., x > 0? 0. : 1.)); } } //sort bbox by anchors @@ -771,13 +766,14 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) } if (fabs(y) > 1e-6) { std::vector< BBoxSort > sorted; - for (std::list<SPItem *>::iterator it(selected.begin()); + for (std::vector<SPItem*>::iterator it(selected.begin()); it != selected.end(); ++it) { - Geom::OptRect bbox = (*it)->desktopPreferredBounds(); + SPItem* item = *it; + Geom::OptRect bbox = item->desktopPreferredBounds(); if (bbox) { - sorted.push_back(BBoxSort(*it, *bbox, Geom::Y, y > 0? 1. : 0., y > 0? 0. : 1.)); + sorted.push_back(BBoxSort(item, *bbox, Geom::Y, y > 0? 1. : 0., y > 0? 0. : 1.)); } } //sort bbox by anchors @@ -815,8 +811,9 @@ void Transformation::applyPageScale(Inkscape::Selection *selection) bool transform_stroke = prefs->getBool("/options/transform/stroke", true); bool preserve = prefs->getBool("/options/preservetransform/value", false); if (prefs->getBool("/dialogs/transformation/applyseparately")) { - for (GSList const *l = selection->itemList(); l != NULL; l = l->next) { - SPItem *item = SP_ITEM(l->data); + std::vector<SPItem*> tmp=selection->itemList(); + for(std::vector<SPItem*>::const_iterator i=tmp.begin();i!=tmp.end();i++){ + SPItem *item = *i; Geom::OptRect bbox_pref = item->desktopPreferredBounds(); Geom::OptRect bbox_geom = item->desktopGeometricBounds(); if (bbox_pref && bbox_geom) { @@ -878,8 +875,9 @@ void Transformation::applyPageRotate(Inkscape::Selection *selection) } if (prefs->getBool("/dialogs/transformation/applyseparately")) { - for (GSList const *l = selection->itemList(); l != NULL; l = l->next) { - SPItem *item = SP_ITEM(l->data); + std::vector<SPItem*> tmp=selection->itemList(); + for(std::vector<SPItem*>::const_iterator i=tmp.begin();i!=tmp.end();i++){ + SPItem *item = *i; sp_item_rotate_rel(item, Geom::Rotate (angle*M_PI/180.0)); } } else { @@ -897,8 +895,9 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if (prefs->getBool("/dialogs/transformation/applyseparately")) { - for (GSList const *l = selection->itemList(); l != NULL; l = l->next) { - SPItem *item = SP_ITEM(l->data); + std::vector<SPItem*> items=selection->itemList(); + for(std::vector<SPItem*>::const_iterator i = items.begin();i!=items.end();i++){ + SPItem *item = *i; if (!_units_skew.isAbsolute()) { // percentage double skewX = _scalar_skew_horizontal.getValue("%"); @@ -998,10 +997,11 @@ void Transformation::applyPageTransform(Inkscape::Selection *selection) } if (_check_replace_matrix.get_active()) { - for (GSList const *l = selection->itemList(); l != NULL; l = l->next) { - SPItem *item = SP_ITEM(l->data); + std::vector<SPItem*> tmp=selection->itemList(); + for(std::vector<SPItem*>::const_iterator i=tmp.begin();i!=tmp.end();i++){ + SPItem *item = *i; item->set_item_transform(displayed); - SP_OBJECT(item)->updateRepr(); + item->updateRepr(); } } else { sp_selection_apply_affine(selection, displayed); // post-multiply each object's transform @@ -1150,7 +1150,7 @@ void Transformation::onReplaceMatrixToggled() double f = _scalar_transform_f.getValue(); Geom::Affine displayed (a, b, c, d, e, f); - Geom::Affine current = SP_ITEM(selection->itemList()->data)->transform; // take from the first item in selection + Geom::Affine current = selection->itemList()[0]->transform; // take from the first item in selection Geom::Affine new_displayed; if (_check_replace_matrix.get_active()) { |
