Module: wine Branch: master Commit: 6b63fce757fc92d934dd23c3f8b9b05f8f5456f1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6b63fce757fc92d934dd23c3f8...
Author: Nikolay Sivov bunglehead@gmail.com Date: Tue May 26 02:25:05 2009 +0400
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 129f3cb..f9b4983 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);