Nikolay Sivov : comctl32/listview: Make item width calculation not rely on column order for LV_VIEW_DETAILS.

Alexandre Julliard julliard at winehq.org
Thu Jun 11 10:54:26 CDT 2009


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Wed Jun 10 22:56:44 2009 +0400

comctl32/listview: 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..c210bf5 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;
 	}
     }




More information about the wine-cvs mailing list