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
bc39eeec
Commit
bc39eeec
authored
Feb 26, 2002
by
Bill Medland
Committed by
Alexandre Julliard
Feb 26, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct Word breaking in centred/right justified mode; it was leaving a
trailing space which it should only do for left-justified text. Also tighten up some comments.
parent
db728b0b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
text.c
dlls/user/text.c
+16
-7
No files found.
dlls/user/text.c
View file @
bc39eeec
...
...
@@ -260,12 +260,18 @@ static void TEXT_PathEllipsify (HDC hdc, WCHAR *str, unsigned int max_len,
* Perform wordbreak processing on the given string
*
* Assumes that DT_WORDBREAK has been specified and not all the characters
* fit. Note that this function should
be called when the first character that
*
doesn't fit is a space or tab, so that it can swallow the space(s)
* fit. Note that this function should
even be called when the first character
*
that doesn't fit is known to be a space or tab, so that it can swallow them.
*
* Note that the Windows processing has some strange properties. In particular
* leading and trailing spaces are not stripped except for the first space of a
* line created by a wordbreak.
* Note that the Windows processing has some strange properties.
* 1. If the text is left-justified and there is room for some of the spaces
* that follow the last word on the line then those that fit are included on
* the line.
* 2. If the text is centred or right-justified and there is room for some of
* the spaces that follow the last word on the line then all but one of those
* that fit are included on the line.
* 3. (Reasonable behaviour) If the word breaking causes a space to be the first
* character of a new line it will be skipped.
*
* Arguments
* hdc [in] The handle to the DC that defines the font.
...
...
@@ -290,7 +296,9 @@ static void TEXT_PathEllipsify (HDC hdc, WCHAR *str, unsigned int max_len,
* Work back from the last character that did fit to either a space or the last
* character of a word, whichever is met first.
* If there was one or the first character didn't fit then
* break the line after that character
* If the text is centred or right justified and that one character was a
* space then break the line before that character
* Otherwise break the line after that character
* and if the next character is a space then discard it.
* Suppose there was none (and the first character did fit).
* If Break Within Word is permitted
...
...
@@ -334,7 +342,8 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str,
/* If there was one or the first character didn't fit then */
if
(
word_fits
)
{
/* break the line after that character */
/* break the line before/after that character */
if
(
!
(
format
&
(
DT_RIGHT
|
DT_CENTER
))
||
*
p
!=
SPACE
)
p
++
;
*
len_str
=
p
-
str
;
/* and if the next character is a space then discard it. */
...
...
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