[PATCH v2 2/2] user32/listbox: Use is_item_selected in GetSelCount and GetSelItems
From: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> --- dlls/user32/listbox.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c index 0be48673ca..826ce01cc4 100644 --- a/dlls/user32/listbox.c +++ b/dlls/user32/listbox.c @@ -1066,13 +1066,12 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa static LRESULT LISTBOX_GetSelCount( const LB_DESCR *descr ) { INT i, count; - const LB_ITEMDATA *item = descr->items; if (!(descr->style & LBS_MULTIPLESEL) || (descr->style & LBS_NOSEL)) return LB_ERR; - for (i = count = 0; i < descr->nb_items; i++, item++) - if (item->selected) count++; + for (i = count = 0; i < descr->nb_items; i++) + if (is_item_selected(descr, i)) count++; return count; } @@ -1083,11 +1082,10 @@ static LRESULT LISTBOX_GetSelCount( const LB_DESCR *descr ) static LRESULT LISTBOX_GetSelItems( const LB_DESCR *descr, INT max, LPINT array ) { INT i, count; - const LB_ITEMDATA *item = descr->items; if (!(descr->style & LBS_MULTIPLESEL)) return LB_ERR; - for (i = count = 0; (i < descr->nb_items) && (count < max); i++, item++) - if (item->selected) array[count++] = i; + for (i = count = 0; (i < descr->nb_items) && (count < max); i++) + if (is_item_selected(descr, i)) array[count++] = i; return count; } -- 2.18.0
Hi, While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=48225 Your paranoid android. === debian9 (64 bit WoW report) === user32: msg.c:8713: Test failed: WaitForSingleObject failed 102 msg.c:8719: Test failed: destroy child on thread exit: 0: the msg 0x0082 was expected, but got msg 0x000f instead msg.c:8719: Test failed: destroy child on thread exit: 1: the msg 0x000f was expected, but got msg 0x0014 instead msg.c:8719: Test failed: destroy child on thread exit: 2: the msg sequence is not complete: expected 0014 - actual 0000
participants (2)
-
Huw Davies -
Marvin