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
14044d93
Commit
14044d93
authored
Oct 07, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Oct 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Simplify SplitByBacktracking().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5dc422d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
+13
-18
wrap.c
dlls/riched20/wrap.c
+13
-18
No files found.
dlls/riched20/wrap.c
View file @
14044d93
...
...
@@ -498,7 +498,7 @@ static ME_DisplayItem *ME_MaximizeSplit(ME_WrapContext *wc, ME_DisplayItem *p, i
static
ME_DisplayItem
*
ME_SplitByBacktracking
(
ME_WrapContext
*
wc
,
ME_DisplayItem
*
p
,
int
loc
)
{
ME_DisplayItem
*
piter
=
p
,
*
pp
;
ME_DisplayItem
*
new_run
;
int
i
,
idesp
,
len
;
ME_Run
*
run
=
&
p
->
member
.
run
;
...
...
@@ -509,9 +509,8 @@ static ME_DisplayItem *ME_SplitByBacktracking(ME_WrapContext *wc, ME_DisplayItem
if
(
i
)
{
/* don't split words */
i
=
reverse_find_whitespace
(
get_text
(
run
,
0
),
i
);
pp
=
ME_MaximizeSplit
(
wc
,
p
,
i
);
if
(
pp
)
return
pp
;
new_run
=
ME_MaximizeSplit
(
wc
,
p
,
i
);
if
(
new_run
)
return
new_run
;
}
TRACE
(
"Must backtrack to split at: %s
\n
"
,
debugstr_run
(
&
p
->
member
.
run
));
if
(
wc
->
pLastSplittableRun
)
...
...
@@ -528,20 +527,16 @@ static ME_DisplayItem *ME_SplitByBacktracking(ME_WrapContext *wc, ME_DisplayItem
ME_UpdateRunFlags
(
wc
->
context
->
editor
,
run
);
assert
((
wc
->
pLastSplittableRun
->
member
.
run
.
nFlags
&
MERF_SPLITTABLE
));
p
iter
=
wc
->
pLastSplittableRun
;
run
=
&
p
iter
->
member
.
run
;
p
=
wc
->
pLastSplittableRun
;
run
=
&
p
->
member
.
run
;
len
=
run
->
len
;
/* don't split words */
i
=
reverse_find_whitespace
(
get_text
(
run
,
0
),
len
);
if
(
i
==
len
)
i
=
reverse_find_non_whitespace
(
get_text
(
run
,
0
),
len
);
if
(
i
)
{
ME_DisplayItem
*
piter2
=
split_run_extents
(
wc
,
piter
,
i
);
wc
->
pt
=
piter2
->
member
.
run
.
pt
;
return
piter2
;
}
/* splittable = must have whitespaces */
assert
(
0
==
"Splittable, but no whitespaces"
);
new_run
=
split_run_extents
(
wc
,
p
,
i
);
wc
->
pt
=
new_run
->
member
.
run
.
pt
;
return
new_run
;
}
else
{
...
...
@@ -553,24 +548,24 @@ static ME_DisplayItem *ME_SplitByBacktracking(ME_WrapContext *wc, ME_DisplayItem
TRACE
(
"Backtracking failed, trying desperate: %s
\n
"
,
debugstr_run
(
&
p
->
member
.
run
));
/* OK, no better idea, so assume we MAY split words if we can split at all*/
if
(
idesp
)
return
split_run_extents
(
wc
,
p
iter
,
idesp
);
return
split_run_extents
(
wc
,
p
,
idesp
);
else
if
(
wc
->
pRowStart
&&
p
iter
!=
wc
->
pRowStart
)
if
(
wc
->
pRowStart
&&
p
!=
wc
->
pRowStart
)
{
/* don't need to break current run, because it's possible to split
before this run */
wc
->
bOverflown
=
TRUE
;
return
p
iter
;
return
p
;
}
else
{
/* split point inside first character - no choice but split after that char */
if
(
len
!=
1
)
{
/* the run is more than 1 char, so we may split */
return
split_run_extents
(
wc
,
p
iter
,
1
);
return
split_run_extents
(
wc
,
p
,
1
);
}
/* the run is one char, can't split it */
return
p
iter
;
return
p
;
}
}
...
...
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