Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
61c8a305
Commit
61c8a305
authored
May 24, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 24, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Fix vertical position offset for subitem rectangle.
parent
3f1d3e0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
14 deletions
+49
-14
listview.c
dlls/comctl32/listview.c
+6
-4
listview.c
dlls/comctl32/tests/listview.c
+43
-10
No files found.
dlls/comctl32/listview.c
View file @
61c8a305
...
...
@@ -6953,7 +6953,7 @@ static BOOL LISTVIEW_GetItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPRECT
*/
static
BOOL
LISTVIEW_GetSubItemRect
(
const
LISTVIEW_INFO
*
infoPtr
,
INT
nItem
,
LPRECT
lprc
)
{
POINT
Position
;
POINT
Position
,
Origin
;
LVITEMW
lvItem
;
INT
nColumn
;
...
...
@@ -6986,7 +6986,8 @@ static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPR
}
}
LISTVIEW_GetOrigin
(
infoPtr
,
&
Position
);
if
(
!
LISTVIEW_GetItemPosition
(
infoPtr
,
nItem
,
&
Position
))
return
FALSE
;
LISTVIEW_GetOrigin
(
infoPtr
,
&
Origin
);
if
(
nColumn
<
0
||
nColumn
>=
DPA_GetPtrCount
(
infoPtr
->
hdpaColumns
))
return
FALSE
;
...
...
@@ -6994,7 +6995,6 @@ static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPR
lvItem
.
iItem
=
nItem
;
lvItem
.
iSubItem
=
nColumn
;
if
(
lvItem
.
mask
&&
!
LISTVIEW_GetItemW
(
infoPtr
,
&
lvItem
))
return
FALSE
;
switch
(
lprc
->
left
)
{
case
LVIR_ICON
:
...
...
@@ -7011,7 +7011,9 @@ static BOOL LISTVIEW_GetSubItemRect(const LISTVIEW_INFO *infoPtr, INT nItem, LPR
return
FALSE
;
}
OffsetRect
(
lprc
,
Position
.
x
,
Position
.
y
);
OffsetRect
(
lprc
,
Origin
.
x
,
Position
.
y
);
TRACE
(
"return rect %s
\n
"
,
wine_dbgstr_rect
(
lprc
));
return
TRUE
;
}
...
...
dlls/comctl32/tests/listview.c
View file @
61c8a305
...
...
@@ -2089,7 +2089,7 @@ static void test_subitem_rect(void)
HWND
hwnd
;
DWORD
r
;
LVCOLUMN
col
;
RECT
rect
;
RECT
rect
,
rect2
;
INT
arr
[
3
];
/* test LVM_GETSUBITEMRECT for header */
...
...
@@ -2099,15 +2099,12 @@ static void test_subitem_rect(void)
memset
(
&
col
,
0
,
sizeof
(
LVCOLUMN
));
col
.
mask
=
LVCF_WIDTH
;
col
.
cx
=
100
;
r
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_INSERTCOLUMN
,
0
,
(
LPARAM
)
&
col
);
expect
(
0
,
r
);
col
.
cx
=
150
;
r
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_INSERTCOLUMN
,
1
,
(
LPARAM
)
&
col
);
expect
(
1
,
r
);
col
.
cx
=
200
;
r
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_INSERTCOLUMN
,
2
,
(
LPARAM
)
&
col
);
expect
(
2
,
r
);
/* item = -1 means header, subitem index is 1 based */
...
...
@@ -2189,21 +2186,45 @@ todo_wine
col
.
mask
=
LVCF_WIDTH
;
col
.
cx
=
100
;
r
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_INSERTCOLUMN
,
0
,
(
LPARAM
)
&
col
);
expect
(
0
,
r
);
col
.
cx
=
200
;
r
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_INSERTCOLUMN
,
1
,
(
LPARAM
)
&
col
);
expect
(
1
,
r
);
col
.
cx
=
300
;
r
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_INSERTCOLUMN
,
2
,
(
LPARAM
)
&
col
);
expect
(
2
,
r
);
insert_item
(
hwnd
,
0
);
insert_item
(
hwnd
,
1
);
/* wrong item is refused for main item */
rect
.
left
=
LVIR_BOUNDS
;
rect
.
top
=
0
;
rect
.
right
=
rect
.
bottom
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_GETSUBITEMRECT
,
2
,
(
LPARAM
)
&
rect
);
ok
(
r
==
FALSE
,
"got %d
\n
"
,
r
);
/* for subitems rectangle is calculated even if there's no item added */
rect
.
left
=
LVIR_BOUNDS
;
rect
.
top
=
1
;
rect
.
right
=
rect
.
bottom
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_GETSUBITEMRECT
,
1
,
(
LPARAM
)
&
rect
);
ok
(
r
==
TRUE
,
"got %d
\n
"
,
r
);
rect2
.
left
=
LVIR_BOUNDS
;
rect2
.
top
=
1
;
rect2
.
right
=
rect2
.
bottom
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_GETSUBITEMRECT
,
2
,
(
LPARAM
)
&
rect2
);
todo_wine
{
ok
(
r
==
TRUE
,
"got %d
\n
"
,
r
);
expect
(
rect
.
right
,
rect2
.
right
);
expect
(
rect
.
left
,
rect2
.
left
);
expect
(
rect
.
bottom
,
rect2
.
top
);
ok
(
rect2
.
bottom
>
rect2
.
top
,
"expected not zero height
\n
"
);
}
arr
[
0
]
=
1
;
arr
[
1
]
=
0
;
arr
[
2
]
=
2
;
r
=
SendMessage
(
hwnd
,
LVM_SETCOLUMNORDERARRAY
,
3
,
(
LPARAM
)
arr
);
...
...
@@ -2213,7 +2234,7 @@ todo_wine
rect
.
top
=
0
;
rect
.
right
=
rect
.
bottom
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_GETSUBITEMRECT
,
0
,
(
LPARAM
)
&
rect
);
ok
(
r
!=
0
,
"Expected not-null LRESULT
\n
"
);
ok
(
r
==
TRUE
,
"got %d
\n
"
,
r
);
expect
(
0
,
rect
.
left
);
expect
(
600
,
rect
.
right
);
...
...
@@ -2221,15 +2242,27 @@ todo_wine
rect
.
top
=
1
;
rect
.
right
=
rect
.
bottom
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_GETSUBITEMRECT
,
0
,
(
LPARAM
)
&
rect
);
ok
(
r
!=
0
,
"Expected not-null LRESULT
\n
"
);
ok
(
r
==
TRUE
,
"got %d
\n
"
,
r
);
expect
(
0
,
rect
.
left
);
expect
(
200
,
rect
.
right
);
rect2
.
left
=
LVIR_BOUNDS
;
rect2
.
top
=
1
;
rect2
.
right
=
rect2
.
bottom
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_GETSUBITEMRECT
,
1
,
(
LPARAM
)
&
rect2
);
ok
(
r
==
TRUE
,
"got %d
\n
"
,
r
);
expect
(
0
,
rect2
.
left
);
expect
(
200
,
rect2
.
right
);
/* items are of the same height */
ok
(
rect2
.
top
>
0
,
"expected positive item height
\n
"
);
expect
(
rect
.
bottom
,
rect2
.
top
);
expect
(
rect
.
bottom
*
2
-
rect
.
top
,
rect2
.
bottom
);
rect
.
left
=
LVIR_BOUNDS
;
rect
.
top
=
2
;
rect
.
right
=
rect
.
bottom
=
-
1
;
r
=
SendMessage
(
hwnd
,
LVM_GETSUBITEMRECT
,
0
,
(
LPARAM
)
&
rect
);
ok
(
r
!=
0
,
"Expected not-null LRESULT
\n
"
);
ok
(
r
==
TRUE
,
"got %d
\n
"
,
r
);
expect
(
300
,
rect
.
left
);
expect
(
600
,
rect
.
right
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment