From 2a32ce744c43cfaf664e998d0604eaff5933df48 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 26 May 2009 04:04:36 +0400 Subject: [PATCH] comctl32/listview: Improve item position calculating in LVS_REPORT. --- dlls/comctl32/listview.c | 5 ++++- dlls/comctl32/tests/listview.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index f9b4983d866..79ac0e3254d 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -1920,7 +1920,10 @@ static void LISTVIEW_GetItemOrigin(const LISTVIEW_INFO *infoPtr, INT nItem, LPPO } else /* LVS_REPORT */ { - lpptPosition->x = 0; + lpptPosition->x = REPORT_MARGINX; + /* item is always at zero indexed column */ + if (DPA_GetPtrCount(infoPtr->hdpaColumns) > 0) + lpptPosition->x += LISTVIEW_GetColumnInfo(infoPtr, 0)->rcHeader.left; lpptPosition->y = nItem * infoPtr->nItemHeight; } } diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 1a1ae0664b2..47477a44a31 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -2538,7 +2538,7 @@ static void test_getitemposition(void) memset(&rect, 0, sizeof(rect)); SendMessage(header, HDM_GETITEMRECT, 0, (LPARAM)&rect); /* some padding? */ - todo_wine expect(2, pt.x); + expect(2, pt.x); /* offset by header height */ expect(rect.bottom - rect.top, pt.y);