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
bdf181b4
Commit
bdf181b4
authored
Oct 03, 2008
by
Dylan Smith
Committed by
Alexandre Julliard
Oct 06, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Use RTF reader for text starting with {\urtf.
parent
44be6c7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
editor.c
dlls/riched20/editor.c
+6
-4
editor.c
dlls/riched20/tests/editor.c
+22
-0
No files found.
dlls/riched20/editor.c
View file @
bdf181b4
...
...
@@ -2741,8 +2741,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
ME_GetSelection
(
editor
,
&
from
,
&
to
);
style
=
ME_GetSelectionInsertStyle
(
editor
);
ME_InternalDeleteText
(
editor
,
from
,
to
-
from
,
FALSE
);
if
(
pStruct
->
codepage
!=
1200
&&
lParam
&&
!
strncmp
((
char
*
)
lParam
,
"{
\\
rtf"
,
5
))
ME_StreamInRTFString
(
editor
,
1
,
(
char
*
)
lParam
);
if
(
pStruct
->
codepage
!=
1200
&&
lParam
&&
(
!
strncmp
((
char
*
)
lParam
,
"{
\\
rtf"
,
5
)
||
!
strncmp
((
char
*
)
lParam
,
"{
\\
urtf}"
,
6
)))
ME_StreamInRTFString
(
editor
,
1
,
(
char
*
)
lParam
);
else
ME_InsertTextFromCursor
(
editor
,
0
,
wszText
,
len
,
style
);
ME_ReleaseStyle
(
style
);
...
...
@@ -2750,8 +2751,9 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
}
else
{
ME_InternalDeleteText
(
editor
,
0
,
ME_GetTextLength
(
editor
),
FALSE
);
if
(
pStruct
->
codepage
!=
1200
&&
lParam
&&
!
strncmp
((
char
*
)
lParam
,
"{
\\
rtf"
,
5
))
ME_StreamInRTFString
(
editor
,
0
,
(
char
*
)
lParam
);
if
(
pStruct
->
codepage
!=
1200
&&
lParam
&&
(
!
strncmp
((
char
*
)
lParam
,
"{
\\
rtf"
,
5
)
||
!
strncmp
((
char
*
)
lParam
,
"{
\\
urtf}"
,
6
)))
ME_StreamInRTFString
(
editor
,
0
,
(
char
*
)
lParam
);
else
ME_InsertTextFromCursor
(
editor
,
0
,
wszText
,
len
,
editor
->
pBuffer
->
pDefaultStyle
);
len
=
1
;
...
...
dlls/riched20/tests/editor.c
View file @
bdf181b4
...
...
@@ -3522,6 +3522,28 @@ static void test_EM_SETTEXTEX(void)
"EM_GETTEXTEX results not what was set by EM_SETTEXTEX when"
" using ST_SELECTION and non-Unicode
\n
"
);
/* Test setting text using rich text format */
setText
.
flags
=
0
;
setText
.
codepage
=
CP_ACP
;
SendMessage
(
hwndRichEdit
,
EM_SETTEXTEX
,
(
WPARAM
)
&
setText
,
(
LPARAM
)
"{
\\
rtf richtext}"
);
getText
.
codepage
=
CP_ACP
;
getText
.
cb
=
MAX_BUF_LEN
;
getText
.
flags
=
GT_DEFAULT
;
getText
.
lpDefaultChar
=
NULL
;
getText
.
lpUsedDefChar
=
NULL
;
SendMessage
(
hwndRichEdit
,
EM_GETTEXTEX
,
(
WPARAM
)
&
getText
,
(
LPARAM
)
bufACP
);
ok
(
!
strcmp
(
bufACP
,
"richtext"
),
"expected 'richtext' but got '%s'
\n
"
,
bufACP
);
setText
.
flags
=
0
;
setText
.
codepage
=
CP_ACP
;
SendMessage
(
hwndRichEdit
,
EM_SETTEXTEX
,
(
WPARAM
)
&
setText
,
(
LPARAM
)
"{
\\
urtf morerichtext}"
);
getText
.
codepage
=
CP_ACP
;
getText
.
cb
=
MAX_BUF_LEN
;
getText
.
flags
=
GT_DEFAULT
;
getText
.
lpDefaultChar
=
NULL
;
getText
.
lpUsedDefChar
=
NULL
;
SendMessage
(
hwndRichEdit
,
EM_GETTEXTEX
,
(
WPARAM
)
&
getText
,
(
LPARAM
)
bufACP
);
ok
(
!
strcmp
(
bufACP
,
"morerichtext"
),
"expected 'morerichtext' but got '%s'
\n
"
,
bufACP
);
DestroyWindow
(
hwndRichEdit
);
}
...
...
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