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
b3a61c13
Commit
b3a61c13
authored
Jul 26, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/treeview: Properly initialize expanded image index.
parent
47d28ace
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
2 deletions
+72
-2
treeview.c
dlls/comctl32/tests/treeview.c
+70
-0
treeview.c
dlls/comctl32/treeview.c
+2
-2
No files found.
dlls/comctl32/tests/treeview.c
View file @
b3a61c13
...
...
@@ -30,6 +30,7 @@
#include "commctrl.h"
#include "wine/test.h"
#include "v6util.h"
#include "msg.h"
const
char
*
TEST_CALLBACK_TEXT
=
"callback_text"
;
...
...
@@ -1191,6 +1192,45 @@ static void test_rect_retrieval_after_expand_with_select(void) {
ok
(
ret
,
"TreeView_Select should return true
\n
"
);
}
static
void
test_expandedimage
(
void
)
{
TVITEMEX
item
;
HWND
hTree
;
BOOL
ret
;
hTree
=
create_treeview_control
();
fill_tree
(
hTree
);
item
.
mask
=
TVIF_EXPANDEDIMAGE
;
item
.
iExpandedImage
=
1
;
item
.
hItem
=
hRoot
;
ret
=
SendMessageA
(
hTree
,
TVM_SETITEM
,
0
,
(
LPARAM
)
&
item
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
item
.
mask
=
TVIF_EXPANDEDIMAGE
;
item
.
iExpandedImage
=
-
1
;
item
.
hItem
=
hRoot
;
ret
=
SendMessageA
(
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
item
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
if
(
item
.
iExpandedImage
!=
1
)
{
win_skip
(
"TVIF_EXPANDEDIMAGE not supported
\n
"
);
DestroyWindow
(
hTree
);
return
;
}
/* test for default iExpandedImage value */
item
.
mask
=
TVIF_EXPANDEDIMAGE
;
item
.
iExpandedImage
=
-
1
;
item
.
hItem
=
hChild
;
ret
=
SendMessageA
(
hTree
,
TVM_GETITEM
,
0
,
(
LPARAM
)
&
item
);
ok
(
ret
,
"got %d
\n
"
,
ret
);
ok
(
item
.
iExpandedImage
==
(
WORD
)
I_IMAGENONE
,
"got %d
\n
"
,
item
.
iExpandedImage
);
DestroyWindow
(
hTree
);
}
START_TEST
(
treeview
)
{
HMODULE
hComctl32
;
...
...
@@ -1198,6 +1238,10 @@ START_TEST(treeview)
WNDCLASSA
wc
;
MSG
msg
;
ULONG_PTR
ctx_cookie
;
HANDLE
hCtx
;
HWND
hwnd
;
hComctl32
=
GetModuleHandleA
(
"comctl32.dll"
);
pInitCommonControlsEx
=
(
void
*
)
GetProcAddress
(
hComctl32
,
"InitCommonControlsEx"
);
if
(
pInitCommonControlsEx
)
...
...
@@ -1253,6 +1297,32 @@ START_TEST(treeview)
test_expandnotify
();
test_rect_retrieval_after_expand_with_select
();
if
(
!
load_v6_module
(
&
ctx_cookie
,
&
hCtx
))
{
DestroyWindow
(
hMainWnd
);
return
;
}
/* this is a XP SP3 failure workaround */
hwnd
=
CreateWindowExA
(
0
,
WC_TREEVIEW
,
"foo"
,
WS_CHILD
|
WS_BORDER
|
WS_VISIBLE
,
0
,
0
,
100
,
100
,
hMainWnd
,
NULL
,
GetModuleHandleA
(
NULL
),
NULL
);
if
(
!
IsWindow
(
hwnd
))
{
win_skip
(
"FIXME: failed to create TreeView window.
\n
"
);
unload_v6_module
(
ctx_cookie
,
hCtx
);
DestroyWindow
(
hMainWnd
);
return
;
}
else
DestroyWindow
(
hwnd
);
/* comctl32 version 6 tests start here */
test_expandedimage
();
unload_v6_module
(
ctx_cookie
,
hCtx
);
PostMessageA
(
hMainWnd
,
WM_CLOSE
,
0
,
0
);
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
...
...
dlls/comctl32/treeview.c
View file @
b3a61c13
...
...
@@ -1005,7 +1005,7 @@ TREEVIEW_AllocateItem(const TREEVIEW_INFO *infoPtr)
* inc/dec to toggle the images. */
newItem
->
iImage
=
0
;
newItem
->
iSelectedImage
=
0
;
newItem
->
iExpandedImage
=
0
;
newItem
->
iExpandedImage
=
(
WORD
)
I_IMAGENONE
;
if
(
DPA_InsertPtr
(
infoPtr
->
items
,
INT_MAX
,
newItem
)
==
-
1
)
{
...
...
@@ -2575,7 +2575,7 @@ TREEVIEW_DrawItem(const TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem
/* The item is currently selected */
imageIndex
=
wineItem
->
iSelectedImage
;
}
else
if
((
wineItem
->
state
&
TVIS_EXPANDED
)
&&
(
wineItem
->
iExpandedImage
>=
0
))
else
if
((
wineItem
->
state
&
TVIS_EXPANDED
)
&&
(
wineItem
->
iExpandedImage
!=
(
WORD
)
I_IMAGENONE
))
{
/* The item is currently not selected but expanded */
imageIndex
=
wineItem
->
iExpandedImage
;
...
...
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