Nikolay Sivov : comctl32/listview: LVM_GETITEMRECT: don' t offset to item position on LVS_REPORT querying LVIR_BOUNDS.
Alexandre Julliard
julliard at winehq.org
Wed May 27 09:26:51 CDT 2009
Module: wine
Branch: master
Commit: 1a84ca42b2c001883eb9819d684ae0ae53430000
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1a84ca42b2c001883eb9819d684ae0ae53430000
Author: Nikolay Sivov <bunglehead at gmail.com>
Date: Tue May 26 23:04:50 2009 +0400
comctl32/listview: LVM_GETITEMRECT: don't offset to item position on LVS_REPORT querying LVIR_BOUNDS.
---
dlls/comctl32/listview.c | 7 ++++++-
dlls/comctl32/tests/listview.c | 13 +++++--------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 79ac0e3..0c53bc3 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -5928,6 +5928,7 @@ static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT
BOOL doLabel = TRUE, oversizedBox = FALSE;
POINT Position, Origin;
LVITEMW lvItem;
+ INT type;
TRACE("(hwnd=%p, nItem=%d, lprc=%p)\n", infoPtr->hwndSelf, nItem, lprc);
@@ -5962,6 +5963,7 @@ static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT
lvItem.state = (oversizedBox ? LVIS_FOCUSED : 0);
}
+ type = lprc->left;
if (uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) && lprc->left == LVIR_SELECTBOUNDS)
lprc->left = LVIR_BOUNDS;
switch(lprc->left)
@@ -5987,7 +5989,10 @@ static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT
return FALSE;
}
- OffsetRect(lprc, Position.x + Origin.x, Position.y + Origin.y);
+ if ((uView == LVS_REPORT) && (type == LVIR_BOUNDS))
+ OffsetRect(lprc, Origin.x, Origin.y);
+ else
+ OffsetRect(lprc, Position.x + Origin.x, Position.y + Origin.y);
TRACE(" rect=%s\n", wine_dbgstr_rect(lprc));
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 3f499f6..793717c 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -2590,11 +2590,9 @@ static void test_getitemrect(void)
r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect);
expect(TRUE, r);
- /* zero width rectangle */
-todo_wine {
+ /* zero width rectangle with no padding */
expect(0, rect.left);
- expect(0, rect.right);
-}
+ todo_wine expect(0, rect.right);
insert_column(hwnd, 0);
insert_column(hwnd, 1);
@@ -2615,9 +2613,8 @@ todo_wine {
expect(TRUE, r);
/* still no left padding */
-todo_wine {
expect(0, rect.left);
-}
+ expect(150, rect.right);
rect.left = LVIR_SELECTBOUNDS;
rect.right = rect.top = rect.bottom = -1;
@@ -2640,9 +2637,9 @@ todo_wine {
rect.right = rect.top = rect.bottom = -1;
r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM)&rect);
expect(TRUE, r);
- todo_wine expect(0, rect.left);
+ expect(0, rect.left);
/* just width sum */
- todo_wine expect(150, rect.right);
+ expect(150, rect.right);
rect.left = LVIR_SELECTBOUNDS;
rect.right = rect.top = rect.bottom = -1;
More information about the wine-cvs
mailing list