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:
Alex Wilson
2011-10-28 14:16:16 -06:00
parent 30b07d019d
commit fa01d08496
4 changed files with 31 additions and 39 deletions
+8 -2
View File
@@ -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();
}