Commit 2aedcf3f authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

comctl32/listbox: Make SetCount fail if LBS_NODATA is not set.

parent 8e13120c
......@@ -1752,11 +1752,7 @@ static LRESULT LISTBOX_SetCount( LB_DESCR *descr, INT count )
{
LRESULT ret;
if (HAS_STRINGS(descr))
{
SetLastError(ERROR_SETCOUNT_ON_BAD_LB);
return LB_ERR;
}
if (!(descr->style & LBS_NODATA)) return LB_ERR;
/* FIXME: this is far from optimal... */
if (count > descr->nb_items)
......
......@@ -1806,9 +1806,7 @@ static void test_set_count( void )
SetLastError( 0xdeadbeef );
ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 );
todo_wine_if(i == 0)
ok( ret == LB_ERR, "expected %d, got %d\n", LB_ERR, ret );
todo_wine_if(i == 1)
ok( GetLastError() == 0xdeadbeef, "Unexpected error %d.\n", GetLastError() );
DestroyWindow( listbox );
......@@ -2341,7 +2339,6 @@ todo_wine
style = GetWindowLongA(listbox, GWL_STYLE);
ok((style & invalid_styles[i]) == invalid_styles[i], "%u: unexpected window styles %#x.\n", i, style);
ret = SendMessageA(listbox, LB_SETCOUNT, 100, 0);
todo_wine_if(i == 1 || i == 4)
ok(ret == LB_ERR, "%u: unexpected return value %d.\n", i, ret);
DestroyWindow(listbox);
}
......
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