From 116e4d04fd01f81f2bfbd3a94abb58401f475c32 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Wed, 29 Sep 2021 14:15:49 +1000 Subject: Feature [feature-requests:#1416] Shorten code. --- win32/PlatWin.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'win32') diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 9035aa6f2..4e4a46bc8 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -3574,9 +3574,8 @@ LRESULT PASCAL ListBoxX::ControlWndProc(HWND hWnd, UINT iMessage, WPARAM wParam, // We must take control of selection to prevent the ListBox activating // the popup const LRESULT lResult = ::SendMessage(hWnd, LB_ITEMFROMPOINT, 0, lParam); - const int item = LOWORD(lResult); - if (HIWORD(lResult) == 0 && item >= 0) { - ListBox_SetCurSel(hWnd, item); + if (HIWORD(lResult) == 0) { + ListBox_SetCurSel(hWnd, LOWORD(lResult)); if (lbx) { lbx->OnSelChange(); } -- cgit v1.2.3