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
4545f194
Commit
4545f194
authored
Dec 06, 2007
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Dec 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: EM_GETTEXTEX with GT_USECRLF should not leave a single CR when running out of space.
parent
7092590c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
editor.c
dlls/riched20/editor.c
+4
-1
editor.c
dlls/riched20/tests/editor.c
+27
-0
No files found.
dlls/riched20/editor.c
View file @
4545f194
...
...
@@ -2804,7 +2804,10 @@ int ME_GetTextW(ME_TextEditor *editor, WCHAR *buffer, int nStart, int nChars, in
if
(
!
ME_FindItemFwd
(
item
,
diRun
))
/* No '\r' is appended to the last paragraph. */
nLen
=
0
;
else
{
else
if
(
bCRLF
&&
nChars
==
1
)
{
nLen
=
0
;
nChars
=
0
;
}
else
{
*
buffer
=
'\r'
;
if
(
bCRLF
)
{
...
...
dlls/riched20/tests/editor.c
View file @
4545f194
...
...
@@ -1116,6 +1116,33 @@ static void test_EM_SETTEXTEX(void)
ok
(
strcmp
((
const
char
*
)
buf
,
TestItem2_after
)
==
0
,
"WM_GETTEXT did *not* see
\\
r converted to
\\
r
\\
n pairs.
\n
"
);
/* Baseline test for just-enough buffer space for string */
getText
.
cb
=
(
lstrlenW
(
TestItem2
)
+
1
)
*
sizeof
(
WCHAR
);
getText
.
codepage
=
1200
;
/* no constant for unicode */
getText
.
flags
=
GT_DEFAULT
;
getText
.
lpDefaultChar
=
NULL
;
getText
.
lpUsedDefaultChar
=
NULL
;
memset
(
buf
,
0
,
MAX_BUF_LEN
);
SendMessage
(
hwndRichEdit
,
EM_GETTEXTEX
,
(
WPARAM
)
&
getText
,
(
LPARAM
)
buf
);
ok
(
lstrcmpW
(
buf
,
TestItem2
)
==
0
,
"EM_GETTEXTEX results not what was set by EM_SETTEXTEX
\n
"
);
/* When there is enough space for one character, but not both, of the CRLF
pair at the end of the string, the CR is not copied at all. That is,
the caller must not see CRLF pairs truncated to CR at the end of the
string.
*/
getText
.
cb
=
(
lstrlenW
(
TestItem2
)
+
1
)
*
sizeof
(
WCHAR
);
getText
.
codepage
=
1200
;
/* no constant for unicode */
getText
.
flags
=
GT_USECRLF
;
/* <-- asking for CR -> CRLF conversion */
getText
.
lpDefaultChar
=
NULL
;
getText
.
lpUsedDefaultChar
=
NULL
;
memset
(
buf
,
0
,
MAX_BUF_LEN
);
SendMessage
(
hwndRichEdit
,
EM_GETTEXTEX
,
(
WPARAM
)
&
getText
,
(
LPARAM
)
buf
);
ok
(
lstrcmpW
(
buf
,
TestItem1
)
==
0
,
"EM_GETTEXTEX results not what was set by EM_SETTEXTEX
\n
"
);
/* \r\n pairs get changed into \r */
setText
.
codepage
=
1200
;
/* no constant for unicode */
getText
.
codepage
=
1200
;
/* no constant for unicode */
...
...
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