From b72f37fbc96879418572c01b682d0403c3e36b18 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 30 Aug 2015 19:55:25 +0200 Subject: Why would anyone make a sorting function that is not antisymmetric ? That makes std::sort crash, and makes me sad. Fixed bugs: - https://launchpad.net/bugs/1490196 (bzr r14334) --- src/ui/dialog/grid-arrange-tab.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/grid-arrange-tab.cpp b/src/ui/dialog/grid-arrange-tab.cpp index ccd23a572..086cbe45f 100644 --- a/src/ui/dialog/grid-arrange-tab.cpp +++ b/src/ui/dialog/grid-arrange-tab.cpp @@ -75,16 +75,10 @@ static bool sp_compare_x_position(SPItem *first, SPItem *second) a_in_b_vert = false; } - if (!a_in_b_vert) { - return true; - } - if (a_in_b_vert && a->min()[X] > b->min()[X]) { - return false; + if (!a_in_b_vert) { // a and b are not in the same row + return (a->min()[Y] < b->min()[Y]); } - if (a_in_b_vert && a->min()[X] < b->min()[X]) { - return true; - } - return false; + return (a->min()[X] < b->min()[X]); } /* -- cgit v1.2.3