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
17f27336
Commit
17f27336
authored
Jun 08, 2015
by
Huw Davies
Committed by
Alexandre Julliard
Jun 09, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Append a final \par when writing the whole buffer.
parent
0922865b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
4 deletions
+47
-4
editor.c
dlls/riched20/editor.c
+1
-1
editor.c
dlls/riched20/tests/editor.c
+42
-2
writer.c
dlls/riched20/writer.c
+4
-1
No files found.
dlls/riched20/editor.c
View file @
17f27336
...
...
@@ -1708,7 +1708,7 @@ ME_StreamInRTFString(ME_TextEditor *editor, BOOL selection, char *string)
data
.
pos
=
0
;
es
.
dwCookie
=
(
DWORD_PTR
)
&
data
;
es
.
pfnCallback
=
ME_ReadFromRTFString
;
ME_StreamIn
(
editor
,
SF_RTF
|
(
selection
?
SFF_SELECTION
:
0
),
&
es
,
FALS
E
);
ME_StreamIn
(
editor
,
SF_RTF
|
(
selection
?
SFF_SELECTION
:
0
),
&
es
,
TRU
E
);
}
...
...
dlls/riched20/tests/editor.c
View file @
17f27336
...
...
@@ -3422,6 +3422,19 @@ static DWORD CALLBACK test_esCallback_written_1(DWORD_PTR dwCookie,
return
0
;
}
static
int
count_pars
(
const
char
*
buf
)
{
const
char
*
p
=
buf
;
int
count
=
0
;
while
((
p
=
strstr
(
p
,
"
\\
par"
))
!=
NULL
)
{
if
(
!
isalpha
(
p
[
4
]
))
count
++
;
p
++
;
}
return
count
;
}
static
void
test_EM_STREAMOUT
(
void
)
{
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
...
...
@@ -3446,6 +3459,19 @@ static void test_EM_STREAMOUT(void)
ok
(
strcmp
(
buf
,
TestItem1
)
==
0
,
"streamed text different, got %s
\n
"
,
buf
);
/* RTF mode writes the final end of para \r if it's part of the selection */
p
=
buf
;
SendMessageA
(
hwndRichEdit
,
EM_STREAMOUT
,
SF_RTF
,
(
LPARAM
)
&
es
);
ok
(
count_pars
(
buf
)
==
1
,
"got %s
\n
"
,
buf
);
p
=
buf
;
SendMessageA
(
hwndRichEdit
,
EM_SETSEL
,
0
,
12
);
SendMessageA
(
hwndRichEdit
,
EM_STREAMOUT
,
SF_RTF
|
SFF_SELECTION
,
(
LPARAM
)
&
es
);
ok
(
count_pars
(
buf
)
==
0
,
"got %s
\n
"
,
buf
);
p
=
buf
;
SendMessageA
(
hwndRichEdit
,
EM_SETSEL
,
0
,
-
1
);
SendMessageA
(
hwndRichEdit
,
EM_STREAMOUT
,
SF_RTF
|
SFF_SELECTION
,
(
LPARAM
)
&
es
);
ok
(
count_pars
(
buf
)
==
1
,
"got %s
\n
"
,
buf
);
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
TestItem2
);
p
=
buf
;
es
.
dwCookie
=
(
DWORD_PTR
)
&
p
;
...
...
@@ -3458,6 +3484,20 @@ static void test_EM_STREAMOUT(void)
ok
(
r
==
14
,
"streamed text length is %d, expecting 14
\n
"
,
r
);
ok
(
strcmp
(
buf
,
TestItem3
)
==
0
,
"streamed text different from, got %s
\n
"
,
buf
);
/* And again RTF mode writes the final end of para \r if it's part of the selection */
p
=
buf
;
SendMessageA
(
hwndRichEdit
,
EM_STREAMOUT
,
SF_RTF
,
(
LPARAM
)
&
es
);
ok
(
count_pars
(
buf
)
==
2
,
"got %s
\n
"
,
buf
);
p
=
buf
;
SendMessageA
(
hwndRichEdit
,
EM_SETSEL
,
0
,
13
);
SendMessageA
(
hwndRichEdit
,
EM_STREAMOUT
,
SF_RTF
|
SFF_SELECTION
,
(
LPARAM
)
&
es
);
ok
(
count_pars
(
buf
)
==
1
,
"got %s
\n
"
,
buf
);
p
=
buf
;
SendMessageA
(
hwndRichEdit
,
EM_SETSEL
,
0
,
-
1
);
SendMessageA
(
hwndRichEdit
,
EM_STREAMOUT
,
SF_RTF
|
SFF_SELECTION
,
(
LPARAM
)
&
es
);
ok
(
count_pars
(
buf
)
==
2
,
"got %s
\n
"
,
buf
);
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
TestItem3
);
p
=
buf
;
es
.
dwCookie
=
(
DWORD_PTR
)
&
p
;
...
...
@@ -4904,7 +4944,7 @@ static void test_WM_PASTE(void)
SendMessageA
(
hwndRichEdit
,
WM_PASTE
,
0
,
0
);
SendMessageA
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
result
=
strcmp
(
buffer
,
"cut
\r\n
"
);
todo_wine
ok
(
result
==
0
,
ok
(
result
==
0
,
"test paste: strcmp = %i, actual = '%s'
\n
"
,
result
,
buffer
);
/* Simulates undo (Ctrl-Z) */
hold_key
(
VK_CONTROL
);
...
...
@@ -4919,7 +4959,7 @@ static void test_WM_PASTE(void)
(
MapVirtualKeyA
(
'Y'
,
MAPVK_VK_TO_VSC
)
<<
16
)
|
1
);
SendMessageA
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
result
=
strcmp
(
buffer
,
"cut
\r\n
"
);
todo_wine
ok
(
result
==
0
,
ok
(
result
==
0
,
"test paste: strcmp = %i, actual = '%s'
\n
"
,
result
,
buffer
);
release_key
(
VK_CONTROL
);
...
...
dlls/riched20/writer.c
View file @
17f27336
...
...
@@ -788,8 +788,11 @@ static BOOL ME_StreamOutRTF(ME_TextEditor *editor, ME_OutStream *pStream,
ME_Cursor
cursor
=
*
start
;
ME_DisplayItem
*
prev_para
=
cursor
.
pPara
;
ME_Cursor
endCur
=
cursor
;
int
actual_chars
;
ME_MoveCursorChars
(
editor
,
&
endCur
,
nChars
);
actual_chars
=
ME_MoveCursorChars
(
editor
,
&
endCur
,
nChars
);
/* Include the final \r which MoveCursorChars will ignore. */
if
(
actual_chars
!=
nChars
)
endCur
.
nOffset
++
;
if
(
!
ME_StreamOutRTFHeader
(
pStream
,
dwFormat
))
return
FALSE
;
...
...
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