From 5fd36a241d588cbd6b1f0475f533dcc9f810bb23 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Thu, 13 Jan 2005 08:50:50 +0000 Subject: [PATCH] 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 --- src/kits/interface/Menu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index 53658666f1..7e242dd902 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -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(fItems.ItemAt(index)); if (item != NULL) { - // TODO: Check if this is enough. fItems.RemoveItem(item); + item->SetSuper(NULL); item->Uninstall(); if (del) delete item;