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
f25317a6
Commit
f25317a6
authored
Jun 13, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Ensure at least one character is used in TEXT_WordBreak().
parent
8d23f13b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
text.c
dlls/user32/tests/text.c
+8
-0
text.c
dlls/user32/text.c
+3
-2
No files found.
dlls/user32/tests/text.c
View file @
f25317a6
...
...
@@ -564,6 +564,10 @@ static void test_DrawTextCalcRect(void)
textheight
=
DrawTextA
(
hdc
,
wordbreak_text
,
-
1
,
&
rect
,
DT_CALCRECT
|
DT_WORDBREAK
);
ok
(
textheight
==
heightcheck
*
2
,
"Got unexpected textheight %d, expected %d.
\n
"
,
textheight
,
heightcheck
*
2
);
SetRect
(
&
rect
,
0
,
0
,
1
,
1
);
textheight
=
DrawTextA
(
hdc
,
wordbreak_text
,
-
1
,
&
rect
,
DT_CALCRECT
|
DT_WORDBREAK
|
DT_EDITCONTROL
);
ok
(
textheight
>=
heightcheck
*
6
,
"Got unexpected textheight %d, expected at least %d.
\n
"
,
textheight
,
heightcheck
*
6
);
SetRect
(
&
rect
,
0
,
0
,
1
,
1
);
heightcheck
=
DrawTextW
(
hdc
,
wordbreak_textW
,
-
1
,
&
rect
,
DT_CALCRECT
);
...
...
@@ -571,6 +575,10 @@ static void test_DrawTextCalcRect(void)
textheight
=
DrawTextW
(
hdc
,
wordbreak_textW
,
-
1
,
&
rect
,
DT_CALCRECT
|
DT_WORDBREAK
);
ok
(
textheight
==
heightcheck
*
2
,
"Got unexpected textheight %d, expected %d.
\n
"
,
textheight
,
heightcheck
*
2
);
SetRect
(
&
rect
,
0
,
0
,
1
,
1
);
textheight
=
DrawTextW
(
hdc
,
wordbreak_textW
,
-
1
,
&
rect
,
DT_CALCRECT
|
DT_WORDBREAK
|
DT_EDITCONTROL
);
ok
(
textheight
>=
heightcheck
*
6
,
"Got unexpected textheight %d, expected at least %d.
\n
"
,
textheight
,
heightcheck
*
6
);
SelectObject
(
hdc
,
hOldFont
);
ret
=
DeleteObject
(
hFont
);
...
...
dlls/user32/text.c
View file @
f25317a6
...
...
@@ -413,8 +413,9 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str,
DT_EDITCONTROL
)
{
/* break the word after the last character that fits (there must be
* at least one; none is caught earlier).
*/
* at least one). */
if
(
!
chars_fit
)
++
chars_fit
;
*
len_str
=
chars_fit
;
*
chars_used
=
chars_fit
;
...
...
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