Nikolay Sivov : comctl32/listview: Fix scrolling in LV_VIEW_DETAILS view.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 30 10:12:58 CDT 2015


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sat Mar 28 18:35:07 2015 +0300

comctl32/listview: Fix scrolling in LV_VIEW_DETAILS view.

---

 dlls/comctl32/listview.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 3ac84a9..0b3439b 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -4565,13 +4565,22 @@ static void LISTVIEW_DrawItemPart(LISTVIEW_INFO *infoPtr, LVITEMW *item, const N
     OffsetRect(&rcIcon, pos->x, pos->y);
     OffsetRect(&rcStateIcon, pos->x, pos->y);
     OffsetRect(&rcLabel, pos->x, pos->y);
-    TRACE("    rcBox=%s, rcSelect=%s, rcIcon=%s. rcLabel=%s\n",
+    TRACE("%d: box=%s, select=%s, icon=%s. label=%s\n", item->iSubItem,
         wine_dbgstr_rect(&rcBox), wine_dbgstr_rect(&rcSelect),
         wine_dbgstr_rect(&rcIcon), wine_dbgstr_rect(&rcLabel));
 
     /* FIXME: temporary hack */
     rcSelect.left = rcLabel.left;
 
+    if (infoPtr->uView == LV_VIEW_DETAILS && item->iSubItem == 0)
+    {
+        if (!(infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
+            OffsetRect(&rcSelect, LISTVIEW_GetColumnInfo(infoPtr, 0)->rcHeader.left, 0);
+        OffsetRect(&rcIcon, LISTVIEW_GetColumnInfo(infoPtr, 0)->rcHeader.left, 0);
+        OffsetRect(&rcStateIcon, LISTVIEW_GetColumnInfo(infoPtr, 0)->rcHeader.left, 0);
+        OffsetRect(&rcLabel, LISTVIEW_GetColumnInfo(infoPtr, 0)->rcHeader.left, 0);
+    }
+
     /* in icon mode, the label rect is really what we want to draw the
      * background for */
     /* in detail mode, we want to paint background for label rect when
@@ -4900,9 +4909,9 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
 {
     INT rgntype;
     RECT rcClip, rcItem;
-    POINT Origin, Position;
+    POINT Origin;
     RANGES colRanges;
-    INT col, index;
+    INT col;
     ITERATOR j;
 
     TRACE("()\n");
@@ -4919,7 +4928,7 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
     /* narrow down the columns we need to paint */
     for(col = 0; col < DPA_GetPtrCount(infoPtr->hdpaColumns); col++)
     {
-	index = SendMessageW(infoPtr->hwndHeader, HDM_ORDERTOINDEX, col, 0);
+	INT index = SendMessageW(infoPtr->hwndHeader, HDM_ORDERTOINDEX, col, 0);
 
 	LISTVIEW_GetHeaderRect(infoPtr, index, &rcItem);
 	if ((rcItem.right + Origin.x >= rcClip.left) && (rcItem.left + Origin.x < rcClip.right))
@@ -4935,10 +4944,12 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
     while(iterator_next(i))
     {
         RANGES subitems;
+        POINT Position;
         ITERATOR k;
 
         SelectObject(hdc, infoPtr->hFont);
 	LISTVIEW_GetItemOrigin(infoPtr, i->nItem, &Position);
+        Position.x = Origin.x;
 	Position.y += Origin.y;
 
         subitems = ranges_create(DPA_GetPtrCount(infoPtr->hdpaColumns));
@@ -4947,7 +4958,6 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc,
 	while(iterator_next(&j))
 	{
 	    LISTVIEW_GetHeaderRect(infoPtr, j.nItem, &rcItem);
-	    Position.x = (j.nItem == 0) ? rcItem.left + Origin.x : Origin.x;
 
 	    if (rgntype == COMPLEXREGION && !((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) && j.nItem == 0))
 	    {




More information about the wine-cvs mailing list