=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: user32/listbox: Clear LBS_OWNERDRAWVARIABLE if LBS_OWNERDRAWFIXED is set.

Alexandre Julliard julliard at winehq.org
Fri Nov 16 14:38:19 CST 2018


Module: wine
Branch: master
Commit: 9b59eb477b9d3aa54bb7c5115de8e3dae1be0205
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9b59eb477b9d3aa54bb7c5115de8e3dae1be0205

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Thu Nov 15 11:46:15 2018 +0200

user32/listbox: Clear LBS_OWNERDRAWVARIABLE if LBS_OWNERDRAWFIXED is set.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/listbox.c       | 2 ++
 dlls/user32/tests/listbox.c | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c
index c8bd148..f021029 100644
--- a/dlls/user32/listbox.c
+++ b/dlls/user32/listbox.c
@@ -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 */
diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c
index dc5657c..776e3f3 100644
--- a/dlls/user32/tests/listbox.c
+++ b/dlls/user32/tests/listbox.c
@@ -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);




More information about the wine-cvs mailing list