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/dialog/grid-arrange-tab.cpp | |
| 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/dialog/grid-arrange-tab.cpp')
| -rw-r--r-- | src/ui/dialog/grid-arrange-tab.cpp | 28 |
1 files changed, 11 insertions, 17 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; } |
