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:
parent
c94c34e8cf
commit
8f4959d844
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue