Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e8aa9dee
Commit
e8aa9dee
authored
Apr 26, 2008
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Apr 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Modify ME_GetTextW() to honor CR and LF encodings.
ME_GetTextLengthEx should ignore GTL_USECRLF in 1.0 emulation mode.
parent
d95cbeef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
caret.c
dlls/riched20/caret.c
+3
-1
editor.c
dlls/riched20/editor.c
+25
-6
No files found.
dlls/riched20/caret.c
View file @
e8aa9dee
...
...
@@ -57,7 +57,9 @@ int ME_GetTextLengthEx(ME_TextEditor *editor, const GETTEXTLENGTHEX *how)
length
=
ME_GetTextLength
(
editor
);
if
((
GetWindowLongW
(
editor
->
hWnd
,
GWL_STYLE
)
&
ES_MULTILINE
)
&&
(
how
->
flags
&
GTL_USECRLF
))
if
((
GetWindowLongW
(
editor
->
hWnd
,
GWL_STYLE
)
&
ES_MULTILINE
)
&&
(
how
->
flags
&
GTL_USECRLF
)
&&
!
editor
->
bEmulateVersion10
)
/* Ignore GTL_USECRLF flag in 1.0 emulation */
length
+=
editor
->
nParagraphs
-
1
;
if
(
how
->
flags
&
GTL_NUMBYTES
)
...
...
dlls/riched20/editor.c
View file @
e8aa9dee
...
...
@@ -3376,6 +3376,9 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in
return
0
;
}
/* bCRLF flag is only honored in 2.0 and up. 1.0 must always return text verbatim */
if
(
editor
->
bEmulateVersion10
)
bCRLF
=
0
;
if
(
nStart
)
{
int
nLen
=
ME_StrLen
(
item
->
member
.
run
.
strText
)
-
nStart
;
...
...
@@ -3394,6 +3397,8 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in
while
(
nChars
&&
item
)
{
int
nLen
=
ME_StrLen
(
item
->
member
.
run
.
strText
);
if
(
item
->
member
.
run
.
nFlags
&
MERF_ENDPARA
)
nLen
=
item
->
member
.
run
.
nCR
+
item
->
member
.
run
.
nLF
;
if
(
nLen
>
nChars
)
nLen
=
nChars
;
...
...
@@ -3406,16 +3411,30 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in
nLen
=
0
;
nChars
=
0
;
}
else
{
*
buffer
=
'\r'
;
if
(
bCRLF
)
{
*
(
++
buffer
)
=
'\n'
;
/* richedit 2.0 case - actual line-break is \r but should report \r\n */
assert
(
nLen
==
1
);
*
buffer
++
=
'\r'
;
*
buffer
=
'\n'
;
/* Later updated by nLen==1 at the end of the loop */
nWritten
++
;
}
assert
(
nLen
==
1
);
/* our end paragraph consists of 2 characters now */
if
(
editor
->
bEmulateVersion10
)
nChars
--
;
else
{
int
i
,
j
;
/* richedit 2.0 verbatim has only \r. richedit 1.0 should honor encodings */
i
=
0
;
while
(
nChars
-
i
>
0
&&
i
<
item
->
member
.
run
.
nCR
)
{
buffer
[
i
]
=
'\r'
;
i
++
;
}
j
=
0
;
while
(
nChars
-
i
-
j
>
0
&&
j
<
item
->
member
.
run
.
nLF
)
{
buffer
[
i
+
j
]
=
'\n'
;
j
++
;
}
}
}
}
else
...
...
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