aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZufu Liu <unknown>2021-09-29 14:15:49 +1000
committerZufu Liu <unknown>2021-09-29 14:15:49 +1000
commit116e4d04fd01f81f2bfbd3a94abb58401f475c32 (patch)
tree714013235b2e477844c2bb751e8420aee2b42611
parentec6eb4ba32bf8009102b28f1e4c0d86dc133c5b2 (diff)
downloadscintilla-mirror-116e4d04fd01f81f2bfbd3a94abb58401f475c32.tar.gz
Feature [feature-requests:#1416] Shorten code.
-rw-r--r--win32/PlatWin.cxx5
1 files changed, 2 insertions, 3 deletions
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();
}