Nikolay Sivov : comctl32/listview: Don' t offset subitem rectangles with item padding returned by LVM_GETSUBITEMRECT .

Alexandre Julliard julliard at winehq.org
Fri May 29 09:15:51 CDT 2009


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

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Fri May 29 01:35:36 2009 +0400

comctl32/listview: Don't offset subitem rectangles with item padding returned by LVM_GETSUBITEMRECT.

---

 dlls/comctl32/listview.c       |    6 +++---
 dlls/comctl32/tests/listview.c |   10 ++--------
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 92bab29..1c84f02 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -2044,7 +2044,7 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW
 	{
 	    Icon.left   = Box.left + state_width;
 
-	    if (uView == LVS_REPORT)
+	    if (uView == LVS_REPORT && lpLVItem->iSubItem == 0)
 		Icon.left += REPORT_MARGINX;
 
 	    Icon.top    = Box.top;
@@ -2145,7 +2145,7 @@ calc_label:
 	    Label.right = lpColumnInfo->rcHeader.right;
 	    Label.bottom = Label.top + infoPtr->nItemHeight;
 	}
-	else /* LVS_SMALLICON, LVS_LIST or LVS_REPORT */
+	else /* LVS_SMALLICON or LVS_LIST */
 	{
 	    Label.left = Icon.right;
 	    Label.top = Box.top;
@@ -6077,7 +6077,7 @@ static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPR
 	return FALSE;
     }
 
-    OffsetRect(lprc, Position.x, Position.y);
+    OffsetRect(lprc, 0, Position.y);
     return TRUE;
 }
 
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 003f98f..217c2ee 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -1835,32 +1835,26 @@ todo_wine
     rect.right = rect.bottom = 0;
     r = SendMessage(hwnd, LVM_GETSUBITEMRECT, 0, (LPARAM)&rect);
     ok(r != 0, "Expected not-null LRESULT\n");
-todo_wine {
     expect(100, rect.left);
     expect(250, rect.right);
-}
 
     rect.left = LVIR_ICON;
     rect.top  = 1;
     rect.right = rect.bottom = 0;
     r = SendMessage(hwnd, LVM_GETSUBITEMRECT, 0, (LPARAM)&rect);
     ok(r != 0, "Expected not-null LRESULT\n");
-    /* no icon attached - zero width rectangle */
-todo_wine {
+    /* no icon attached - zero width rectangle, with no left padding */
     expect(100, rect.left);
     expect(100, rect.right);
-}
 
     rect.left = LVIR_LABEL;
     rect.top  = 1;
     rect.right = rect.bottom = 0;
     r = SendMessage(hwnd, LVM_GETSUBITEMRECT, 0, (LPARAM)&rect);
     ok(r != 0, "Expected not-null LRESULT\n");
-    /* should equal to LVIR_BOUNDS */
-todo_wine {
+    /* same as full LVIR_BOUNDS */
     expect(100, rect.left);
     expect(250, rect.right);
-}
 
     DestroyWindow(hwnd);
 




More information about the wine-cvs mailing list