User BView's layout item tracking functionality to simplify and optimize some methods in BLayout and BView.
Delete BLayout::RemoveViewRecursive() as it is no longer needed. Add a few TODO's.
This commit is contained in:
@@ -4022,8 +4022,14 @@ BView::PreviousSibling() const
|
||||
bool
|
||||
BView::RemoveSelf()
|
||||
{
|
||||
if (fParent && fParent->fLayoutData->fLayout)
|
||||
return fParent->fLayoutData->fLayout->RemoveViewRecursive(this);
|
||||
if (fParent && fParent->fLayoutData->fLayout) {
|
||||
int32 itemCount = fLayoutData->fLayoutItems.CountItems();
|
||||
for (int32 i = 0; i < itemCount; i++) {
|
||||
BLayoutItem* item = fLayoutData->fLayoutItems.ItemAt(i);
|
||||
item->Layout()->RemoveItem(item);
|
||||
delete item;
|
||||
}
|
||||
}
|
||||
|
||||
return _RemoveSelf();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user