Both BMenu::FindItem() versions were broken and could return a wrong item.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14796 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-11-09 17:21:12 +00:00
parent c94c34e8cf
commit 8f4959d844
1 changed files with 10 additions and 10 deletions

View File

@ -462,16 +462,16 @@ BMenu::FindItem(const char *label) const
item = ItemAt(i);
if (item->Label() && strcmp(item->Label(), label) == 0)
break;
return item;
if (item->Submenu()) {
if (item->Submenu() != NULL) {
item = item->Submenu()->FindItem(label);
if (item)
break;
if (item != NULL)
return item;
}
}
return item;
return NULL;
}
@ -484,16 +484,16 @@ BMenu::FindItem(uint32 command) const
item = ItemAt(i);
if (item->Command() == command)
break;
return item;
if (item->Submenu()) {
if (item->Submenu() != NULL) {
item = item->Submenu()->FindItem(command);
if (item)
break;
if (item != NULL)
return item;
}
}
return item;
return NULL;
}