Daniel Jelinski : comctl32/listview: Update item height when changing font.

Alexandre Julliard julliard at winehq.org
Mon Jan 7 13:42:20 CST 2013


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

Author: Daniel Jelinski <djelinski1 at gmail.com>
Date:   Sat Jan  5 21:18:12 2013 +0100

comctl32/listview: Update item height when changing font.

---

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

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index f1ebd7e..a67b637 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -10750,6 +10750,7 @@ static LRESULT LISTVIEW_SetFocus(LISTVIEW_INFO *infoPtr, HWND hwndLoseFocus)
 static LRESULT LISTVIEW_SetFont(LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedraw)
 {
     HFONT oldFont = infoPtr->hFont;
+    INT oldHeight = infoPtr->nItemHeight;
 
     TRACE("(hfont=%p,redraw=%hu)\n", hFont, fRedraw);
 
@@ -10758,12 +10759,16 @@ static LRESULT LISTVIEW_SetFont(LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedra
     
     LISTVIEW_SaveTextMetrics(infoPtr);
 
+    infoPtr->nItemHeight = LISTVIEW_CalculateItemHeight(infoPtr);
+
     if (infoPtr->uView == LV_VIEW_DETAILS)
     {
 	SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(fRedraw, 0));
         LISTVIEW_UpdateSize(infoPtr);
         LISTVIEW_UpdateScroll(infoPtr);
     }
+    else if (infoPtr->nItemHeight != oldHeight)
+        LISTVIEW_UpdateScroll(infoPtr);
 
     if (fRedraw) LISTVIEW_InvalidateList(infoPtr);
 




More information about the wine-cvs mailing list