Berthold Stoeger 99b2de85b5 Dive list: fix off-by-two bug in DiveTripModel
Commit 911edfca712a046944de6d033cc4b8dd50cedfc3 changed the dive list
on desktop to update positions of trips when adding/removing dives.
A very unlikely case, but necessary for consistency.

For a trip to be moveable down, its index has to be one-less than
the maximum index, which is "items - 1". The code was doubly wrong:
it forget the "1" and checked for less-or-equal instead less-than.
Thus this was effectively an off-by-two error. Fix it.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-12-06 21:56:35 +01:00
..
2018-09-29 15:23:25 -07:00