=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: comctl32/listbox: Make LBS_NODATA listboxes error on any attempt to find a value.

Alexandre Julliard julliard at winehq.org
Wed Nov 14 16:18:59 CST 2018


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

Author: Gabriel Iv─âncescu <gabrielopcode at gmail.com>
Date:   Wed Nov 14 12:00:20 2018 +0200

comctl32/listbox: Make LBS_NODATA listboxes error on any attempt to find a value.

Signed-off-by: Gabriel Iv─âncescu <gabrielopcode at gmail.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/listbox.c       | 2 ++
 dlls/comctl32/tests/listbox.c | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
index 479f6a6..dbc7b4a 100644
--- a/dlls/comctl32/listbox.c
+++ b/dlls/comctl32/listbox.c
@@ -880,6 +880,8 @@ static INT LISTBOX_FindString( LB_DESCR *descr, INT start, LPCWSTR str, BOOL exa
     INT i;
     LB_ITEMDATA *item;
 
+    if (descr->style & LBS_NODATA) return LB_ERR;
+
     if (start >= descr->nb_items) start = -1;
     item = descr->items + start + 1;
     if (HAS_STRINGS(descr))
diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c
index 271cbca..43da3ca 100644
--- a/dlls/comctl32/tests/listbox.c
+++ b/dlls/comctl32/tests/listbox.c
@@ -2309,10 +2309,16 @@ static void test_LBS_NODATA(void)
     }
 
     /* More messages that don't work with LBS_NODATA. */
+    ret = SendMessageA(listbox, LB_FINDSTRING, 1, 0);
+    ok(ret == LB_ERR, "Unexpected return value %d.\n", ret);
     ret = SendMessageA(listbox, LB_FINDSTRING, 1, 42);
     ok(ret == LB_ERR, "Unexpected return value %d.\n", ret);
+    ret = SendMessageA(listbox, LB_FINDSTRINGEXACT, 1, 0);
+    ok(ret == LB_ERR, "Unexpected return value %d.\n", ret);
     ret = SendMessageA(listbox, LB_FINDSTRINGEXACT, 1, 42);
     ok(ret == LB_ERR, "Unexpected return value %d.\n", ret);
+    ret = SendMessageA(listbox, LB_SELECTSTRING, 1, 0);
+    ok(ret == LB_ERR, "Unexpected return value %d.\n", ret);
     ret = SendMessageA(listbox, LB_SELECTSTRING, 1, 42);
     ok(ret == LB_ERR, "Unexpected return value %d.\n", ret);
 




More information about the wine-cvs mailing list