comctl32/listview: Fix custom draw prepaint handling.

This commit is contained in:
Daniel Jelinski 2013-03-03 15:22:43 +01:00 committed by Alexandre Julliard
parent 0ee1df5926
commit 704412b459
2 changed files with 5 additions and 14 deletions

View File

@ -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,

View File

@ -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);