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
ec66785f
Commit
ec66785f
authored
Mar 11, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix TEXT_WordBreak() when no characters fit.
parent
cbfeef4b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
text.c
dlls/user32/tests/text.c
+16
-0
text.c
dlls/user32/text.c
+2
-2
No files found.
dlls/user32/tests/text.c
View file @
ec66785f
...
...
@@ -42,6 +42,8 @@ static void test_DrawTextCalcRect(void)
's'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
'\0'
};
static
CHAR
emptystring
[]
=
""
;
static
WCHAR
emptystringW
[]
=
{
0
};
static
CHAR
wordbreak_text
[]
=
"line1 line2"
;
static
WCHAR
wordbreak_textW
[]
=
{
'l'
,
'i'
,
'n'
,
'e'
,
'1'
,
' '
,
'l'
,
'i'
,
'n'
,
'e'
,
'2'
,
0
};
INT
textlen
,
textheight
,
heightcheck
;
RECT
rect
=
{
0
,
0
,
100
,
0
};
BOOL
ret
;
...
...
@@ -556,6 +558,20 @@ static void test_DrawTextCalcRect(void)
ok
(
rect
.
bottom
,
"rect.bottom should not be 0
\n
"
);
}
SetRect
(
&
rect
,
0
,
0
,
1
,
1
);
heightcheck
=
DrawTextA
(
hdc
,
wordbreak_text
,
-
1
,
&
rect
,
DT_CALCRECT
);
SetRect
(
&
rect
,
0
,
0
,
1
,
1
);
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
);
heightcheck
=
DrawTextW
(
hdc
,
wordbreak_textW
,
-
1
,
&
rect
,
DT_CALCRECT
);
SetRect
(
&
rect
,
0
,
0
,
1
,
1
);
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
);
SelectObject
(
hdc
,
hOldFont
);
ret
=
DeleteObject
(
hFont
);
ok
(
ret
,
"DeleteObject error %u
\n
"
,
GetLastError
());
...
...
dlls/user32/text.c
View file @
ec66785f
...
...
@@ -379,7 +379,7 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str,
i
=
chars_fit
;
word_fits
=
TRUE
;
if
(
!
chars_fit
)
;
/* we pretend that it fits anyway */
word_fits
=
FALSE
;
else
if
(
sla
[
i
].
fSoftBreak
)
/* chars_fit < *len_str so this is valid */
{
/* the word just fitted */
...
...
@@ -392,7 +392,7 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str,
word_fits
=
(
i
!=
0
||
sla
[
i
+
1
].
fSoftBreak
);
}
/* If there was one
or the first character didn't fit then
*/
/* If there was one
.
*/
if
(
word_fits
)
{
BOOL
next_is_space
;
...
...
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