Commit 0b7dbc9e authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

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

parent 19f26c35
......@@ -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))
......
......@@ -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);
......
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