Maarten Lankhorst : comctl32: Restore listview font on CDRF_NEWFONT.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 31 06:04:22 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 15ca9ce672a41384f61d7c174deaeb3b8cd3352c
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=15ca9ce672a41384f61d7c174deaeb3b8cd3352c

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Tue Jan 31 12:21:51 2006 +0100

comctl32: Restore listview font on CDRF_NEWFONT.

---

 dlls/comctl32/listview.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index db61690..f51b34d 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -3677,6 +3677,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_I
     NMLVCUSTOMDRAW nmlvcd;
     HIMAGELIST himl;
     LVITEMW lvItem;
+    HFONT hOldFont;
 
     TRACE("(hdc=%p, nItem=%d, nSubItem=%d, pos=%s)\n", hdc, nItem, nSubItem, wine_dbgstr_point(&pos));
 
@@ -3699,7 +3700,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_I
 
     /* now check if we need to update the focus rectangle */
     lprcFocus = infoPtr->bFocus && (lvItem.state & LVIS_FOCUSED) ? &infoPtr->rcFocus : 0;
-    
+
     if (!lprcFocus) lvItem.state &= ~LVIS_FOCUSED;
     LISTVIEW_GetItemMetrics(infoPtr, &lvItem, &rcBox, &rcState, &rcIcon, &rcLabel);
     OffsetRect(&rcBox, pos.x, pos.y);
@@ -3713,6 +3714,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_I
     /* fill in the custom draw structure */
     customdraw_fill(&nmlvcd, infoPtr, hdc, &rcBox, &lvItem);
 
+    hOldFont = GetCurrentObject(hdc, OBJ_FONT);
     if (nSubItem > 0) cdmode = infoPtr->cditemmode;
     if (cdmode & CDRF_NOTIFYITEMDRAW)
         cdsubitemmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd);
@@ -3790,6 +3792,8 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_I
 postpaint:
     if (cdsubitemmode & CDRF_NOTIFYPOSTPAINT)
         notify_postpaint(infoPtr, &nmlvcd);
+    if (cdsubitemmode & CDRF_NEWFONT)
+        SelectObject(hdc, hOldFont);
     return TRUE;
 }
 




More information about the wine-cvs mailing list