From: Jacob Czekalla jczekalla@codeweavers.com
During painting for an LVS_REPORT listview the cached header rects should be refreshed. Listview columns can be reorderd through the header which was not accounted for.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57594 --- dlls/comctl32/listview.c | 6 ++++-- dlls/comctl32/tests/listview.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 31f8a933e56..86c60a2b2ae 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -5015,10 +5015,12 @@ static void LISTVIEW_RefreshReport(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, /* narrow down the columns we need to paint */ for(col = 0; col < DPA_GetPtrCount(infoPtr->hdpaColumns); col++) { + COLUMN_INFO* col_info; INT index = SendMessageW(infoPtr->hwndHeader, HDM_ORDERTOINDEX, col, 0);
- LISTVIEW_GetHeaderRect(infoPtr, index, &rcItem); - if ((rcItem.right + Origin.x >= rcClip.left) && (rcItem.left + Origin.x < rcClip.right)) + col_info = DPA_GetPtr(infoPtr->hdpaColumns, index); + SendMessageW(infoPtr->hwndHeader, HDM_GETITEMRECT, index, (LPARAM)&col_info->rcHeader); + if ((col_info->rcHeader.right + Origin.x >= rcClip.left) && (col_info->rcHeader.left + Origin.x < rcClip.right)) ranges_additem(colRanges, index); } iterator_rangesitems(&j, colRanges); diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 8487394b1e8..4c08838ffd8 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -7549,7 +7549,7 @@ static void test_column_rect_caching(void)
InvalidateRect(listview, NULL, FALSE); flush_events(); - ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_invalidate_rect, "column order caching in refresh", TRUE); + ok_sequence(sequences, LISTVIEW_SEQ_INDEX, listview_invalidate_rect, "column order caching in refresh", FALSE);
DestroyWindow(listview); }