Fixing Bug #3808 - Bookmark menu doesn't work on MacOS

This commit is contained in:
saari%netscape.com 1999-03-17 03:03:58 +00:00
Родитель 7c80f42289
Коммит f0d308b64d
1 изменённых файлов: 25 добавлений и 0 удалений

Просмотреть файл

@ -188,6 +188,7 @@ NS_METHOD nsMenu::AddMenu(nsIMenu * aMenu)
::InsertMenu((MenuHandle)menuHandle, hierMenu);
PRInt16 temp = mMacMenuIDCount;
::SetMenuItemHierarchicalID((MenuHandle) mMacMenuHandle, mNumMenuItems, --temp);
return NS_OK;
}
@ -284,6 +285,30 @@ nsEventStatus nsMenu::MenuSelected(const nsMenuEvent & aMenuEvent)
eventStatus = menuListener->MenuSelected(aMenuEvent);
NS_IF_RELEASE(menuListener);
}
}
else
{
// Make sure none of our submenus are the ones that should be handling this
for (int i = mMenuItemVoidArray.Count(); i > 0; i--)
{
if(nsnull != mMenuItemVoidArray[i-1])
{
nsIMenu * submenu = nsnull;
((nsISupports*)mMenuItemVoidArray[i-1])->QueryInterface(kIMenuIID, &submenu);
if(submenu)
{
nsIMenuListener * menuListener = nsnull;
((nsISupports*)mMenuItemVoidArray[i-1])->QueryInterface(kIMenuListenerIID, &menuListener);
if(menuListener){
eventStatus = menuListener->MenuSelected(aMenuEvent);
NS_IF_RELEASE(menuListener);
if(nsEventStatus_eIgnore != eventStatus)
return eventStatus;
}
}
}
}
}
return eventStatus;
}