mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-30 05:35:31 +00:00
don't increment the number of menus unless the menu is actually visible. r=saari/sr=ben/a=asa. bug# 83430.
This commit is contained in:
parent
8caa1e8b05
commit
ab17e76fc1
@ -382,7 +382,6 @@ NS_METHOD nsMenuBarX::AddMenu(nsIMenu * aMenu)
|
||||
MenuRef menuRef = nsnull;
|
||||
aMenu->GetNativeData((void**)&menuRef);
|
||||
|
||||
mNumMenus++;
|
||||
PRBool helpMenu;
|
||||
aMenu->IsHelpMenu(&helpMenu);
|
||||
if(!helpMenu) {
|
||||
@ -391,6 +390,10 @@ NS_METHOD nsMenuBarX::AddMenu(nsIMenu * aMenu)
|
||||
nsAutoString menuHidden;
|
||||
menu->GetAttribute(kNameSpaceID_None, nsWidgetAtoms::hidden, menuHidden);
|
||||
if( menuHidden != NS_LITERAL_STRING("true")) {
|
||||
// make sure we only increment |mNumMenus| if the menu is visible, since
|
||||
// we use it as an index of where to insert the next menu.
|
||||
mNumMenus++;
|
||||
|
||||
Str255 title;
|
||||
::InsertMenuItem(mRootMenu, ::GetMenuTitle(menuRef, title), mNumMenus);
|
||||
OSStatus status = ::SetMenuItemHierarchicalMenu(mRootMenu, mNumMenus, menuRef);
|
||||
|
Loading…
Reference in New Issue
Block a user