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:
@@ -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
|
// The plan is simple: If we're given a BMenuItem directly, we use it
|
||||||
// and ignore index and count. Otherwise, we use them instead.
|
// and ignore index and count. Otherwise, we use them instead.
|
||||||
if (_item != NULL) {
|
if (_item != NULL) {
|
||||||
// TODO: Check if this is enough.
|
|
||||||
fItems.RemoveItem(_item);
|
fItems.RemoveItem(_item);
|
||||||
_item->Uninstall();
|
_item->SetSuper(NULL);
|
||||||
|
_item->Uninstall();
|
||||||
if (del)
|
if (del)
|
||||||
delete _item;
|
delete _item;
|
||||||
result = true;
|
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--) {
|
for (int32 i = index + count - 1; i >= index; i--) {
|
||||||
item = static_cast<BMenuItem *>(fItems.ItemAt(index));
|
item = static_cast<BMenuItem *>(fItems.ItemAt(index));
|
||||||
if (item != NULL) {
|
if (item != NULL) {
|
||||||
// TODO: Check if this is enough.
|
|
||||||
fItems.RemoveItem(item);
|
fItems.RemoveItem(item);
|
||||||
|
item->SetSuper(NULL);
|
||||||
item->Uninstall();
|
item->Uninstall();
|
||||||
if (del)
|
if (del)
|
||||||
delete item;
|
delete item;
|
||||||
|
|||||||
Reference in New Issue
Block a user