diff options
| author | Marc Jeanmougin <mc> | 2015-02-19 19:20:09 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <mc> | 2015-02-19 19:20:09 +0000 |
| commit | 7e4b6f793d31d3245bd8afbf6f10aa255ac3e7ae (patch) | |
| tree | 4d885b8aa45917ceba4f64f2fc2af74f2766adee /src/ui | |
| parent | Put a few std::vector<SPitem*> (diff) | |
| download | inkscape-7e4b6f793d31d3245bd8afbf6f10aa255ac3e7ae.tar.gz inkscape-7e4b6f793d31d3245bd8afbf6f10aa255ac3e7ae.zip | |
added a set to the Selection
(bzr r13922.1.6)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/grid-arrange-tab.cpp | 28 | ||||
| -rw-r--r-- | src/ui/dialog/tags.cpp | 4 | ||||
| -rw-r--r-- | src/ui/tools/eraser-tool.cpp | 2 |
3 files changed, 14 insertions, 20 deletions
diff --git a/src/ui/dialog/grid-arrange-tab.cpp b/src/ui/dialog/grid-arrange-tab.cpp index d62032e9d..10498b0f9 100644 --- a/src/ui/dialog/grid-arrange-tab.cpp +++ b/src/ui/dialog/grid-arrange-tab.cpp @@ -48,7 +48,7 @@ * 0 *elem1 == *elem2 * >0 *elem1 goes after *elem2 */ -static int sp_compare_x_position(SPItem *first, SPItem *second) +static bool sp_compare_x_position(SPItem *first, SPItem *second) { using Geom::X; using Geom::Y; @@ -58,7 +58,7 @@ static int sp_compare_x_position(SPItem *first, SPItem *second) if ( !a || !b ) { // FIXME? - return 0; + return false; } double const a_height = a->dimensions()[Y]; @@ -76,44 +76,38 @@ static int sp_compare_x_position(SPItem *first, SPItem *second) } if (!a_in_b_vert) { - return -1; + return true; } if (a_in_b_vert && a->min()[X] > b->min()[X]) { - return 1; + return false; } if (a_in_b_vert && a->min()[X] < b->min()[X]) { - return -1; + return true; } - return 0; + return false; } /* * Sort items by their y co-ordinates. */ -static int sp_compare_y_position(SPItem *first, SPItem *second) +static bool sp_compare_y_position(SPItem *first, SPItem *second) { Geom::OptRect a = first->documentVisualBounds(); Geom::OptRect b = second->documentVisualBounds(); if ( !a || !b ) { // FIXME? - return 0; + return false; } if (a->min()[Geom::Y] > b->min()[Geom::Y]) { - return 1; + return false; } if (a->min()[Geom::Y] < b->min()[Geom::Y]) { - return -1; + return true; } - return 0; -} -static bool sp_compare_y_position_obj(SPObject *first, SPObject *second){ - return sp_compare_y_position(static_cast<SPItem*>(first),static_cast<SPItem*>(second))<0; -} -static bool sp_compare_x_position_obj(SPObject *first, SPObject *second){ - return sp_compare_x_position(static_cast<SPItem*>(first),static_cast<SPItem*>(second))<0; + return false; } diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp index c2df5fc1c..bd34c7c66 100644 --- a/src/ui/dialog/tags.cpp +++ b/src/ui/dialog/tags.cpp @@ -371,8 +371,8 @@ void TagsPanel::_objectsSelected( Selection *sel ) { _selectedConnection.block(); _tree.get_selection()->unselect_all(); - SelContainer tmp=sel->list(); - for(SelContainer::const_iterator i=tmp.begin();i!=tmp.end();i++) + std::vector<SPObject*> tmp=sel->list(); + for(std::vector<SPObject*>::const_iterator i=tmp.begin();i!=tmp.end();i++) { SPObject *obj = reinterpret_cast<SPObject *>(*i); _store->foreach(sigc::bind<SPObject *>( sigc::mem_fun(*this, &TagsPanel::_checkForSelected), obj)); diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp index 520b93e72..b61a108f0 100644 --- a/src/ui/tools/eraser-tool.cpp +++ b/src/ui/tools/eraser-tool.cpp @@ -711,7 +711,7 @@ void EraserTool::set_to_accumulated() { if ( !selection->isEmpty() ) { // If the item was not completely erased, track the new remainder. std::vector<SPItem*> nowSel(selection->itemList()); - for (std::vector<SPItem*>::const_iterator i2 = nowSel.begin();i!=nowSel.end();i2++) { + for (std::vector<SPItem*>::const_iterator i2 = nowSel.begin();i2!=nowSel.end();i2++) { remainingItems.push_back(SP_ITEM(*i2)); } } |
