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
e1f94386
Commit
e1f94386
authored
Oct 05, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Oct 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Set the format of the final eop to be that of the last char.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2dbcddc6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
1 deletion
+48
-1
editor.c
dlls/riched20/editor.c
+11
-1
editor.c
dlls/riched20/tests/editor.c
+37
-0
No files found.
dlls/riched20/editor.c
View file @
e1f94386
...
...
@@ -1648,7 +1648,17 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
if
(
newto
>
to
+
(
editor
->
bEmulateVersion10
?
1
:
0
))
{
WCHAR
lastchar
[
3
]
=
{
'\0'
,
'\0'
};
int
linebreakSize
=
editor
->
bEmulateVersion10
?
2
:
1
;
ME_Cursor
linebreakCursor
=
*
selEnd
;
ME_Cursor
linebreakCursor
=
*
selEnd
,
lastcharCursor
=
*
selEnd
;
CHARFORMAT2W
cf
;
/* Set the final eop to the char fmt of the last char */
cf
.
cbSize
=
sizeof
(
cf
);
cf
.
dwMask
=
CFM_ALL2
;
ME_MoveCursorChars
(
editor
,
&
lastcharCursor
,
-
1
,
FALSE
);
ME_GetCharFormat
(
editor
,
&
lastcharCursor
,
&
linebreakCursor
,
&
cf
);
ME_SetSelection
(
editor
,
newto
,
-
1
);
ME_SetSelectionCharFormat
(
editor
,
&
cf
);
ME_SetSelection
(
editor
,
newto
,
newto
);
ME_MoveCursorChars
(
editor
,
&
linebreakCursor
,
-
linebreakSize
,
FALSE
);
ME_GetTextW
(
editor
,
lastchar
,
2
,
&
linebreakCursor
,
linebreakSize
,
FALSE
,
FALSE
);
...
...
dlls/riched20/tests/editor.c
View file @
e1f94386
...
...
@@ -8372,6 +8372,42 @@ static void test_background(void)
DestroyWindow
(
hwndRichEdit
);
}
static
void
test_eop_char_fmt
(
void
)
{
HWND
edit
=
new_richedit
(
NULL
);
const
char
*
rtf
=
"{
\\
rtf1{
\\
fonttbl{
\\
f0
\\
fswiss
\\
fprq2
\\
fcharset0 Arial;}{
\\
f1
\\
fnil
\\
fcharset2 Symbol;}}"
"{
\\
fs10{
\\
pard
\\
fs16
\\
fi200
\\
li360
\\
f0 First
\\
par"
"
\\
f0
\\
fs25 Second
\\
par"
"{
\\
f0
\\
fs26 Third}
\\
par"
"{
\\
f0
\\
fs22 Fourth}
\\
par}}}"
;
EDITSTREAM
es
;
CHARFORMAT2W
cf
;
int
i
,
num
,
expect_height
;
es
.
dwCookie
=
(
DWORD_PTR
)
&
rtf
;
es
.
dwError
=
0
;
es
.
pfnCallback
=
test_EM_STREAMIN_esCallback
;
num
=
SendMessageA
(
edit
,
EM_STREAMIN
,
SF_RTF
,
(
LPARAM
)
&
es
);
ok
(
num
==
25
,
"got %d
\n
"
,
num
);
for
(
i
=
0
;
i
<=
num
;
i
++
)
{
SendMessageW
(
edit
,
EM_SETSEL
,
i
,
i
+
1
);
cf
.
cbSize
=
sizeof
(
cf
);
cf
.
dwMask
=
CFM_SIZE
;
SendMessageW
(
edit
,
EM_GETCHARFORMAT
,
SCF_SELECTION
,
(
LPARAM
)
&
cf
);
ok
(
cf
.
dwMask
&
CFM_SIZE
,
"%d: got %08x
\n
"
,
i
,
cf
.
dwMask
);
if
(
i
<
6
)
expect_height
=
160
;
else
if
(
i
<
13
)
expect_height
=
250
;
else
if
(
i
<
18
)
expect_height
=
260
;
else
if
(
i
==
18
||
i
==
25
)
expect_height
=
250
;
else
expect_height
=
220
;
ok
(
cf
.
yHeight
==
expect_height
,
"%d: got %d
\n
"
,
i
,
cf
.
yHeight
);
}
DestroyWindow
(
edit
);
}
START_TEST
(
editor
)
{
BOOL
ret
;
...
...
@@ -8443,6 +8479,7 @@ START_TEST( editor )
test_alignment_style
();
test_rtf_specials
();
test_background
();
test_eop_char_fmt
();
/* Set the environment variable WINETEST_RICHED20 to keep windows
* responsive and open for 30 seconds. This is useful for debugging.
...
...
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