[PATCH] user32: use the correct bitmap location for MNS_CHECKORBMP

Vincent Povirk vincent at codeweavers.com
Thu Sep 4 15:38:43 CDT 2008


---
 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 74cb2a0..e463eeb 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;
-- 
1.5.4.3


--=-yackivjPq0ADavR178HM--




More information about the wine-patches mailing list