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

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Gabriel Ivăncescu 2018-11-14 12:00:20 +02:00 committed by Alexandre Julliard
parent 19f26c35d5
commit 0b7dbc9e19
2 changed files with 8 additions and 0 deletions

View File

@ -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))

View File

@ -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);