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
8cedea0d
Commit
8cedea0d
authored
Apr 13, 2012
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Apr 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Truncate the info tip text when using ANSI version messages.
parent
28f26c97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
tooltips.c
dlls/comctl32/tests/tooltips.c
+3
-3
tooltips.c
dlls/comctl32/tooltips.c
+7
-3
No files found.
dlls/comctl32/tests/tooltips.c
View file @
8cedea0d
...
...
@@ -668,7 +668,7 @@ static void test_longtextA(void)
toolinfoA
.
lpszText
=
bufA
;
SendMessageA
(
hwnd
,
TTM_ENUMTOOLSA
,
0
,
(
LPARAM
)
&
toolinfoA
);
textlen
=
lstrlenA
(
toolinfoA
.
lpszText
);
todo_wine
ok
(
textlen
==
80
,
"lpszText has %d chars
\n
"
,
textlen
);
ok
(
textlen
==
80
,
"lpszText has %d chars
\n
"
,
textlen
);
ok
(
toolinfoA
.
uId
==
0x1234ABCD
,
"uId should be retrieved, got %p
\n
"
,
(
void
*
)
toolinfoA
.
uId
);
...
...
@@ -678,7 +678,7 @@ static void test_longtextA(void)
toolinfoA
.
lpszText
=
bufA
;
SendMessageA
(
hwnd
,
TTM_GETTOOLINFOA
,
0
,
(
LPARAM
)
&
toolinfoA
);
textlen
=
lstrlenA
(
toolinfoA
.
lpszText
);
todo_wine
ok
(
textlen
==
80
,
"lpszText has %d chars
\n
"
,
textlen
);
ok
(
textlen
==
80
,
"lpszText has %d chars
\n
"
,
textlen
);
memset
(
bufA
,
0
,
sizeof
(
bufA
));
toolinfoA
.
hwnd
=
NULL
;
...
...
@@ -686,7 +686,7 @@ static void test_longtextA(void)
toolinfoA
.
lpszText
=
bufA
;
SendMessageA
(
hwnd
,
TTM_GETTEXTA
,
0
,
(
LPARAM
)
&
toolinfoA
);
textlen
=
lstrlenA
(
toolinfoA
.
lpszText
);
todo_wine
ok
(
textlen
==
80
,
"lpszText has %d chars
\n
"
,
textlen
);
ok
(
textlen
==
80
,
"lpszText has %d chars
\n
"
,
textlen
);
}
DestroyWindow
(
hwnd
);
...
...
dlls/comctl32/tooltips.c
View file @
8cedea0d
...
...
@@ -171,6 +171,8 @@ typedef struct
#define ICON_HEIGHT 16
#define ICON_WIDTH 16
#define MAX_TEXT_SIZE_A 80
/* maximum retriving text size by ANSI message */
static
LRESULT
CALLBACK
TOOLTIPS_SubclassProc
(
HWND
hwnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
,
UINT_PTR
uId
,
DWORD_PTR
dwRef
);
...
...
@@ -954,8 +956,9 @@ TOOLTIPS_CopyInfoT (const TTTOOL_INFO *toolPtr, TTTOOLINFOW *ti, BOOL isW)
else
if
(
isW
)
strcpyW
(
ti
->
lpszText
,
toolPtr
->
lpszText
);
else
/* ANSI version, the buffer is maximum 80 bytes without null. */
WideCharToMultiByte
(
CP_ACP
,
0
,
toolPtr
->
lpszText
,
-
1
,
(
LPSTR
)
ti
->
lpszText
,
INFOTIPSIZE
,
NULL
,
NULL
);
(
LPSTR
)
ti
->
lpszText
,
MAX_TEXT_SIZE_A
,
NULL
,
NULL
);
}
}
...
...
@@ -1341,12 +1344,13 @@ TOOLTIPS_GetTextT (const TOOLTIPS_INFO *infoPtr, TTTOOLINFOW *ti, BOOL isW)
/* NB this API is broken, there is no way for the app to determine
what size buffer it requires nor a way to specify how long the
one it supplies is. We'll assume it's up to INFOTIPSIZE */
one it supplies is. According to the test result, it's up to
80 bytes by the ANSI version. */
buffer
[
0
]
=
'\0'
;
TOOLTIPS_GetTipText
(
infoPtr
,
nTool
,
buffer
);
WideCharToMultiByte
(
CP_ACP
,
0
,
buffer
,
-
1
,
(
LPSTR
)
ti
->
lpszText
,
INFOTIPSIZE
,
NULL
,
NULL
);
MAX_TEXT_SIZE_A
,
NULL
,
NULL
);
}
return
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