Commit 101c8ca5 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/comboex: Reduce variable scope.

parent 0d01212d
...@@ -1741,7 +1741,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -1741,7 +1741,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
return DefSubclassProc(hwnd, uMsg, wParam, lParam); return DefSubclassProc(hwnd, uMsg, wParam, lParam);
case WM_KEYDOWN: { case WM_KEYDOWN: {
INT_PTR oldItem, selected, step = 1; INT_PTR oldItem, selected;
CBE_ITEMDATA *item; CBE_ITEMDATA *item;
switch ((INT)wParam) switch ((INT)wParam)
...@@ -1851,13 +1851,15 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, ...@@ -1851,13 +1851,15 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
break; break;
case VK_UP: case VK_UP:
step = -1;
case VK_DOWN: case VK_DOWN:
/* by default, step is 1 */ {
INT step = wParam == VK_DOWN ? 1 : -1;
oldItem = SendMessageW (infoPtr->hwndSelf, CB_GETCURSEL, 0, 0); oldItem = SendMessageW (infoPtr->hwndSelf, CB_GETCURSEL, 0, 0);
if (oldItem >= 0 && oldItem + step >= 0) if (oldItem >= 0 && oldItem + step >= 0)
SendMessageW (infoPtr->hwndSelf, CB_SETCURSEL, oldItem + step, 0); SendMessageW (infoPtr->hwndSelf, CB_SETCURSEL, oldItem + step, 0);
return 0; return 0;
}
default: default:
return DefSubclassProc(hwnd, uMsg, wParam, lParam); return DefSubclassProc(hwnd, uMsg, wParam, lParam);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment