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
9d897b73
Commit
9d897b73
authored
Feb 13, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/button: Use the global memory allocation helpers.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
65f23a74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
button.c
dlls/comctl32/button.c
+8
-7
No files found.
dlls/comctl32/button.c
View file @
9d897b73
...
...
@@ -67,6 +67,7 @@
#include "uxtheme.h"
#include "vssym32.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "comctl32.h"
...
...
@@ -224,7 +225,7 @@ static inline void paint_button( HWND hwnd, LONG style, UINT action )
static
inline
WCHAR
*
get_button_text
(
HWND
hwnd
)
{
INT
len
=
GetWindowTextLengthW
(
hwnd
);
WCHAR
*
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
WCHAR
*
buffer
=
heap_alloc
(
(
len
+
1
)
*
sizeof
(
WCHAR
)
);
if
(
buffer
)
GetWindowTextW
(
hwnd
,
buffer
,
len
+
1
);
return
buffer
;
...
...
@@ -732,14 +733,14 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc)
if
(
!
(
text
=
get_button_text
(
hwnd
)))
goto
empty_rect
;
if
(
!
text
[
0
])
{
HeapFree
(
GetProcessHeap
(),
0
,
text
);
heap_free
(
text
);
goto
empty_rect
;
}
if
((
hFont
=
get_button_font
(
hwnd
)))
hPrevFont
=
SelectObject
(
hdc
,
hFont
);
DrawTextW
(
hdc
,
text
,
-
1
,
&
r
,
dtStyle
|
DT_CALCRECT
);
if
(
hPrevFont
)
SelectObject
(
hdc
,
hPrevFont
);
HeapFree
(
GetProcessHeap
(),
0
,
text
);
heap_free
(
text
);
break
;
}
...
...
@@ -873,7 +874,7 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, const RECT *rc)
DrawStateW
(
hdc
,
hbr
,
lpOutputProc
,
lp
,
wp
,
rc
->
left
,
rc
->
top
,
rc
->
right
-
rc
->
left
,
rc
->
bottom
-
rc
->
top
,
flags
);
HeapFree
(
GetProcessHeap
(),
0
,
text
);
heap_free
(
text
);
}
/**********************************************************************
...
...
@@ -1278,7 +1279,7 @@ static void PB_ThemedPaint(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawSta
if
(
text
)
{
DrawThemeText
(
theme
,
hDC
,
BP_PUSHBUTTON
,
state
,
text
,
lstrlenW
(
text
),
dtFlags
,
0
,
&
textRect
);
HeapFree
(
GetProcessHeap
(),
0
,
text
);
heap_free
(
text
);
}
if
(
focused
)
...
...
@@ -1378,7 +1379,7 @@ static void CB_ThemedPaint(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawSta
DrawFocusRect
(
hDC
,
&
focusRect
);
}
HeapFree
(
GetProcessHeap
(),
0
,
text
);
heap_free
(
text
);
}
if
(
created_font
)
DeleteObject
(
font
);
...
...
@@ -1438,7 +1439,7 @@ static void GB_ThemedPaint(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawSta
{
InflateRect
(
&
textRect
,
-
2
,
0
);
DrawThemeText
(
theme
,
hDC
,
BP_GROUPBOX
,
state
,
text
,
lstrlenW
(
text
),
0
,
0
,
&
textRect
);
HeapFree
(
GetProcessHeap
(),
0
,
text
);
heap_free
(
text
);
}
if
(
created_font
)
DeleteObject
(
font
);
...
...
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