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
17b7cde0
Commit
17b7cde0
authored
Jun 05, 2017
by
Huw Davies
Committed by
Alexandre Julliard
Jun 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: The background colour is set using \highlight.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d2ec6110
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
4 deletions
+20
-4
reader.c
dlls/riched20/reader.c
+1
-1
editor.c
dlls/riched20/tests/editor.c
+18
-2
writer.c
dlls/riched20/writer.c
+1
-1
No files found.
dlls/riched20/reader.c
View file @
17b7cde0
...
...
@@ -1377,7 +1377,7 @@ static RTFKey rtfKey[] =
{
rtfCharAttr
,
rtfSuperScrShrink
,
"super"
,
0
},
{
rtfCharAttr
,
rtfInvisible
,
"v"
,
0
},
{
rtfCharAttr
,
rtfForeColor
,
"cf"
,
0
},
{
rtfCharAttr
,
rtfBackColor
,
"
cb"
,
0
},
{
rtfCharAttr
,
rtfBackColor
,
"
highlight"
,
0
},
{
rtfCharAttr
,
rtfRTLChar
,
"rtlch"
,
0
},
{
rtfCharAttr
,
rtfLTRChar
,
"ltrch"
,
0
},
{
rtfCharAttr
,
rtfCharStyleNum
,
"cs"
,
0
},
...
...
dlls/riched20/tests/editor.c
View file @
17b7cde0
...
...
@@ -8537,19 +8537,23 @@ static void test_WM_GETTEXTLENGTH(void)
DestroyWindow
(
hwndRichEdit
);
}
static
void
test_rtf
_specials
(
void
)
static
void
test_rtf
(
void
)
{
const
char
*
specials
=
"{
\\
rtf1
\\
emspace
\\
enspace
\\
bullet
\\
lquote"
"
\\
rquote
\\
ldblquote
\\
rdblquote
\\
ltrmark
\\
rtlmark
\\
zwj
\\
zwnj}"
;
const
WCHAR
expect_specials
[]
=
{
' '
,
' '
,
0x2022
,
0x2018
,
0x2019
,
0x201c
,
0x201d
,
0x200e
,
0x200f
,
0x200d
,
0x200c
};
const
char
*
pard
=
"{
\\
rtf1 ABC
\\
rtlpar
\\
par DEF
\\
par HIJ
\\
pard
\\
par}"
;
const
char
*
highlight
=
"{
\\
rtf1{
\\
colortbl;
\\
red0
\\
green0
\\
blue0;
\\
red128
\\
green128
\\
blue128;
\\
red192
\\
green192
\\
blue192;}
\\
cf2
\\
highlight3 foo
\\
par}"
;
HWND
edit
=
new_richeditW
(
NULL
);
EDITSTREAM
es
;
WCHAR
buf
[
80
];
LRESULT
result
;
PARAFORMAT2
fmt
;
CHARFORMAT2W
cf
;
/* Test rtf specials */
es
.
dwCookie
=
(
DWORD_PTR
)
&
specials
;
es
.
dwError
=
0
;
es
.
pfnCallback
=
test_EM_STREAMIN_esCallback
;
...
...
@@ -8580,6 +8584,18 @@ static void test_rtf_specials(void)
ok
(
fmt
.
dwMask
&
PFM_RTLPARA
,
"rtl para mask not set
\n
"
);
ok
(
!
(
fmt
.
wEffects
&
PFE_RTLPARA
),
"rtl para set
\n
"
);
/* Test \highlight */
es
.
dwCookie
=
(
DWORD_PTR
)
&
highlight
;
result
=
SendMessageA
(
edit
,
EM_STREAMIN
,
SF_RTF
,
(
LPARAM
)
&
es
);
ok
(
result
==
3
,
"got %ld
\n
"
,
result
);
SendMessageW
(
edit
,
EM_SETSEL
,
1
,
1
);
memset
(
&
cf
,
0
,
sizeof
(
cf
)
);
cf
.
cbSize
=
sizeof
(
cf
);
SendMessageW
(
edit
,
EM_GETCHARFORMAT
,
SCF_SELECTION
,
(
LPARAM
)
&
cf
);
ok
(
(
cf
.
dwEffects
&
(
CFE_AUTOCOLOR
|
CFE_AUTOBACKCOLOR
))
==
0
,
"got %08x
\n
"
,
cf
.
dwEffects
);
ok
(
cf
.
crTextColor
==
RGB
(
128
,
128
,
128
),
"got %08x
\n
"
,
cf
.
crTextColor
);
ok
(
cf
.
crBackColor
==
RGB
(
192
,
192
,
192
),
"got %08x
\n
"
,
cf
.
crBackColor
);
DestroyWindow
(
edit
);
}
...
...
@@ -8769,7 +8785,7 @@ START_TEST( editor )
test_EM_SETREADONLY
();
test_EM_SETFONTSIZE
();
test_alignment_style
();
test_rtf
_specials
();
test_rtf
();
test_background
();
test_eop_char_fmt
();
test_para_numbering
();
...
...
dlls/riched20/writer.c
View file @
17b7cde0
...
...
@@ -775,7 +775,7 @@ ME_StreamOutRTFCharProps(ME_OutStream *pStream, CHARFORMAT2W *fmt)
{
if
(
fmt
->
dwEffects
&
CFE_AUTOBACKCOLOR
)
i
=
0
;
else
find_color_in_colortbl
(
pStream
,
fmt
->
crBackColor
,
&
i
);
sprintf
(
props
+
strlen
(
props
),
"
\\
cb
%u"
,
i
);
sprintf
(
props
+
strlen
(
props
),
"
\\
highlight
%u"
,
i
);
}
if
((
old_fmt
->
dwEffects
^
fmt
->
dwEffects
)
&
CFE_AUTOCOLOR
||
(
!
(
fmt
->
dwEffects
&
CFE_AUTOCOLOR
)
&&
old_fmt
->
crTextColor
!=
fmt
->
crTextColor
))
...
...
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