[PATCH 2/5] comctl32/listbox: Use descr->selected_item for single-selection listboxes in is_item_selected

Gabriel Ivăncescu gabrielopcode at gmail.com
Fri Feb 8 06:41:43 CST 2019


Needed for LBS_NODATA.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
 dlls/comctl32/listbox.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
index 787fc88..d115617 100644
--- a/dlls/comctl32/listbox.c
+++ b/dlls/comctl32/listbox.c
@@ -149,6 +149,8 @@ static BOOL resize_storage(LB_DESCR *descr, UINT items_size)
 
 static BOOL is_item_selected( const LB_DESCR *descr, UINT index )
 {
+    if (!(descr->style & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)))
+        return index == descr->selected_item;
     return descr->items[index].selected;
 }
 
-- 
2.19.1




More information about the wine-devel mailing list