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
39ec6e48
Commit
39ec6e48
authored
Apr 11, 2000
by
Serge Ivanov
Committed by
Alexandre Julliard
Apr 11, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TreeView - minor bugfix and optimization:
- GetDC call moved down to avoid possible resource leak. - Invariant code is moved out of loop.
parent
40cd8463
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
treeview.c
dlls/comctl32/treeview.c
+21
-21
No files found.
dlls/comctl32/treeview.c
View file @
39ec6e48
...
...
@@ -1055,7 +1055,7 @@ TREEVIEW_Refresh (HWND hwnd, HDC hdc)
TEXTMETRICA
tm
;
HBRUSH
hbrBk
;
RECT
rect
;
INT
iItem
,
indent
,
x
,
y
,
cx
,
height
,
itemHeight
;
INT
iItem
,
indent
,
x
,
y
,
height
,
itemHeight
;
INT
viewtop
,
viewbottom
,
viewleft
,
viewright
;
TREEVIEW_ITEM
*
wineItem
,
*
prevItem
;
...
...
@@ -1070,48 +1070,49 @@ TREEVIEW_Refresh (HWND hwnd, HDC hdc)
GetClientRect
(
hwnd
,
&
rect
);
if
((
rect
.
left
-
rect
.
right
==
0
)
||
(
rect
.
top
-
rect
.
bottom
==
0
))
return
;
hdc
=
GetDC
(
hwnd
);
infoPtr
->
cdmode
=
TREEVIEW_SendCustomDrawNotify
(
hwnd
,
CDDS_PREPAINT
,
hdc
,
rect
);
infoPtr
->
cdmode
=
TREEVIEW_SendCustomDrawNotify
(
hwnd
,
CDDS_PREPAINT
,
hdc
,
rect
);
if
(
infoPtr
->
cdmode
==
CDRF_SKIPDEFAULT
)
return
;
if
(
infoPtr
->
cdmode
==
CDRF_SKIPDEFAULT
)
return
;
infoPtr
->
uVisibleHeight
=
rect
.
bottom
-
rect
.
top
;
infoPtr
->
uVisibleWidth
=
rect
.
right
-
rect
.
left
;
infoPtr
->
uVisibleHeight
=
rect
.
bottom
-
rect
.
top
;
infoPtr
->
uVisibleWidth
=
rect
.
right
-
rect
.
left
;
viewtop
=
infoPtr
->
cy
;
viewbottom
=
infoPtr
->
cy
+
rect
.
bottom
-
rect
.
top
;
viewleft
=
infoPtr
->
cx
;
viewright
=
infoPtr
->
cx
+
rect
.
right
-
rect
.
left
;
TRACE
(
"[%d %d %d %d]
\n
"
,
viewtop
,
viewbottom
,
viewleft
,
viewright
);
/* draw background */
hbrBk
=
CreateSolidBrush
(
infoPtr
->
clrBk
);
FillRect
(
hdc
,
&
rect
,
hbrBk
);
DeleteObject
(
hbrBk
);
ImageList_GetIconSize
(
infoPtr
->
himlNormal
,
&
x
,
&
itemHeight
);
if
(
infoPtr
->
uItemHeight
>
itemHeight
)
itemHeight
=
infoPtr
->
uItemHeight
;
GetTextMetricsA
(
hdc
,
&
tm
);
if
((
tm
.
tmHeight
+
tm
.
tmExternalLeading
)
>
itemHeight
)
itemHeight
=
tm
.
tmHeight
+
tm
.
tmExternalLeading
;
infoPtr
->
uRealItemHeight
=
itemHeight
;
iItem
=
(
INT
)
infoPtr
->
TopRootItem
;
infoPtr
->
firstVisible
=
0
;
wineItem
=
NULL
;
indent
=
0
;
x
=
y
=
0
;
TRACE
(
"[%d %d %d %d]
\n
"
,
viewtop
,
viewbottom
,
viewleft
,
viewright
);
while
(
iItem
)
{
prevItem
=
wineItem
;
prevItem
=
wineItem
;
wineItem
=
&
infoPtr
->
items
[
iItem
];
wineItem
->
iLevel
=
indent
;
ImageList_GetIconSize
(
infoPtr
->
himlNormal
,
&
cx
,
&
itemHeight
);
if
(
infoPtr
->
uItemHeight
>
itemHeight
)
itemHeight
=
infoPtr
->
uItemHeight
;
GetTextMetricsA
(
hdc
,
&
tm
);
if
((
tm
.
tmHeight
+
tm
.
tmExternalLeading
)
>
itemHeight
)
itemHeight
=
tm
.
tmHeight
+
tm
.
tmExternalLeading
;
infoPtr
->
uRealItemHeight
=
itemHeight
;
wineItem
->
iLevel
=
indent
;
/* FIXME: remove this in later stage */
/*
...
...
@@ -1161,7 +1162,6 @@ TREEVIEW_Refresh (HWND hwnd, HDC hdc)
while
((
!
iItem
)
&&
(
indent
>
0
))
{
indent
--
;
x
-=
infoPtr
->
uIndent
;
prevItem
=
wineItem
;
wineItem
=&
infoPtr
->
items
[(
INT
)
wineItem
->
parent
];
iItem
=
(
INT
)
wineItem
->
sibling
;
}
...
...
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