A BMenuItem couldn't be removed and then added back to a BMenu: Fixed.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10708 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2005-01-13 08:50:50 +00:00
parent 27ec1ee4fe
commit 5fd36a241d
+3 -3
View File
@@ -1113,9 +1113,9 @@ BMenu::RemoveItems(int32 index, int32 count, BMenuItem *_item, bool del)
// The plan is simple: If we're given a BMenuItem directly, we use it
// and ignore index and count. Otherwise, we use them instead.
if (_item != NULL) {
// TODO: Check if this is enough.
fItems.RemoveItem(_item);
_item->Uninstall();
_item->SetSuper(NULL);
_item->Uninstall();
if (del)
delete _item;
result = true;
@@ -1126,8 +1126,8 @@ BMenu::RemoveItems(int32 index, int32 count, BMenuItem *_item, bool del)
for (int32 i = index + count - 1; i >= index; i--) {
item = static_cast<BMenuItem *>(fItems.ItemAt(index));
if (item != NULL) {
// TODO: Check if this is enough.
fItems.RemoveItem(item);
item->SetSuper(NULL);
item->Uninstall();
if (del)
delete item;