Module: wine Branch: master Commit: c6dbb33e19b94d87b98fa20a2d3eb147d599f18a URL: http://source.winehq.org/git/wine.git/?a=commit;h=c6dbb33e19b94d87b98fa20a2d...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Mon Apr 21 14:16:42 2014 +0900
user32: When converting from MF_ flags to MENUITEMINFO ignore MF_POPUP if id is not a menu.
---
dlls/user32/menu.c | 2 +- dlls/user32/tests/menu.c | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index 6b0cf2f..ab3f73b 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -3859,7 +3859,7 @@ static void MENU_mnu2mnuii( UINT flags, UINT_PTR id, LPCWSTR str, pmii->fMask |= MIIM_DATA; pmii->dwItemData = (ULONG_PTR) str; } - if( flags & MF_POPUP) { + if( flags & MF_POPUP && MENU_GetMenu((HMENU)id)) { pmii->fMask |= MIIM_SUBMENU; pmii->hSubMenu = (HMENU)id; } diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c index 2f3c481..593292d 100644 --- a/dlls/user32/tests/menu.c +++ b/dlls/user32/tests/menu.c @@ -3639,18 +3639,14 @@ static void test_AppendMenu(void) hmenu = CreateMenu(); ok(hmenu != 0, "CreateMenu failed\n"); ret = AppendMenuA(hmenu, MF_POPUP, 202, "item 1"); -todo_wine ok(ret, "AppendMenu failed\n"); -if (ret) /* FIXME: uncomment once Wine is fixed */ check_menu_items(hmenu, 202, MF_STRING, 0); DestroyMenu(hmenu);
hmenu = CreateMenu(); ok(hmenu != 0, "CreateMenu failed\n"); ret = AppendMenuA(hmenu, MF_OWNERDRAW | MF_POPUP, 203, "item 1"); -todo_wine ok(ret, "AppendMenu failed\n"); -if (ret) /* FIXME: uncomment once Wine is fixed */ check_menu_items(hmenu, 203, MF_OWNERDRAW, 0); DestroyMenu(hmenu);
@@ -3720,9 +3716,7 @@ if (ret) /* FIXME: uncomment once Wine is fixed */ ok(ret, "AppendMenu failed\n"); check_menu_items(hmenu, 204, MF_STRING, 0); ret = ModifyMenuA(hmenu, 0, MF_POPUP | MF_BYPOSITION, 205, "item 2"); -todo_wine ok(ret, "ModifyMenu failed\n"); -if (ret) /* FIXME: uncomment once Wine is fixed */ check_menu_items(hmenu, 205, MF_STRING, 0); memset(&mii, 0, sizeof(mii)); mii.cbSize = sizeof(mii);