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>
This commit is contained in:
Lubomir I. Ivanov 2014-07-20 16:18:00 +03:00 committed by Dirk Hohndel
parent f6f2c4e929
commit 028568555f

View file

@ -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);