Module: wine Branch: master Commit: 2813b43aebaa11970716a2423f6b947b0f447cd3 URL: https://source.winehq.org/git/wine.git/?a=commit;h=2813b43aebaa11970716a2423...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Sun Nov 11 10:04:14 2018 +0300
comctl32/listbox: Clear LBS_OWNERDRAWVARIABLE if LBS_OWNERDRAWFIXED is set.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/comctl32/listbox.c | 2 ++ dlls/comctl32/tests/listbox.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index 2137ef8..d0e8e60 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -2520,6 +2520,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 */ diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c index a0ef9f5..c560ce1 100644 --- a/dlls/comctl32/tests/listbox.c +++ b/dlls/comctl32/tests/listbox.c @@ -435,6 +435,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); @@ -450,7 +452,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);