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
542652de
Commit
542652de
authored
Nov 29, 2013
by
Francois Gouget
Committed by
Alexandre Julliard
Dec 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: TTM_ADDTOOLW must refuse to set a tooltip text to NULL.
parent
202d046d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
23 deletions
+32
-23
status.c
dlls/comctl32/status.c
+2
-0
tooltips.c
dlls/comctl32/tests/tooltips.c
+1
-1
tooltips.c
dlls/comctl32/tooltips.c
+26
-21
trackbar.c
dlls/comctl32/trackbar.c
+3
-1
No files found.
dlls/comctl32/status.c
View file @
542652de
...
...
@@ -700,10 +700,12 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
if
(
infoPtr
->
hwndToolTip
)
{
INT
nTipCount
;
TTTOOLINFOW
ti
;
WCHAR
wEmpty
=
0
;
ZeroMemory
(
&
ti
,
sizeof
(
TTTOOLINFOW
));
ti
.
cbSize
=
sizeof
(
TTTOOLINFOW
);
ti
.
hwnd
=
infoPtr
->
Self
;
ti
.
lpszText
=
&
wEmpty
;
nTipCount
=
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_GETTOOLCOUNT
,
0
,
0
);
if
(
nTipCount
<
infoPtr
->
numParts
)
{
...
...
dlls/comctl32/tests/tooltips.c
View file @
542652de
...
...
@@ -420,7 +420,7 @@ static void test_gettext(void)
toolinfoW
.
lParam
=
0xdeadbeef
;
GetClientRect
(
hwnd
,
&
toolinfoW
.
rect
);
r
=
SendMessageW
(
hwnd
,
TTM_ADDTOOLW
,
0
,
(
LPARAM
)
&
toolinfoW
);
todo_wine
ok
(
!
r
,
"Adding the tool to the tooltip failed
\n
"
);
ok
(
!
r
,
"Adding the tool to the tooltip succeeded!
\n
"
);
if
(
0
)
/* crashes on NT4 */
{
...
...
dlls/comctl32/tooltips.c
View file @
542652de
...
...
@@ -1037,6 +1037,9 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
infoPtr
->
hwndSelf
,
ti
->
hwnd
,
ti
->
uId
,
(
ti
->
uFlags
&
TTF_IDISHWND
)
?
" TTF_IDISHWND"
:
""
);
if
(
ti
->
cbSize
>=
TTTOOLINFOW_V2_SIZE
&&
!
ti
->
lpszText
&&
isW
)
return
FALSE
;
if
(
infoPtr
->
uNumTools
==
0
)
{
infoPtr
->
tools
=
Alloc
(
sizeof
(
TTTOOL_INFO
));
toolPtr
=
infoPtr
->
tools
;
...
...
@@ -1060,27 +1063,29 @@ TOOLTIPS_AddToolT (TOOLTIPS_INFO *infoPtr, const TTTOOLINFOW *ti, BOOL isW)
toolPtr
->
rect
=
ti
->
rect
;
toolPtr
->
hinst
=
ti
->
hinst
;
if
(
IS_INTRESOURCE
(
ti
->
lpszText
))
{
TRACE
(
"add string id %x
\n
"
,
LOWORD
(
ti
->
lpszText
));
toolPtr
->
lpszText
=
ti
->
lpszText
;
}
else
if
(
ti
->
lpszText
)
{
if
(
TOOLTIPS_IsCallbackString
(
ti
->
lpszText
,
isW
))
{
TRACE
(
"add CALLBACK!
\n
"
);
toolPtr
->
lpszText
=
LPSTR_TEXTCALLBACKW
;
}
else
if
(
isW
)
{
INT
len
=
lstrlenW
(
ti
->
lpszText
);
TRACE
(
"add text %s!
\n
"
,
debugstr_w
(
ti
->
lpszText
));
toolPtr
->
lpszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
toolPtr
->
lpszText
,
ti
->
lpszText
);
}
else
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPSTR
)
ti
->
lpszText
,
-
1
,
NULL
,
0
);
TRACE
(
"add text
\"
%s
\"
!
\n
"
,
(
LPSTR
)
ti
->
lpszText
);
toolPtr
->
lpszText
=
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPSTR
)
ti
->
lpszText
,
-
1
,
toolPtr
->
lpszText
,
len
);
}
if
(
ti
->
cbSize
>=
TTTOOLINFOW_V1_SIZE
)
{
if
(
IS_INTRESOURCE
(
ti
->
lpszText
))
{
TRACE
(
"add string id %x
\n
"
,
LOWORD
(
ti
->
lpszText
));
toolPtr
->
lpszText
=
ti
->
lpszText
;
}
else
if
(
ti
->
lpszText
)
{
if
(
TOOLTIPS_IsCallbackString
(
ti
->
lpszText
,
isW
))
{
TRACE
(
"add CALLBACK!
\n
"
);
toolPtr
->
lpszText
=
LPSTR_TEXTCALLBACKW
;
}
else
if
(
isW
)
{
INT
len
=
lstrlenW
(
ti
->
lpszText
);
TRACE
(
"add text %s!
\n
"
,
debugstr_w
(
ti
->
lpszText
));
toolPtr
->
lpszText
=
Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
toolPtr
->
lpszText
,
ti
->
lpszText
);
}
else
{
INT
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPSTR
)
ti
->
lpszText
,
-
1
,
NULL
,
0
);
TRACE
(
"add text
\"
%s
\"
!
\n
"
,
(
LPSTR
)
ti
->
lpszText
);
toolPtr
->
lpszText
=
Alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
(
LPSTR
)
ti
->
lpszText
,
-
1
,
toolPtr
->
lpszText
,
len
);
}
}
}
if
(
ti
->
cbSize
>=
TTTOOLINFOW_V2_SIZE
)
...
...
dlls/comctl32/trackbar.c
View file @
542652de
...
...
@@ -1525,11 +1525,13 @@ TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
hwnd
,
0
,
0
,
0
);
if
(
infoPtr
->
hwndToolTip
)
{
TTTOOLINFOW
ti
;
TTTOOLINFOW
ti
;
WCHAR
wEmpty
=
0
;
ZeroMemory
(
&
ti
,
sizeof
(
ti
));
ti
.
cbSize
=
sizeof
(
ti
);
ti
.
uFlags
=
TTF_IDISHWND
|
TTF_TRACK
|
TTF_ABSOLUTE
;
ti
.
hwnd
=
hwnd
;
ti
.
lpszText
=
&
wEmpty
;
SendMessageW
(
infoPtr
->
hwndToolTip
,
TTM_ADDTOOLW
,
0
,
(
LPARAM
)
&
ti
);
}
...
...
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