From 6b63fce757fc92d934dd23c3f8b9b05f8f5456f1 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 26 May 2009 02:25:05 +0400 Subject: [PATCH] comctl32/listview: 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 129f3cb08f4..f9b4983d866 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 39224da7b66..13d8fde6806 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);