Huw Davies : user32: Simplify CheckMenuRadioItem().

Alexandre Julliard julliard at winehq.org
Tue May 15 16:25:22 CDT 2018


Module: wine
Branch: master
Commit: 5fefb108c4ce84625dbd647da37c709cfd2ec2ae
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5fefb108c4ce84625dbd647da37c709cfd2ec2ae

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue May 15 09:36:02 2018 +0100

user32: Simplify CheckMenuRadioItem().

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/menu.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c
index 5b83703..8c541cc 100644
--- a/dlls/user32/menu.c
+++ b/dlls/user32/menu.c
@@ -5253,27 +5253,19 @@ BOOL WINAPI InsertMenuItemW(HMENU hMenu, UINT uItem, BOOL bypos,
 BOOL WINAPI CheckMenuRadioItem(HMENU hMenu, UINT first, UINT last,
     UINT check, UINT flags)
 {
-    POPUPMENU *first_menu = NULL, *check_menu = NULL;
-    UINT i, first_pos, check_pos;
+    POPUPMENU *first_menu = NULL, *check_menu;
+    UINT i, check_pos;
     BOOL done = FALSE;
 
     for (i = first; i <= last; i++)
     {
         MENUITEM *item;
 
-        if (!first_menu)
-        {
-            if (!(first_menu = find_menu_item(hMenu, i, flags, &first_pos)))
-                continue;
+        if (!(check_menu = find_menu_item(hMenu, i, flags, &check_pos)))
+            continue;
 
-            check_pos = first_pos;
-            check_menu = grab_menu_ptr(first_menu->obj.handle);
-        }
-        else
-        {
-            if (!(check_menu = find_menu_item(hMenu, i, flags, &check_pos)))
-                continue;
-        }
+        if (!first_menu)
+            first_menu = grab_menu_ptr(check_menu->obj.handle);
 
         if (first_menu != check_menu)
         {




More information about the wine-cvs mailing list