зеркало из https://github.com/mozilla/pjs.git
fix regression from bug 356078, some menu items appearing with default title. b=357153 r=hwaara
This commit is contained in:
Родитель
43d4525504
Коммит
fdebe8f12c
|
@ -528,18 +528,11 @@ nsEventStatus nsMenuX::SetRebuild(PRBool aNeedsRebuild)
|
||||||
|
|
||||||
NS_IMETHODIMP nsMenuX::SetEnabled(PRBool aIsEnabled)
|
NS_IMETHODIMP nsMenuX::SetEnabled(PRBool aIsEnabled)
|
||||||
{
|
{
|
||||||
mIsEnabled = aIsEnabled;
|
if (aIsEnabled != mIsEnabled) {
|
||||||
|
// we always want to rebuild when this changes
|
||||||
// find the menu item this menu is attached to
|
SetRebuild(PR_TRUE);
|
||||||
NSMenu* parentMenu = [mMacMenu supermenu];
|
mIsEnabled = aIsEnabled;
|
||||||
NSArray* parentMenuItems = [parentMenu itemArray];
|
|
||||||
unsigned int parentMenuItemCount = [parentMenuItems count];
|
|
||||||
for (unsigned int i = 0; i < parentMenuItemCount; i++) {
|
|
||||||
NSMenuItem* currentMenuItem = [parentMenuItems objectAtIndex:i];
|
|
||||||
if ([currentMenuItem submenu] == mMacMenu)
|
|
||||||
[currentMenuItem setEnabled:aIsEnabled];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче