riched20: \pard resets the reading direction.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-03-10 11:59:41 +00:00 committed by Alexandre Julliard
parent 5b7c9ecd09
commit ac5edd1b6b
2 changed files with 24 additions and 1 deletions

View File

@ -553,7 +553,7 @@ void ME_RTFParAttrHook(RTF_Info *info)
info->borderType = RTFBorderParaTop;
info->fmt.dwMask = PFM_ALIGNMENT | PFM_BORDER | PFM_LINESPACING | PFM_TABSTOPS |
PFM_OFFSET | PFM_RIGHTINDENT | PFM_SPACEAFTER | PFM_SPACEBEFORE |
PFM_STARTINDENT;
PFM_STARTINDENT | PFM_RTLPARA;
/* TODO: numbering, shading */
info->fmt.wAlignment = PFA_LEFT;
info->fmt.cTabCount = 0;
@ -563,6 +563,7 @@ void ME_RTFParAttrHook(RTF_Info *info)
info->fmt.bLineSpacingRule = 0;
info->fmt.dySpaceBefore = info->fmt.dySpaceAfter = 0;
info->fmt.dyLineSpacing = 0;
info->fmt.wEffects &= ~PFE_RTLPARA;
if (!info->editor->bEmulateVersion10) /* v4.1 */
{
if (info->tableDef && info->tableDef->tableRowStart &&

View File

@ -8284,10 +8284,12 @@ static void test_rtf_specials(void)
"\\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}";
HWND edit = new_richeditW( NULL );
EDITSTREAM es;
WCHAR buf[80];
LRESULT result;
PARAFORMAT2 fmt;
es.dwCookie = (DWORD_PTR)&specials;
es.dwError = 0;
@ -8299,6 +8301,26 @@ static void test_rtf_specials(void)
ok( result == sizeof(expect_specials)/sizeof(expect_specials[0]), "got %ld\n", result );
ok( !memcmp( buf, expect_specials, sizeof(expect_specials) ), "got %s\n", wine_dbgstr_w(buf) );
/* Show that \rtlpar propagates to the second paragraph and is
reset by \pard in the third. */
es.dwCookie = (DWORD_PTR)&pard;
result = SendMessageA( edit, EM_STREAMIN, SF_RTF, (LPARAM)&es );
ok( result == 11, "got %ld\n", result );
fmt.cbSize = sizeof(fmt);
SendMessageW( edit, EM_SETSEL, 1, 1 );
SendMessageW( edit, EM_GETPARAFORMAT, 0, (LPARAM)&fmt );
ok( fmt.dwMask & PFM_RTLPARA, "rtl para mask not set\n" );
ok( fmt.wEffects & PFE_RTLPARA, "rtl para not set\n" );
SendMessageW( edit, EM_SETSEL, 5, 5 );
SendMessageW( edit, EM_GETPARAFORMAT, 0, (LPARAM)&fmt );
ok( fmt.dwMask & PFM_RTLPARA, "rtl para mask not set\n" );
ok( fmt.wEffects & PFE_RTLPARA, "rtl para not set\n" );
SendMessageW( edit, EM_SETSEL, 9, 9 );
SendMessageW( edit, EM_GETPARAFORMAT, 0, (LPARAM)&fmt );
ok( fmt.dwMask & PFM_RTLPARA, "rtl para mask not set\n" );
ok( !(fmt.wEffects & PFE_RTLPARA), "rtl para set\n" );
DestroyWindow( edit );
}