Felix Nawothnig : comctl32: Remove clrTextBkDefault member from LISTVIEW_INFO and fix (clrTextBk == CLR_DEFAULT) handling for custom drawing.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Mar 9 15:47:47 CST 2007


Module: wine
Branch: master
Commit: 08670ee725d6d7ec9c4838f8b9ef60d55615b7bc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=08670ee725d6d7ec9c4838f8b9ef60d55615b7bc

Author: Felix Nawothnig <flexo at holycrap.org>
Date:   Fri Mar  9 19:19:24 2007 +0100

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 f590437..ae02cd6 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 0468237..32b9646 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;




More information about the wine-cvs mailing list