Bug 857816: menu.remove() should remove a submenu's menu item too. [r=mfinkle]

This commit is contained in:
Sriram Ramasubramanian 2013-04-03 15:29:21 -07:00
parent d09a387c0e
commit 874d05e5b6

View File

@ -298,6 +298,18 @@ public class GeckoMenu extends ListView
if (item == null)
return;
// Remove it from any sub-menu.
for (GeckoMenuItem menuItem : mItems) {
if (menuItem.hasSubMenu()) {
SubMenu subMenu = menuItem.getSubMenu();
if (subMenu != null && subMenu.findItem(id) != null) {
subMenu.removeItem(id);
return;
}
}
}
// Remove it from own menu.
if (mActionItems.containsKey(item)) {
if (mActionItemBarPresenter != null)
mActionItemBarPresenter.removeActionItem(mActionItems.get(item));