Commit 170f59e5 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

comctl32/listbox: Use is_item_selected in GetSelCount and GetSelItems.

parent 0a136249
...@@ -1024,13 +1024,12 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa ...@@ -1024,13 +1024,12 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa
static LRESULT LISTBOX_GetSelCount( const LB_DESCR *descr ) static LRESULT LISTBOX_GetSelCount( const LB_DESCR *descr )
{ {
INT i, count; INT i, count;
const LB_ITEMDATA *item = descr->items;
if (!(descr->style & LBS_MULTIPLESEL) || if (!(descr->style & LBS_MULTIPLESEL) ||
(descr->style & LBS_NOSEL)) (descr->style & LBS_NOSEL))
return LB_ERR; return LB_ERR;
for (i = count = 0; i < descr->nb_items; i++, item++) for (i = count = 0; i < descr->nb_items; i++)
if (item->selected) count++; if (is_item_selected(descr, i)) count++;
return count; return count;
} }
...@@ -1041,11 +1040,10 @@ static LRESULT LISTBOX_GetSelCount( const LB_DESCR *descr ) ...@@ -1041,11 +1040,10 @@ static LRESULT LISTBOX_GetSelCount( const LB_DESCR *descr )
static LRESULT LISTBOX_GetSelItems( const LB_DESCR *descr, INT max, LPINT array ) static LRESULT LISTBOX_GetSelItems( const LB_DESCR *descr, INT max, LPINT array )
{ {
INT i, count; INT i, count;
const LB_ITEMDATA *item = descr->items;
if (!(descr->style & LBS_MULTIPLESEL)) return LB_ERR; if (!(descr->style & LBS_MULTIPLESEL)) return LB_ERR;
for (i = count = 0; (i < descr->nb_items) && (count < max); i++, item++) for (i = count = 0; (i < descr->nb_items) && (count < max); i++)
if (item->selected) array[count++] = i; if (is_item_selected(descr, i)) array[count++] = i;
return count; return count;
} }
......
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