=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: user32/listbox: Use a helper function to check the selection state of an item.

Alexandre Julliard julliard at winehq.org
Mon Dec 3 15:28:53 CST 2018


Module: wine
Branch: master
Commit: 3b087ce81faa102290f538cd6a0e2da251a9e464
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3b087ce81faa102290f538cd6a0e2da251a9e464

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Mon Dec  3 13:32:06 2018 +0300

user32/listbox: Use a helper function to check the selection state of an item.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/listbox.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c
index 286a33b..3eee691 100644
--- a/dlls/user32/listbox.c
+++ b/dlls/user32/listbox.c
@@ -120,6 +120,11 @@ static TIMER_DIRECTION LISTBOX_Timer = LB_TIMER_NONE;
 
 static LRESULT LISTBOX_GetItemRect( const LB_DESCR *descr, INT index, RECT *rect );
 
+static BOOL is_item_selected( const LB_DESCR *descr, UINT index )
+{
+    return descr->items[index].selected;
+}
+
 /*********************************************************************
  * listbox class descriptor
  */
@@ -2866,7 +2871,7 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
     case LB_GETSEL:
         if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
             return LB_ERR;
-        return descr->items[wParam].selected;
+        return is_item_selected(descr, wParam);
 
     case LB_SETSEL:
         ret = LISTBOX_SetSelection( descr, lParam, wParam, FALSE );




More information about the wine-cvs mailing list