Commit 54ee4db6 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

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

parent 084eb528
...@@ -125,6 +125,11 @@ static TIMER_DIRECTION LISTBOX_Timer = LB_TIMER_NONE; ...@@ -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 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 * LISTBOX_GetCurrentPageSize
* *
...@@ -2763,7 +2768,7 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam, ...@@ -2763,7 +2768,7 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam,
case LB_GETSEL: case LB_GETSEL:
if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items)) if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
return LB_ERR; return LB_ERR;
return descr->items[wParam].selected; return is_item_selected(descr, wParam);
case LB_SETSEL: case LB_SETSEL:
ret = LISTBOX_SetSelection( descr, lParam, wParam, FALSE ); ret = LISTBOX_SetSelection( descr, lParam, wParam, FALSE );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment