Module: wine Branch: master Commit: 704412b459cfafada2a04fa2f62be149e5597537 URL: http://source.winehq.org/git/wine.git/?a=commit;h=704412b459cfafada2a04fa2f6...
Author: Daniel Jelinski djelinski1@gmail.com Date: Sun Mar 3 15:22:43 2013 +0100
comctl32/listview: Fix custom draw prepaint handling.
---
dlls/comctl32/listview.c | 14 +------------- dlls/comctl32/tests/listview.c | 5 ++++- 2 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 9f4305a..4ae974e 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -5037,7 +5037,7 @@ static void LISTVIEW_RefreshList(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, D */ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcErase) { - COLORREF oldTextColor = 0, oldBkColor = 0, oldClrTextBk, oldClrText; + COLORREF oldTextColor = 0, oldBkColor = 0; NMLVCUSTOMDRAW nmlvcd; HFONT hOldFont = 0; DWORD cdmode; @@ -5094,21 +5094,12 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcEra hdcOrig, infoPtr->rcList.left, infoPtr->rcList.top, SRCCOPY); }
- /* FIXME: Shouldn't need to do this */ - oldClrTextBk = infoPtr->clrTextBk; - oldClrText = infoPtr->clrText; - infoPtr->cditemmode = CDRF_DODEFAULT;
GetClientRect(infoPtr->hwndSelf, &rcClient); customdraw_fill(&nmlvcd, infoPtr, hdc, &rcClient, 0); cdmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd); if (cdmode & CDRF_SKIPDEFAULT) goto enddraw; - prepaint_setup(infoPtr, hdc, &nmlvcd, FALSE); - - /* Use these colors to draw the items */ - infoPtr->clrTextBk = nmlvcd.clrTextBk; - infoPtr->clrText = nmlvcd.clrText;
/* nothing to draw */ if(infoPtr->nItemCount == 0) goto enddraw; @@ -5157,9 +5148,6 @@ enddraw: if (cdmode & CDRF_NOTIFYPOSTPAINT) notify_postpaint(infoPtr, &nmlvcd);
- infoPtr->clrTextBk = oldClrTextBk; - infoPtr->clrText = oldClrText; - if(hbmp) { BitBlt(hdcOrig, infoPtr->rcList.left, infoPtr->rcList.top, infoPtr->rcList.right - infoPtr->rcList.left, diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index fef3f60..1147c0b 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -1765,7 +1765,10 @@ 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); + if (nmlvcd->iSubItem) + todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr); + else + ok(clr == c0ffee, "clr=%.8x\n", clr); return CDRF_NOTIFYPOSTPAINT; case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM: clr = GetBkColor(nmlvcd->nmcd.hdc);