user32/listbox: Clear LBS_OWNERDRAWVARIABLE if LBS_OWNERDRAWFIXED is set.

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-15 11:46:15 +02:00 committed by Alexandre Julliard
parent 24b539dea8
commit 9b59eb477b
2 changed files with 4 additions and 1 deletions

View File

@ -2525,6 +2525,8 @@ static BOOL LISTBOX_Create( HWND hwnd, LPHEADCOMBO lphc )
if (descr->style & LBS_OWNERDRAWFIXED)
{
descr->style &= ~LBS_OWNERDRAWVARIABLE;
if( descr->lphc && (descr->lphc->dwStyle & CBS_DROPDOWN))
{
/* WinWord gets VERY unhappy if we send WM_MEASUREITEM from here */

View File

@ -374,6 +374,8 @@ static void test_ownerdraw(void)
NULL, NULL, NULL, 0);
ok(hLB != NULL, "last error 0x%08x\n", GetLastError());
ok(GetWindowLongA(hLB, GWL_STYLE) & LBS_OWNERDRAWVARIABLE, "Unexpected window style.\n");
ret = SendMessageA(hLB, LB_INSERTSTRING, -1, 0);
ok(ret == 0, "Unexpected return value %d.\n", ret);
ret = SendMessageA(hLB, LB_INSERTSTRING, -1, 0);
@ -389,7 +391,6 @@ static void test_ownerdraw(void)
ok(ret == LB_OKAY, "Failed to set item height, %d.\n", ret);
ret = SendMessageA(hLB, LB_GETITEMHEIGHT, 0, 0);
todo_wine
ok(ret == 42, "Unexpected item height %d.\n", ret);
ret = SendMessageA(hLB, LB_GETITEMHEIGHT, 1, 0);