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
7148f92c
Commit
7148f92c
authored
Apr 24, 2008
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Apr 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Implement ignoring of last \par for EM_STREAMIN.
parent
663bfb77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
editor.c
dlls/riched20/editor.c
+18
-4
editor.c
dlls/riched20/tests/editor.c
+0
-12
No files found.
dlls/riched20/editor.c
View file @
7148f92c
...
...
@@ -1022,7 +1022,7 @@ ME_StreamInFill(ME_InStream *stream)
stream
->
dwUsed
=
0
;
}
static
LRESULT
ME_StreamIn
(
ME_TextEditor
*
editor
,
DWORD
format
,
EDITSTREAM
*
stream
)
static
LRESULT
ME_StreamIn
(
ME_TextEditor
*
editor
,
DWORD
format
,
EDITSTREAM
*
stream
,
BOOL
stripLastCR
)
{
RTF_Info
parser
;
ME_Style
*
style
;
...
...
@@ -1101,6 +1101,20 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
if
(
parser
.
lpRichEditOle
)
IRichEditOle_Release
(
parser
.
lpRichEditOle
);
/* Remove last line break, as mandated by tests */
if
(
stripLastCR
)
{
int
newfrom
,
newto
;
ME_GetSelection
(
editor
,
&
newfrom
,
&
newto
);
if
(
newto
>
to
)
{
WCHAR
lastchar
=
'\0'
;
ME_GetTextW
(
editor
,
&
lastchar
,
newto
-
1
,
1
,
0
);
if
(
lastchar
==
'\r'
)
{
ME_InternalDeleteText
(
editor
,
newto
-
1
,
1
);
}
}
}
style
=
parser
.
style
;
}
else
if
(
format
&
SF_TEXT
)
...
...
@@ -1170,7 +1184,7 @@ ME_StreamInRTFString(ME_TextEditor *editor, BOOL selection, char *string)
data
.
pos
=
0
;
es
.
dwCookie
=
(
DWORD
)
&
data
;
es
.
pfnCallback
=
ME_ReadFromRTFString
;
ME_StreamIn
(
editor
,
SF_RTF
|
(
selection
?
SFF_SELECTION
:
0
),
&
es
);
ME_StreamIn
(
editor
,
SF_RTF
|
(
selection
?
SFF_SELECTION
:
0
),
&
es
,
FALSE
);
}
...
...
@@ -1923,7 +1937,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
/* Messages specific to Richedit controls */
case
EM_STREAMIN
:
return
ME_StreamIn
(
editor
,
wParam
,
(
EDITSTREAM
*
)
lParam
);
return
ME_StreamIn
(
editor
,
wParam
,
(
EDITSTREAM
*
)
lParam
,
TRUE
);
case
EM_STREAMOUT
:
return
ME_StreamOut
(
editor
,
wParam
,
(
EDITSTREAM
*
)
lParam
);
case
WM_GETDLGCODE
:
...
...
@@ -2435,7 +2449,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
gds
.
nLength
=
0
;
es
.
dwCookie
=
(
DWORD
)
&
gds
;
es
.
pfnCallback
=
dwFormat
==
SF_RTF
?
ME_ReadFromHGLOBALRTF
:
ME_ReadFromHGLOBALUnicode
;
ME_StreamIn
(
editor
,
dwFormat
|
SFF_SELECTION
,
&
es
);
ME_StreamIn
(
editor
,
dwFormat
|
SFF_SELECTION
,
&
es
,
FALSE
);
CloseClipboard
();
return
0
;
...
...
dlls/riched20/tests/editor.c
View file @
7148f92c
...
...
@@ -2377,15 +2377,11 @@ static void test_EM_STREAMIN(void)
(
WPARAM
)(
SF_RTF
),
(
LPARAM
)
&
es
);
result
=
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
todo_wine
{
ok
(
result
==
12
,
"EM_STREAMIN: Test 0-a returned %ld, expected 12
\n
"
,
result
);
}
result
=
strcmp
(
buffer
,
"TestSomeText"
);
todo_wine
{
ok
(
result
==
0
,
"EM_STREAMIN: Test 0-a set wrong text: Result: %s
\n
"
,
buffer
);
}
/* Native richedit 2.0 ignores last \par, next-to-last \par appears */
es
.
dwCookie
=
(
DWORD_PTR
)
&
streamText0b
;
...
...
@@ -2395,15 +2391,11 @@ static void test_EM_STREAMIN(void)
(
WPARAM
)(
SF_RTF
),
(
LPARAM
)
&
es
);
result
=
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
todo_wine
{
ok
(
result
==
14
,
"EM_STREAMIN: Test 0-b returned %ld, expected 14
\n
"
,
result
);
}
result
=
strcmp
(
buffer
,
"TestSomeText
\r\n
"
);
todo_wine
{
ok
(
result
==
0
,
"EM_STREAMIN: Test 0-b set wrong text: Result: %s
\n
"
,
buffer
);
}
es
.
dwCookie
=
(
DWORD_PTR
)
&
streamText1
;
es
.
dwError
=
0
;
...
...
@@ -2412,15 +2404,11 @@ static void test_EM_STREAMIN(void)
(
WPARAM
)(
SF_RTF
),
(
LPARAM
)
&
es
);
result
=
SendMessage
(
hwndRichEdit
,
WM_GETTEXT
,
1024
,
(
LPARAM
)
buffer
);
todo_wine
{
ok
(
result
==
12
,
"EM_STREAMIN: Test 1 returned %ld, expected 12
\n
"
,
result
);
}
result
=
strcmp
(
buffer
,
"TestSomeText"
);
todo_wine
{
ok
(
result
==
0
,
"EM_STREAMIN: Test 1 set wrong text: Result: %s
\n
"
,
buffer
);
}
es
.
dwCookie
=
(
DWORD_PTR
)
&
streamText2
;
SendMessage
(
hwndRichEdit
,
EM_STREAMIN
,
...
...
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