From 08670ee725d6d7ec9c4838f8b9ef60d55615b7bc Mon Sep 17 00:00:00 2001 From: Felix Nawothnig Date: Fri, 9 Mar 2007 19:19:24 +0100 Subject: [PATCH] comctl32: Remove clrTextBkDefault member from LISTVIEW_INFO and fix (clrTextBk == CLR_DEFAULT) handling for custom drawing. --- dlls/comctl32/listview.c | 11 ++++------- dlls/comctl32/tests/listview.c | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index f5904379a35..ae02cd63919 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -253,7 +253,6 @@ typedef struct tagLISTVIEW_INFO COLORREF clrBk; COLORREF clrText; COLORREF clrTextBk; - COLORREF clrTextBkDefault; HIMAGELIST himlNormal; HIMAGELIST himlSmall; HIMAGELIST himlState; @@ -966,9 +965,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, infoPtr->clrTextBkDefault); - else + if (lpnmlvcd->clrTextBk != CLR_DEFAULT) SetBkColor(hdc,lpnmlvcd->clrTextBk); } else @@ -4036,7 +4033,7 @@ static void LISTVIEW_RefreshList(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, D static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc) { UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; - COLORREF oldTextColor, oldClrTextBk, oldClrText; + COLORREF oldTextColor, oldBkColor, oldClrTextBk, oldClrText; NMLVCUSTOMDRAW nmlvcd; HFONT hOldFont; DWORD cdmode; @@ -4051,7 +4048,7 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc) /* save dc values we're gonna trash while drawing */ hOldFont = SelectObject(hdc, infoPtr->hFont); oldBkMode = GetBkMode(hdc); - infoPtr->clrTextBkDefault = GetBkColor(hdc); + oldBkColor = GetBkColor(hdc); oldTextColor = GetTextColor(hdc); oldClrTextBk = infoPtr->clrTextBk; @@ -4111,7 +4108,7 @@ enddraw: SelectObject(hdc, hOldFont); SetBkMode(hdc, oldBkMode); - SetBkColor(hdc, infoPtr->clrTextBkDefault); + SetBkColor(hdc, oldBkColor); SetTextColor(hdc, oldTextColor); infoPtr->bIsDrawing = FALSE; } diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 046823770ce..32b9646fa27 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); - todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr); + ok(clr == c0ffee, "clr=%.8x\n", clr); return CDRF_NOTIFYPOSTPAINT; case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM: clr = GetBkColor(nmlvcd->nmcd.hdc); - todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr); + ok(clr == c0ffee, "clr=%.8x\n", clr); return CDRF_DODEFAULT; } return CDRF_DODEFAULT; -- 2.11.4.GIT