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
27f8e16b
Commit
27f8e16b
authored
Nov 03, 2020
by
Huw Davies
Committed by
Alexandre Julliard
Nov 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Use run ptrs in the text retrieval function.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cfdfe517
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
editor.c
dlls/riched20/editor.c
+15
-16
No files found.
dlls/riched20/editor.c
View file @
27f8e16b
...
...
@@ -5160,7 +5160,7 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen,
const
ME_Cursor
*
start
,
int
srcChars
,
BOOL
bCRLF
,
BOOL
bEOP
)
{
ME_
DisplayItem
*
pRun
,
*
pNextR
un
;
ME_
Run
*
run
,
*
next_r
un
;
const
WCHAR
*
pStart
=
buffer
;
const
WCHAR
cr_lf
[]
=
{
'\r'
,
'\n'
,
0
};
const
WCHAR
*
str
;
...
...
@@ -5169,18 +5169,15 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen,
/* bCRLF flag is only honored in 2.0 and up. 1.0 must always return text verbatim */
if
(
editor
->
bEmulateVersion10
)
bCRLF
=
FALSE
;
pRun
=
start
->
pRun
;
assert
(
pRun
);
pNextRun
=
ME_FindItemFwd
(
pRun
,
diRun
);
run
=
&
start
->
pRun
->
member
.
run
;
next_run
=
run_next_all_paras
(
run
);
nLen
=
pRun
->
member
.
run
.
len
-
start
->
nOffset
;
str
=
get_text
(
&
pRun
->
member
.
run
,
start
->
nOffset
);
nLen
=
run
->
len
-
start
->
nOffset
;
str
=
get_text
(
run
,
start
->
nOffset
);
while
(
srcChars
&&
buflen
&&
pNextR
un
)
while
(
srcChars
&&
buflen
&&
next_r
un
)
{
int
nFlags
=
pRun
->
member
.
run
.
nFlags
;
if
(
bCRLF
&&
nFlags
&
MERF_ENDPARA
&&
~
nFlags
&
MERF_ENDCELL
)
if
(
bCRLF
&&
run
->
nFlags
&
MERF_ENDPARA
&&
~
run
->
nFlags
&
MERF_ENDCELL
)
{
if
(
buflen
==
1
)
break
;
/* FIXME: native fails to reduce srcChars here for WM_GETTEXT or
...
...
@@ -5189,7 +5186,9 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen,
srcChars
-=
min
(
nLen
,
srcChars
);
nLen
=
2
;
str
=
cr_lf
;
}
else
{
}
else
{
nLen
=
min
(
nLen
,
srcChars
);
srcChars
-=
nLen
;
}
...
...
@@ -5201,14 +5200,14 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int buflen,
buffer
+=
nLen
;
pRun
=
pNextR
un
;
pNextRun
=
ME_FindItemFwd
(
pRun
,
diRun
);
run
=
next_r
un
;
next_run
=
run_next_all_paras
(
run
);
nLen
=
pRun
->
member
.
run
.
len
;
str
=
get_text
(
&
pRun
->
member
.
run
,
0
);
nLen
=
run
->
len
;
str
=
get_text
(
run
,
0
);
}
/* append '\r' to the last paragraph. */
if
(
pRun
->
next
->
type
==
diTextEnd
&&
bEOP
)
if
(
run
==
para_end_run
(
para_prev
(
editor_end_para
(
editor
)
)
)
&&
bEOP
)
{
*
buffer
=
'\r'
;
buffer
++
;
...
...
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