[6/6] comctl32/listview: Offset every but LVIR_BOUNDS rectangles to column bound in details view

Nikolay Sivov bunglehead at gmail.com
Sun Aug 2 17:55:05 CDT 2009


When main item is at 0 order column there's nothing to speak about,
but after order change all rectangles should be offset to left column bound.
All except LVIR_BOUNDS (and LVIR_SELECT for full-row-select mode) - it always
covers item with all subitems and starts from 0.

Changelog:
    - Offset every but LVIR_BOUNDS rectangles to column bound in details view

>From d6ac0950d31463a3b83e80fd9d327ea298f3727d Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Mon, 3 Aug 2009 02:32:37 +0400
Subject: Offset every but LVIR_BOUNDS rectangles to column bound in details view

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

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 59f70a2..ea96b8a 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -6258,6 +6258,7 @@ static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT
     BOOL doLabel = TRUE, oversizedBox = FALSE;
     POINT Position, Origin;
     LVITEMW lvItem;
+    LONG mode;
 
     TRACE("(hwnd=%p, nItem=%d, lprc=%p)\n", infoPtr->hwndSelf, nItem, lprc);
 
@@ -6294,6 +6295,8 @@ static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT
 
     if (infoPtr->uView == LV_VIEW_DETAILS && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) && lprc->left == LVIR_SELECTBOUNDS)
 	lprc->left = LVIR_BOUNDS;
+
+    mode = lprc->left;
     switch(lprc->left)
     {
     case LVIR_ICON:
@@ -6318,7 +6321,13 @@ static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT
     }
 
     if (infoPtr->uView == LV_VIEW_DETAILS)
-        OffsetRect(lprc, Origin.x, Position.y + Origin.y);
+    {
+	if (mode != LVIR_BOUNDS)
+	    OffsetRect(lprc, Origin.x + LISTVIEW_GetColumnInfo(infoPtr, 0)->rcHeader.left,
+	                     Position.y + Origin.y);
+	else
+	    OffsetRect(lprc, Origin.x, Position.y + Origin.y);
+    }
     else
         OffsetRect(lprc, Position.x + Origin.x, Position.y + Origin.y);
 
-- 
1.5.6.5





More information about the wine-patches mailing list