Vincent Povirk : user32: Use the correct bitmap location for MNS_CHECKORBMP .
Alexandre Julliard
julliard at winehq.org
Mon Sep 8 07:41:53 CDT 2008
Module: wine
Branch: master
Commit: 3c4f44d1afee5adc956840c24d2b043334966030
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3c4f44d1afee5adc956840c24d2b043334966030
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Thu Sep 4 15:38:43 2008 -0500
user32: Use the correct bitmap location for MNS_CHECKORBMP.
---
dlls/user32/menu.c | 10 ++++++----
dlls/user32/tests/menu.c | 8 ++------
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index 058cf0f..b7cfe1c 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -1504,11 +1504,13 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
bmprc.left = 3;
else
bmprc.left = lpitem->text ? menucharsize.cx : 0;
- } else {
- bmprc.left = 4;
- if( !(menu->dwStyle & ( MNS_CHECKORBMP | MNS_NOCHECK)))
- bmprc.left += GetSystemMetrics( SM_CXMENUCHECK);
}
+ else if (menu->dwStyle & MNS_NOCHECK)
+ bmprc.left = 4;
+ else if (menu->dwStyle & MNS_CHECKORBMP)
+ bmprc.left = 2;
+ else
+ bmprc.left = 4 + GetSystemMetrics(SM_CXMENUCHECK);
bmprc.right = bmprc.left + lpitem->bmpsize.cx;
if( menuBar && !(lpitem->hbmpItem == HBMMENU_CALLBACK))
bmprc.top = 0;
diff --git a/dlls/user32/tests/menu.c b/dlls/user32/tests/menu.c
index 5ccaba4..0eabe50 100644
--- a/dlls/user32/tests/menu.c
+++ b/dlls/user32/tests/menu.c
@@ -456,12 +456,8 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
expect = 4;
else /* mnuopt == 2 */
expect = 2;
- if (ispop && mnuopt == 2)
- todo_wine ok( expect == MOD_rc[0].left,
- "bitmap left is %d expected %d\n", MOD_rc[0].left, expect);
- else
- ok( expect == MOD_rc[0].left,
- "bitmap left is %d expected %d\n", MOD_rc[0].left, expect);
+ ok( expect == MOD_rc[0].left,
+ "bitmap left is %d expected %d\n", MOD_rc[0].left, expect);
failed = failed || !(expect == MOD_rc[0].left);
/* vertical */
expect = (rc.bottom - rc.top - MOD_rc[0].bottom + MOD_rc[0].top) / 2;
More information about the wine-cvs
mailing list