Fix dive merging

When merging dives, the indices of the following dives change - so we need
to adjust the variable used in the for_each loop.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-11-05 15:38:41 +09:00
parent 01d515b5d8
commit e90f5c28df

View file

@ -309,10 +309,12 @@ void DiveListView::mergeDives()
for_each_dive(i, dive) {
if (dive->selected) {
if (!maindive)
if (!maindive) {
maindive = dive;
else
} else {
maindive = merge_two_dives(maindive, dive);
i--; // otherwise we skip a dive in the freshly changed list
}
}
}
mainWindow()->refreshDisplay();