[PATCH 2/2] comctl32: Fix LVM_APPROXIMATEVIEWRECT in LVS_REPORT mode.
Vadim Druzhin
cdslow at mail.ru
Thu Oct 12 10:02:23 CDT 2017
Patch for LV_VIEW_DETAILS branch in LISTVIEW_ApproximateViewRect().
Fixes NTPWEdit (http://cdslow.org.ru/en/ntpwedit/index.html).
Signed-off-by: Vadim Druzhin <cdslow at mail.ru>
---
dlls/comctl32/listview.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 3587797..dc7bfe2 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -5360,15 +5360,13 @@ static DWORD LISTVIEW_ApproximateViewRect(const LISTVIEW_INFO *infoPtr, INT nIte
{
LISTVIEW_GetItemBox(infoPtr, 0, &rcBox);
wWidth = rcBox.right - rcBox.left;
- wHeight = (rcBox.bottom - rcBox.top) * nItemCount;
+ wHeight = rcBox.top + (rcBox.bottom - rcBox.top) * nItemCount;
}
else
{
- /* use current height and width */
- if (wHeight == 0xffff)
- wHeight = infoPtr->rcList.bottom - infoPtr->rcList.top;
- if (wWidth == 0xffff)
- wWidth = infoPtr->rcList.right - infoPtr->rcList.left;
+ /* No real items, use approximation */
+ wWidth = infoPtr->nItemWidth;
+ wHeight = infoPtr->rcList.top + infoPtr->nItemHeight * nItemCount;
}
dwViewRect = MAKELONG(wWidth, wHeight);
--
2.5.5
More information about the wine-patches
mailing list