From 7b99592975f12b300f55a546dcc014698c354d05 Mon Sep 17 00:00:00 2001 From: Felix Nawothnig Date: Sat, 10 Mar 2007 14:29:07 +0100 Subject: [PATCH] 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 ae02cd63919..3e8ee593a33 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 32b9646fa27..046823770ce 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;