Bug 678060: Fix build with clang and c++0x. Need explicit cast from enums to ThemeMenuState in init list, since ThemeMenuState is typedefed to an int type. r=josh

This commit is contained in:
Rafael Ávila de Espíndola 2011-08-11 15:23:01 -07:00
Родитель 38b8e5cc37
Коммит f1ac76891f
1 изменённых файлов: 7 добавлений и 5 удалений

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

@ -1797,8 +1797,9 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
case NS_THEME_MENUPOPUP: { case NS_THEME_MENUPOPUP: {
HIThemeMenuDrawInfo mdi = { HIThemeMenuDrawInfo mdi = {
version: 0, version: 0,
menuType: IsDisabled(aFrame, eventState) ? kThemeMenuTypeInactive menuType: IsDisabled(aFrame, eventState) ?
: kThemeMenuTypePopUp static_cast<ThemeMenuType>(kThemeMenuTypeInactive) :
static_cast<ThemeMenuType>(kThemeMenuTypePopUp)
}; };
PRBool isLeftOfParent = PR_FALSE; PRBool isLeftOfParent = PR_FALSE;
@ -1821,9 +1822,10 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext* aContext,
HIThemeMenuItemDrawInfo drawInfo = { HIThemeMenuItemDrawInfo drawInfo = {
version: 0, version: 0,
itemType: kThemeMenuItemPlain, itemType: kThemeMenuItemPlain,
state: (IsDisabled(aFrame, eventState) ? kThemeMenuDisabled : state: (IsDisabled(aFrame, eventState) ? static_cast<ThemeMenuState>(kThemeMenuDisabled) :
CheckBooleanAttr(aFrame, nsWidgetAtoms::mozmenuactive) ? kThemeMenuSelected : CheckBooleanAttr(aFrame, nsWidgetAtoms::mozmenuactive) ?
kThemeMenuActive) static_cast<ThemeMenuState>(kThemeMenuSelected) :
static_cast<ThemeMenuState>(kThemeMenuActive))
}; };
// XXX pass in the menu rect instead of always using the item rect // XXX pass in the menu rect instead of always using the item rect