diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2014-07-20 16:18:00 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-23 08:19:45 -0700 |
commit | 028568555f81f07f7bc504bd8f57292c9ee6ef5b (patch) | |
tree | 341293c58af188a444d85efd068cb36c70813d23 /qt-ui | |
parent | f6f2c4e929fd6da77c83b50f60720f3c04c8c107 (diff) | |
download | subsurface-028568555f81f07f7bc504bd8f57292c9ee6ef5b.tar.gz |
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 <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/diveplanner.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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<int> &rows) { + if (!rows.count()) + return; int firstRow = rowCount() - rows.count(); QVector<int> v2 = rows; std::sort(v2.begin(), v2.end(), intLessThan); |