Felix Nawothnig : comctl32: Fix my last patch.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 12 08:28:29 CDT 2007


Module: wine
Branch: master
Commit: 7b99592975f12b300f55a546dcc014698c354d05
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7b99592975f12b300f55a546dcc014698c354d05

Author: Felix Nawothnig <flexo at holycrap.org>
Date:   Sat Mar 10 14:29:07 2007 +0100

comctl32: Fix my last patch.

My last patch was wrong and caused some nasty regressions. Mapping 
CLR_DEFAULT to the global defaults seem to be what native does.

---

 dlls/comctl32/listview.c       |   10 +++++++---
 dlls/comctl32/tests/listview.c |    4 ++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index ae02cd6..3e8ee59 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -946,6 +946,11 @@ static inline DWORD notify_customdraw (LISTVIEW_INFO *infoPtr, DWORD dwDrawStage
 
 static void prepaint_setup (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd)
 {
+    if (lpnmlvcd->clrTextBk == CLR_DEFAULT)
+        lpnmlvcd->clrTextBk = comctl32_color.clrWindow;
+    if (lpnmlvcd->clrText == CLR_DEFAULT)
+        lpnmlvcd->clrText = comctl32_color.clrWindowText;
+
     /* apprently, for selected items, we have to override the returned values */
     if (lpnmlvcd->nmcd.uItemState & CDIS_SELECTED)
     {
@@ -965,8 +970,7 @@ static void prepaint_setup (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpn
     if (lpnmlvcd->clrTextBk != CLR_NONE)
     {
 	SetBkMode(hdc, OPAQUE);
-	if (lpnmlvcd->clrTextBk != CLR_DEFAULT)
-	    SetBkColor(hdc,lpnmlvcd->clrTextBk);
+	SetBkColor(hdc,lpnmlvcd->clrTextBk);
     }
     else
 	SetBkMode(hdc, TRANSPARENT);
@@ -7717,7 +7721,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
 
   /* initialize color information  */
   infoPtr->clrBk = CLR_NONE;
-  infoPtr->clrText = comctl32_color.clrWindowText;
+  infoPtr->clrText = CLR_DEFAULT;
   infoPtr->clrTextBk = CLR_DEFAULT;
   LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
 
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 32b9646..0468237 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -624,11 +624,11 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
                 return CDRF_NOTIFYSUBITEMDRAW;
             case CDDS_ITEMPREPAINT | CDDS_SUBITEM:
                 clr = GetBkColor(nmlvcd->nmcd.hdc);
-                ok(clr == c0ffee, "clr=%.8x\n", clr);
+                todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr);
                 return CDRF_NOTIFYPOSTPAINT;
             case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM:
                 clr = GetBkColor(nmlvcd->nmcd.hdc);
-                ok(clr == c0ffee, "clr=%.8x\n", clr);
+                todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr);
                 return CDRF_DODEFAULT;
             }
             return CDRF_DODEFAULT;




More information about the wine-cvs mailing list