Now handles two cases of incorrectly built trees gracefully (instead of crashing).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20574 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -25,7 +25,7 @@ static void
|
|||||||
quick_sort_item_array(BListItem** items, int32 first, int32 last,
|
quick_sort_item_array(BListItem** items, int32 first, int32 last,
|
||||||
int (*compareFunc)(const BListItem* a, const BListItem* b))
|
int (*compareFunc)(const BListItem* a, const BListItem* b))
|
||||||
{
|
{
|
||||||
if (last == first)
|
if (last <= first)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BListItem* pivot = items[first + (rand() % (last - first))];
|
BListItem* pivot = items[first + (rand() % (last - first))];
|
||||||
@@ -693,11 +693,9 @@ BOutlineListView::_BuildTree(BListItem* underItem, int32& fullIndex)
|
|||||||
if (item->fLevel < level)
|
if (item->fLevel < level)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (item->fLevel == level) {
|
// If the level matches, put them into the list
|
||||||
// If the level matches, put them into the list
|
// (we handle the case of a missing sublevel gracefully)
|
||||||
list->AddItem(item);
|
list->AddItem(item);
|
||||||
}
|
|
||||||
|
|
||||||
fullIndex++;
|
fullIndex++;
|
||||||
|
|
||||||
if (item->HasSubitems()) {
|
if (item->HasSubitems()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user