BOutlineListView::EachItemUnder gets too many items
EachItemUnder selects items that are not in fact under the superitem passed to the method. ticket: #13730 Change-Id: I12a2e29204e1b9bbecd5704e60a02e3613a7f4fd Reviewed-on: https://review.haiku-os.org/52 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
@@ -721,15 +721,16 @@ BListItem*
|
|||||||
BOutlineListView::EachItemUnder(BListItem* superItem, bool oneLevelOnly,
|
BOutlineListView::EachItemUnder(BListItem* superItem, bool oneLevelOnly,
|
||||||
BListItem* (*eachFunc)(BListItem* item, void* arg), void* arg)
|
BListItem* (*eachFunc)(BListItem* item, void* arg), void* arg)
|
||||||
{
|
{
|
||||||
int32 i = IndexOf(superItem);
|
int32 i = FullListIndexOf(superItem);
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
i++; // skip the superitem
|
||||||
while (i < FullListCountItems()) {
|
while (i < FullListCountItems()) {
|
||||||
BListItem* item = FullListItemAt(i);
|
BListItem* item = FullListItemAt(i);
|
||||||
|
|
||||||
// If we jump out of the subtree, return NULL
|
// If we jump out of the subtree, return NULL
|
||||||
if (item->fLevel < superItem->OutlineLevel())
|
if (item->fLevel <= superItem->OutlineLevel())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
// If the level matches, check the index
|
// If the level matches, check the index
|
||||||
|
|||||||
Reference in New Issue
Block a user