Commit 704412b4 authored by Daniel Jelinski's avatar Daniel Jelinski Committed by Alexandre Julliard

comctl32/listview: Fix custom draw prepaint handling.

parent 0ee1df59
...@@ -5037,7 +5037,7 @@ static void LISTVIEW_RefreshList(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, D ...@@ -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) 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; NMLVCUSTOMDRAW nmlvcd;
HFONT hOldFont = 0; HFONT hOldFont = 0;
DWORD cdmode; DWORD cdmode;
...@@ -5094,21 +5094,12 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcEra ...@@ -5094,21 +5094,12 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcEra
hdcOrig, infoPtr->rcList.left, infoPtr->rcList.top, SRCCOPY); 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; infoPtr->cditemmode = CDRF_DODEFAULT;
GetClientRect(infoPtr->hwndSelf, &rcClient); GetClientRect(infoPtr->hwndSelf, &rcClient);
customdraw_fill(&nmlvcd, infoPtr, hdc, &rcClient, 0); customdraw_fill(&nmlvcd, infoPtr, hdc, &rcClient, 0);
cdmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd); cdmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd);
if (cdmode & CDRF_SKIPDEFAULT) goto enddraw; 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 */ /* nothing to draw */
if(infoPtr->nItemCount == 0) goto enddraw; if(infoPtr->nItemCount == 0) goto enddraw;
...@@ -5157,9 +5148,6 @@ enddraw: ...@@ -5157,9 +5148,6 @@ enddraw:
if (cdmode & CDRF_NOTIFYPOSTPAINT) if (cdmode & CDRF_NOTIFYPOSTPAINT)
notify_postpaint(infoPtr, &nmlvcd); notify_postpaint(infoPtr, &nmlvcd);
infoPtr->clrTextBk = oldClrTextBk;
infoPtr->clrText = oldClrText;
if(hbmp) { if(hbmp) {
BitBlt(hdcOrig, infoPtr->rcList.left, infoPtr->rcList.top, BitBlt(hdcOrig, infoPtr->rcList.left, infoPtr->rcList.top,
infoPtr->rcList.right - infoPtr->rcList.left, infoPtr->rcList.right - infoPtr->rcList.left,
......
...@@ -1765,7 +1765,10 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) ...@@ -1765,7 +1765,10 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
return CDRF_NOTIFYSUBITEMDRAW; return CDRF_NOTIFYSUBITEMDRAW;
case CDDS_ITEMPREPAINT | CDDS_SUBITEM: case CDDS_ITEMPREPAINT | CDDS_SUBITEM:
clr = GetBkColor(nmlvcd->nmcd.hdc); 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; return CDRF_NOTIFYPOSTPAINT;
case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM: case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM:
clr = GetBkColor(nmlvcd->nmcd.hdc); clr = GetBkColor(nmlvcd->nmcd.hdc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment