From 101c8ca5ac201c7d0c18d6b67e7f62ccbf7b0c62 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 25 Feb 2011 11:34:55 +0300 Subject: [PATCH] comctl32/comboex: Reduce variable scope. --- dlls/comctl32/comboex.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 10d8b8727b8..319696d9c85 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -1741,7 +1741,7 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, return DefSubclassProc(hwnd, uMsg, wParam, lParam); case WM_KEYDOWN: { - INT_PTR oldItem, selected, step = 1; + INT_PTR oldItem, selected; CBE_ITEMDATA *item; switch ((INT)wParam) @@ -1851,13 +1851,15 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, break; case VK_UP: - step = -1; case VK_DOWN: - /* by default, step is 1 */ + { + INT step = wParam == VK_DOWN ? 1 : -1; + oldItem = SendMessageW (infoPtr->hwndSelf, CB_GETCURSEL, 0, 0); if (oldItem >= 0 && oldItem + step >= 0) SendMessageW (infoPtr->hwndSelf, CB_SETCURSEL, oldItem + step, 0); return 0; + } default: return DefSubclassProc(hwnd, uMsg, wParam, lParam); }