Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
91fbef88
Commit
91fbef88
authored
Jan 29, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 30, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Never release state image list.
parent
0a23797f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
16 deletions
+25
-16
treeview.c
dlls/comctl32/tests/treeview.c
+25
-2
treeview.c
dlls/comctl32/treeview.c
+0
-14
No files found.
dlls/comctl32/tests/treeview.c
View file @
91fbef88
...
...
@@ -1607,9 +1607,9 @@ static void test_htreeitem_layout(void)
static
void
test_TVS_CHECKBOXES
(
void
)
{
HIMAGELIST
himl
;
HIMAGELIST
himl
,
himl2
;
HWND
hTree
,
hTree2
;
TVITEMA
item
;
HWND
hTree
;
DWORD
ret
;
hTree
=
create_treeview_control
(
0
);
...
...
@@ -1639,6 +1639,10 @@ static void test_TVS_CHECKBOXES(void)
himl
=
(
HIMAGELIST
)
SendMessageA
(
hTree
,
TVM_GETIMAGELIST
,
TVSIL_STATE
,
0
);
ok
(
himl
!=
NULL
,
"got %p
\n
"
,
himl
);
himl2
=
(
HIMAGELIST
)
SendMessageA
(
hTree
,
TVM_GETIMAGELIST
,
TVSIL_STATE
,
0
);
ok
(
himl2
!=
NULL
,
"got %p
\n
"
,
himl2
);
ok
(
himl2
==
himl
,
"got %p, expected %p
\n
"
,
himl2
,
himl
);
item
.
hItem
=
hRoot
;
item
.
mask
=
TVIF_STATE
;
item
.
state
=
0
;
...
...
@@ -1655,6 +1659,25 @@ static void test_TVS_CHECKBOXES(void)
expect
(
TRUE
,
ret
);
ok
(
item
.
state
==
INDEXTOSTATEIMAGEMASK
(
1
),
"got 0x%x
\n
"
,
item
.
state
);
/* create another control and check its checkbox list */
hTree2
=
create_treeview_control
(
0
);
fill_tree
(
hTree2
);
/* set some index for a child */
item
.
hItem
=
hChild
;
item
.
mask
=
TVIF_STATE
;
item
.
state
=
INDEXTOSTATEIMAGEMASK
(
4
);
item
.
stateMask
=
TVIS_STATEIMAGEMASK
;
ret
=
SendMessageA
(
hTree2
,
TVM_SETITEMA
,
0
,
(
LPARAM
)
&
item
);
expect
(
TRUE
,
ret
);
/* enabling check boxes set all items to 1 state image index */
SetWindowLongA
(
hTree2
,
GWL_STYLE
,
GetWindowLongA
(
hTree
,
GWL_STYLE
)
|
TVS_CHECKBOXES
);
himl2
=
(
HIMAGELIST
)
SendMessageA
(
hTree2
,
TVM_GETIMAGELIST
,
TVSIL_STATE
,
0
);
ok
(
himl2
!=
NULL
,
"got %p
\n
"
,
himl2
);
ok
(
himl
!=
himl2
,
"got %p, expected %p
\n
"
,
himl2
,
himl
);
DestroyWindow
(
hTree2
);
DestroyWindow
(
hTree
);
/* the same, but initially created with TVS_CHECKBOXES */
...
...
dlls/comctl32/treeview.c
View file @
91fbef88
...
...
@@ -66,14 +66,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
treeview
);
enum
StateListType
{
OriginInternal
,
OriginUser
};
/* internal structures */
typedef
struct
_TREEITEM
/* HTREEITEM is a _TREEINFO *. */
{
HTREEITEM
parent
;
/* handle to parent or 0 if at root */
...
...
@@ -162,7 +155,6 @@ typedef struct tagTREEVIEW_INFO
HIMAGELIST
himlState
;
int
stateImageHeight
;
int
stateImageWidth
;
enum
StateListType
statehimlType
;
HDPA
items
;
DWORD
lastKeyPressTimestamp
;
...
...
@@ -1793,11 +1785,8 @@ TREEVIEW_SetImageList(TREEVIEW_INFO *infoPtr, UINT type, HIMAGELIST himlNew)
infoPtr
->
himlState
=
himlNew
;
if
(
himlNew
)
{
ImageList_GetIconSize
(
himlNew
,
&
infoPtr
->
stateImageWidth
,
&
infoPtr
->
stateImageHeight
);
infoPtr
->
statehimlType
=
OriginUser
;
}
else
{
infoPtr
->
stateImageWidth
=
0
;
...
...
@@ -4970,7 +4959,6 @@ TREEVIEW_InitCheckboxes(TREEVIEW_INFO *infoPtr)
int
nIndex
;
infoPtr
->
himlState
=
ImageList_Create
(
16
,
16
,
ILC_COLOR
|
ILC_MASK
,
3
,
0
);
infoPtr
->
statehimlType
=
OriginInternal
;
hdcScreen
=
GetDC
(
0
);
...
...
@@ -5134,8 +5122,6 @@ TREEVIEW_Destroy(TREEVIEW_INFO *infoPtr)
CloseThemeData
(
GetWindowTheme
(
infoPtr
->
hwnd
));
if
(
infoPtr
->
statehimlType
==
OriginInternal
)
ImageList_Destroy
(
infoPtr
->
himlState
);
/* Deassociate treeview from the window before doing anything drastic. */
SetWindowLongPtrW
(
infoPtr
->
hwnd
,
0
,
0
);
...
...
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