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

This commit is contained in:
Nikolay Sivov 2009-06-10 22:56:44 +04:00 committed by Alexandre Julliard
parent ee015b8cd4
commit a5c970dea9
1 changed files with 7 additions and 3 deletions

View File

@ -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;
}
}