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

Alexandre Julliard julliard at winehq.org
Fri Nov 23 14:18:02 CST 2018


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

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Fri Nov 23 10:16:12 2018 +0300

comctl32/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/comctl32/listbox.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
index dbc7b4a..a2085ed 100644
--- a/dlls/comctl32/listbox.c
+++ b/dlls/comctl32/listbox.c
@@ -125,6 +125,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_GetCurrentPageSize
  *
@@ -2763,7 +2768,7 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam,
     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