Fixed a typo which caused a bug.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14375 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -405,7 +405,7 @@ BMenuItem *
|
|||||||
BMenu::RemoveItem(int32 index)
|
BMenu::RemoveItem(int32 index)
|
||||||
{
|
{
|
||||||
BMenuItem *item = ItemAt(index);
|
BMenuItem *item = ItemAt(index);
|
||||||
RemoveItems(index, 1, NULL, false);
|
RemoveItems(0, 0, item, false);
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1214,7 +1214,7 @@ BMenu::RemoveItems(int32 index, int32 count, BMenuItem *_item, bool del)
|
|||||||
// We iterate backwards because it's simpler
|
// We iterate backwards because it's simpler
|
||||||
// TODO: We should check if index and count are in bounds.
|
// TODO: We should check if index and count are in bounds.
|
||||||
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(i));
|
||||||
if (item != NULL) {
|
if (item != NULL) {
|
||||||
fItems.RemoveItem(item);
|
fItems.RemoveItem(item);
|
||||||
item->SetSuper(NULL);
|
item->SetSuper(NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user