comctl32: listview[2/2]: when shrinking the last column clear the now unused field

Mikołaj Zalewski mikolaj at zalewski.pl
Sat Jan 13 16:50:23 CST 2007


For other columns this is done by ScrollWindow but for the last column 
there is no ScrollWindow so we should do it manually
-------------- next part --------------
From 3e57b49b10f644f0ba2fa5cec87d47c91d19d596 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Miko=C5=82aj_Zalewski?= <mikolaj at zalewski.pl>
Date: Sat, 13 Jan 2007 21:44:28 +0100
Subject: [PATCH] comctl32: listview: when shrinking the last column clear the now unused field

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

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index a2deee3..36b6e6e 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -8611,10 +8611,16 @@ static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADE
 		    /* resizing left-aligned columns leaves most of the left side untouched */
 		    if ((lpColumnInfo->fmt & LVCFMT_JUSTIFYMASK) == LVCFMT_LEFT)
 		    {
-			INT nMaxDirty = infoPtr->nEllipsisWidth + infoPtr->ntmMaxCharWidth + dx;
+			INT nMaxDirty = infoPtr->nEllipsisWidth + infoPtr->ntmMaxCharWidth;
+			if (dx > 0)
+			    nMaxDirty += dx;
 			rcCol.left = max (rcCol.left, rcCol.right - nMaxDirty);
 		    }
 		    
+		    /* when shrinking the last column clear the now unused field */
+		    if (lpnmh->iItem == DPA_GetPtrCount(infoPtr->hdpaColumns) - 1 && dx < 0)
+		        rcCol.right -= dx;
+		    
 		    LISTVIEW_InvalidateRect(infoPtr, &rcCol);
 		}
 	    }
-- 
1.4.4.2


More information about the wine-patches mailing list