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
c8e2552a
Commit
c8e2552a
authored
Jun 23, 2008
by
Dylan Smith
Committed by
Alexandre Julliard
Jun 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Trailing spaces should not affect alignment shift length.
parent
308582b4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
3 deletions
+29
-3
wrap.c
dlls/riched20/wrap.c
+29
-3
No files found.
dlls/riched20/wrap.c
View file @
c8e2552a
...
...
@@ -58,10 +58,12 @@ static void ME_BeginRow(ME_WrapContext *wc)
static
void
ME_InsertRowStart
(
ME_WrapContext
*
wc
,
const
ME_DisplayItem
*
pEnd
)
{
ME_DisplayItem
*
p
,
*
row
,
*
para
;
BOOL
bSkippingSpaces
=
TRUE
;
int
ascent
=
0
,
descent
=
0
,
width
=
0
,
shift
=
0
,
align
=
0
;
/* wrap text */
para
=
ME_GetParagraph
(
wc
->
pRowStart
);
for
(
p
=
wc
->
pRowStart
;
p
!=
pEnd
;
p
=
p
->
next
)
for
(
p
=
pEnd
->
prev
;
p
!=
wc
->
pRowStart
->
prev
;
p
=
p
->
prev
)
{
/* ENDPARA run shouldn't affect row height, except if it's the only run in the paragraph */
if
(
p
->
type
==
diRun
&&
((
p
==
wc
->
pRowStart
)
||
!
(
p
->
member
.
run
.
nFlags
&
MERF_ENDPARA
)))
{
/* FIXME add more run types */
...
...
@@ -69,10 +71,34 @@ static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd)
ascent
=
p
->
member
.
run
.
nAscent
;
if
(
p
->
member
.
run
.
nDescent
>
descent
)
descent
=
p
->
member
.
run
.
nDescent
;
if
(
!
(
p
->
member
.
run
.
nFlags
&
(
MERF_ENDPARA
|
MERF_SKIPPED
)))
if
(
bSkippingSpaces
)
{
/* Exclude space characters from run width.
* Other whitespace or delimiters are not treated this way. */
SIZE
sz
;
int
len
=
p
->
member
.
run
.
strText
->
nLen
;
WCHAR
*
text
=
p
->
member
.
run
.
strText
->
szData
+
len
-
1
;
assert
(
len
);
while
(
len
&&
*
(
text
--
)
==
' '
)
len
--
;
if
(
len
)
{
if
(
len
==
p
->
member
.
run
.
strText
->
nLen
)
{
width
+=
p
->
member
.
run
.
nWidth
;
}
else
{
sz
=
ME_GetRunSize
(
wc
->
context
,
&
para
->
member
.
para
,
&
p
->
member
.
run
,
len
,
p
->
member
.
run
.
pt
.
x
);
width
+=
sz
.
cx
;
}
}
bSkippingSpaces
=
!
len
;
}
else
if
(
!
(
p
->
member
.
run
.
nFlags
&
MERF_ENDPARA
))
width
+=
p
->
member
.
run
.
nWidth
;
}
}
row
=
ME_MakeRow
(
ascent
+
descent
,
ascent
,
width
);
row
->
member
.
row
.
nYPos
=
wc
->
pt
.
y
;
row
->
member
.
row
.
nLMargin
=
(
!
wc
->
nRow
?
wc
->
nFirstMargin
:
wc
->
nLeftMargin
);
...
...
@@ -98,7 +124,7 @@ static void ME_InsertRowStart(ME_WrapContext *wc, const ME_DisplayItem *pEnd)
static
void
ME_WrapEndParagraph
(
ME_WrapContext
*
wc
,
ME_DisplayItem
*
p
)
{
if
(
wc
->
pRowStart
)
ME_InsertRowStart
(
wc
,
p
->
next
);
ME_InsertRowStart
(
wc
,
p
);
/*
p = p->member.para.prev_para->next;
...
...
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