BOutlineListView: fixed expansion causing items to disappear

On a multi-level list view, when expanding an item containing other collapsed lists, the last items disappear due to a wrong element counting.

Change-Id: I2313ad8efb23e8db54cd3563687bf0c2a775a12a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6259
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Automation <[email protected]>
Reviewed-by: Stefano Ceccherini <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Freaxed
2023-04-08 15:54:57 +00:00
committed by waddlesplash
parent 8079adc050
commit 40e5560a3c
+3 -1
View File
@@ -846,8 +846,10 @@ BOutlineListView::ExpandOrCollapse(BListItem* item, bool expand)
uint32 subLevel = item->fLevel;
items++;
while (--count > 0 && items[0]->fLevel > subLevel)
while (count > 0 && items[0]->fLevel > subLevel) {
items++;
count--;
}
} else
items++;
}