Commit b9212e2a authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

set_menu_item_text handles converting an empty menu item to a

separator on its own, give it a chance to do its work in the MIIM_FTYPE case.
parent 3592110a
...@@ -4230,10 +4230,10 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu, ...@@ -4230,10 +4230,10 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu,
menu->fType &= ~MENU_ITEM_TYPE(menu->fType); menu->fType &= ~MENU_ITEM_TYPE(menu->fType);
menu->fType |= MENU_ITEM_TYPE(lpmii->fType); menu->fType |= MENU_ITEM_TYPE(lpmii->fType);
menu->text = lpmii->dwTypeData;
if (IS_STRING_ITEM(menu->fType)) if (IS_STRING_ITEM(menu->fType))
set_menu_item_text( menu, lpmii->dwTypeData, unicode ); set_menu_item_text( menu, lpmii->dwTypeData, unicode );
else
menu->text = lpmii->dwTypeData;
} }
if (lpmii->fMask & MIIM_FTYPE ) { if (lpmii->fMask & MIIM_FTYPE ) {
...@@ -4244,8 +4244,11 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu, ...@@ -4244,8 +4244,11 @@ static BOOL SetMenuItemInfo_common(MENUITEM * menu,
} }
menu->fType &= ~MENU_ITEM_TYPE(menu->fType); menu->fType &= ~MENU_ITEM_TYPE(menu->fType);
menu->fType |= MENU_ITEM_TYPE(lpmii->fType); menu->fType |= MENU_ITEM_TYPE(lpmii->fType);
if ( IS_STRING_ITEM(menu->fType) && !menu->text )
menu->fType |= MF_SEPARATOR; if (IS_STRING_ITEM(menu->fType))
set_menu_item_text( menu, lpmii->dwTypeData, unicode );
else
menu->text = lpmii->dwTypeData;
} }
if (lpmii->fMask & MIIM_STRING ) { if (lpmii->fMask & MIIM_STRING ) {
......
...@@ -277,9 +277,7 @@ static void test_menu_add_string( void ) ...@@ -277,9 +277,7 @@ static void test_menu_add_string( void )
string[0] = 0; string[0] = 0;
GetMenuItemInfo( hmenu, 0, TRUE, &info ); GetMenuItemInfo( hmenu, 0, TRUE, &info );
todo_wine {
ok( !strcmp( string, "blah" ), "menu item name differed\n"); ok( !strcmp( string, "blah" ), "menu item name differed\n");
}
DestroyMenu( hmenu ); DestroyMenu( hmenu );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment