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
b89c7c8f
Commit
b89c7c8f
authored
May 29, 2014
by
Huw Davies
Committed by
Alexandre Julliard
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Don't skip the final carriage return in SFF_SELECTION mode.
parent
d32abd77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
2 deletions
+42
-2
editor.c
dlls/riched20/editor.c
+1
-1
editor.c
dlls/riched20/tests/editor.c
+41
-1
No files found.
dlls/riched20/editor.c
View file @
b89c7c8f
...
...
@@ -1620,7 +1620,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
CR/LF counters, since RTF streaming presents only \para tokens, which
are converted according to the standard rules: \r for 2.0, \r\n for 1.0
*/
if
(
stripLastCR
)
{
if
(
stripLastCR
&&
!
(
format
&
SFF_SELECTION
)
)
{
int
newto
;
ME_GetSelection
(
editor
,
&
selStart
,
&
selEnd
);
newto
=
ME_GetCursorOfs
(
selEnd
);
...
...
dlls/riched20/tests/editor.c
View file @
b89c7c8f
...
...
@@ -5072,10 +5072,12 @@ static void test_EM_STREAMIN(void)
LRESULT
result
;
EDITSTREAM
es
;
char
buffer
[
1024
]
=
{
0
},
tmp
[
16
];
CHARRANGE
range
;
const
char
*
streamText0
=
"{
\\
rtf1 TestSomeText}"
;
const
char
*
streamText0a
=
"{
\\
rtf1 TestSomeText
\\
par}"
;
const
char
*
streamText0b
=
"{
\\
rtf1 TestSomeText
\\
par
\\
par}"
;
const
char
*
ptr
;
const
char
*
streamText1
=
"{
\\
rtf1
\\
ansi
\\
ansicpg1252
\\
deff0
\\
deflang12298{
\\
fonttbl{
\\
f0
\\
fswiss
\\
fprq2
\\
fcharset0 System;}}
\r\n
"
...
...
@@ -5132,7 +5134,8 @@ static void test_EM_STREAMIN(void)
ok
(
es
.
dwError
==
0
,
"EM_STREAMIN: Test 0 set error %d, expected %d
\n
"
,
es
.
dwError
,
0
);
/* Native richedit 2.0 ignores last \par */
es
.
dwCookie
=
(
DWORD_PTR
)
&
streamText0a
;
ptr
=
streamText0a
;
es
.
dwCookie
=
(
DWORD_PTR
)
&
ptr
;
es
.
dwError
=
0
;
es
.
pfnCallback
=
test_EM_STREAMIN_esCallback
;
result
=
SendMessageA
(
hwndRichEdit
,
EM_STREAMIN
,
SF_RTF
,
(
LPARAM
)
&
es
);
...
...
@@ -5161,6 +5164,43 @@ static void test_EM_STREAMIN(void)
"EM_STREAMIN: Test 0-b set wrong text: Result: %s
\n
"
,
buffer
);
ok
(
es
.
dwError
==
0
,
"EM_STREAMIN: Test 0-b set error %d, expected %d
\n
"
,
es
.
dwError
,
0
);
/* Show that when using SFF_SELECTION the last \par is not ignored. */
ptr
=
streamText0a
;
es
.
dwCookie
=
(
DWORD_PTR
)
&
ptr
;
es
.
dwError
=
0
;
es
.
pfnCallback
=
test_EM_STREAMIN_esCallback
;
result
=
SendMessageA
(
hwndRichEdit
,
EM_STREAMIN
,
SF_RTF
,
(
LPARAM
)
&
es
);
ok
(
result
==
12
,
"got %ld, expected %d
\n
"
,
result
,
12
);
result
=
SendMessageA
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
ok
(
result
==
12
,
"EM_STREAMIN: Test 0-a returned %ld, expected 12
\n
"
,
result
);
result
=
strcmp
(
buffer
,
"TestSomeText"
);
ok
(
result
==
0
,
"EM_STREAMIN: Test 0-a set wrong text: Result: %s
\n
"
,
buffer
);
ok
(
es
.
dwError
==
0
,
"EM_STREAMIN: Test 0-a set error %d, expected %d
\n
"
,
es
.
dwError
,
0
);
range
.
cpMin
=
0
;
range
.
cpMax
=
-
1
;
result
=
SendMessageA
(
hwndRichEdit
,
EM_EXSETSEL
,
0
,
(
LPARAM
)
&
range
);
ok
(
result
==
13
,
"got %ld
\n
"
,
result
);
ptr
=
streamText0a
;
es
.
dwCookie
=
(
DWORD_PTR
)
&
ptr
;
es
.
dwError
=
0
;
es
.
pfnCallback
=
test_EM_STREAMIN_esCallback
;
result
=
SendMessageA
(
hwndRichEdit
,
EM_STREAMIN
,
SFF_SELECTION
|
SF_RTF
,
(
LPARAM
)
&
es
);
ok
(
result
==
13
,
"got %ld, expected 13
\n
"
,
result
);
result
=
SendMessageA
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
ok
(
result
==
14
,
"EM_STREAMIN: Test SFF_SELECTION 0-a returned %ld, expected 14
\n
"
,
result
);
result
=
strcmp
(
buffer
,
"TestSomeText
\r\n
"
);
ok
(
result
==
0
,
"EM_STREAMIN: Test SFF_SELECTION 0-a set wrong text: Result: %s
\n
"
,
buffer
);
ok
(
es
.
dwError
==
0
,
"EM_STREAMIN: Test SFF_SELECTION 0-a set error %d, expected %d
\n
"
,
es
.
dwError
,
0
);
es
.
dwCookie
=
(
DWORD_PTR
)
&
streamText1
;
es
.
dwError
=
0
;
es
.
pfnCallback
=
test_EM_STREAMIN_esCallback
;
...
...
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