user32: Simplify CheckMenuRadioItem().

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2018-05-15 09:36:02 +01:00 committed by Alexandre Julliard
parent 47f3dd0565
commit 5fefb108c4
1 changed files with 6 additions and 14 deletions

View File

@ -5253,27 +5253,19 @@ BOOL WINAPI InsertMenuItemW(HMENU hMenu, UINT uItem, BOOL bypos,
BOOL WINAPI CheckMenuRadioItem(HMENU hMenu, UINT first, UINT last, BOOL WINAPI CheckMenuRadioItem(HMENU hMenu, UINT first, UINT last,
UINT check, UINT flags) UINT check, UINT flags)
{ {
POPUPMENU *first_menu = NULL, *check_menu = NULL; POPUPMENU *first_menu = NULL, *check_menu;
UINT i, first_pos, check_pos; UINT i, check_pos;
BOOL done = FALSE; BOOL done = FALSE;
for (i = first; i <= last; i++) for (i = first; i <= last; i++)
{ {
MENUITEM *item; MENUITEM *item;
if (!first_menu) if (!(check_menu = find_menu_item(hMenu, i, flags, &check_pos)))
{ continue;
if (!(first_menu = find_menu_item(hMenu, i, flags, &first_pos)))
continue;
check_pos = first_pos; if (!first_menu)
check_menu = grab_menu_ptr(first_menu->obj.handle); first_menu = grab_menu_ptr(check_menu->obj.handle);
}
else
{
if (!(check_menu = find_menu_item(hMenu, i, flags, &check_pos)))
continue;
}
if (first_menu != check_menu) if (first_menu != check_menu)
{ {