Nikolay Sivov : comctl32/comboex: Reduce variable scope.
Alexandre Julliard
julliard at winehq.org
Fri Feb 25 11:19:45 CST 2011
Module: wine
Branch: master
Commit: 101c8ca5ac201c7d0c18d6b67e7f62ccbf7b0c62
URL: http://source.winehq.org/git/wine.git/?a=commit;h=101c8ca5ac201c7d0c18d6b67e7f62ccbf7b0c62
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Fri Feb 25 11:34:55 2011 +0300
comctl32/comboex: Reduce variable scope.
---
dlls/comctl32/comboex.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c
index 10d8b87..319696d 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);
}
More information about the wine-cvs
mailing list