[2/4] comctl32/listview: Make item width calculation not rely on column order for LV_VIEW_DETAILS

Nikolay Sivov bunglehead at gmail.com
Wed Jun 10 17:27:19 CDT 2009


Next step fixing http://bugs.winehq.org/show_bug.cgi?id=3231

Changelog:
    - Make item width calculation not rely on column order for LV_VIEW_DETAILS

>From 5bb5dd9208268c6efeef50bee2dd871f5f855f05 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Wed, 10 Jun 2009 22:56:44 +0400
Subject: Make item width calculation not rely on column order for LV_VIEW_DETAILS

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

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 55519dd..214953a 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -2505,11 +2505,15 @@ static INT LISTVIEW_CalculateItemWidth(const LISTVIEW_INFO *infoPtr)
 	nItemWidth = infoPtr->iconSpacing.cx;
     else if (infoPtr->uView == LV_VIEW_DETAILS)
     {
-	RECT rcHeader;
-
 	if (DPA_GetPtrCount(infoPtr->hdpaColumns) > 0)
 	{
-	    LISTVIEW_GetHeaderRect(infoPtr, DPA_GetPtrCount(infoPtr->hdpaColumns) - 1, &rcHeader);
+	    RECT rcHeader;
+	    INT index;
+
+	    index = SendMessageW(infoPtr->hwndHeader, HDM_ORDERTOINDEX, 
+                                 DPA_GetPtrCount(infoPtr->hdpaColumns) - 1, 0);
+
+	    LISTVIEW_GetHeaderRect(infoPtr, index, &rcHeader);
             nItemWidth = rcHeader.right;
 	}
     }
-- 
1.5.6.5







More information about the wine-patches mailing list