From 028568555f81f07f7bc504bd8f57292c9ee6ef5b Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sun, 20 Jul 2014 16:18:00 +0300 Subject: Planner: fix an enduring assert on startup qt 5.3, win7 64bit. beginRemoveRows() asserts in removeSelectedPoints() because rowCount() - 1, becomes less than firstRow. This needs a check in removeSelectedPoints() if the number of passed rows is zero. Signed-off-by: Lubomir I. Ivanov Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 4ecf7a9a8..4f3655b12 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -53,6 +53,8 @@ bool intLessThan(int a, int b) } void DivePlannerPointsModel::removeSelectedPoints(const QVector &rows) { + if (!rows.count()) + return; int firstRow = rowCount() - rows.count(); QVector v2 = rows; std::sort(v2.begin(), v2.end(), intLessThan); -- cgit v1.2.3-70-g09d2