[2/4] comctl32/listview: LVM_GETVIEWRECT is unsupported on LVS_REPORT style

Nikolay Sivov bunglehead at gmail.com
Mon May 25 19:51:01 CDT 2009


Changelog:
    - LVM_GETVIEWRECT is unsupported on LVS_REPORT style

>From 35fb8c94fb848c66bac71978a1881d9943880bec Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Tue, 26 May 2009 02:25:05 +0400
Subject: LVM_GETVIEWRECT is unsupported on LVS_REPORT style

---
 dlls/comctl32/listview.c       |   18 +++++++++---------
 dlls/comctl32/tests/listview.c |    2 --
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 129f3cb..9f52d24 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -2372,6 +2372,7 @@ static BOOL LISTVIEW_Arrange(LISTVIEW_INFO *infoPtr, INT nAlignCode)
 /***
  * DESCRIPTION:
  * Retrieves the bounding rectangle of all the items, not offset by Origin.
+ * For LVS_REPORT always returns empty rectangle.
  *
  * PARAMETER(S):
  * [I] infoPtr : valid pointer to the listview structure
@@ -2412,11 +2413,6 @@ static void LISTVIEW_GetAreaRect(const LISTVIEW_INFO *infoPtr, LPRECT lprcView)
 	lprcView->right = x * infoPtr->nItemWidth;
 	lprcView->bottom = y * infoPtr->nItemHeight;
 	break;
-	
-    case LVS_REPORT:	    
-    	lprcView->right = infoPtr->nItemWidth;
-	lprcView->bottom = infoPtr->nItemCount * infoPtr->nItemHeight;
-	break;
     }
 }
 
@@ -2439,10 +2435,14 @@ static BOOL LISTVIEW_GetViewRect(const LISTVIEW_INFO *infoPtr, LPRECT lprcView)
     TRACE("(lprcView=%p)\n", lprcView);
 
     if (!lprcView) return FALSE;
- 
-    LISTVIEW_GetOrigin(infoPtr, &ptOrigin);
-    LISTVIEW_GetAreaRect(infoPtr, lprcView); 
-    OffsetRect(lprcView, ptOrigin.x, ptOrigin.y); 
+
+    LISTVIEW_GetAreaRect(infoPtr, lprcView);
+
+    if ((infoPtr->dwStyle & LVS_TYPEMASK) != LVS_REPORT)
+    {
+        LISTVIEW_GetOrigin(infoPtr, &ptOrigin);
+        OffsetRect(lprcView, ptOrigin.x, ptOrigin.y);
+    }
 
     TRACE("lprcView=%s\n", wine_dbgstr_rect(lprcView));
 
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 39224da..13d8fde 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -2475,11 +2475,9 @@ static void test_getviewrect(void)
     r = SendMessage(hwnd, LVM_GETVIEWRECT, 0, (LPARAM)&rect);
     expect(TRUE, r);
     /* left is set to (2e31-1) - XP SP2 */
-todo_wine {
     expect(0, rect.right);
     expect(0, rect.top);
     expect(0, rect.bottom);
-}
 
     /* switch to LVS_ICON */
     SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~LVS_REPORT);
-- 
1.5.6.5







More information about the wine-patches mailing list