Commit 3ac78b76 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

riched20: Initialize the remaining CHARFORMAT2 members.

parent b21f4d07
......@@ -52,11 +52,12 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
GetObjectW(hf, sizeof(LOGFONTW), &lf);
ZeroMemory(&cf, sizeof(cf));
cf.cbSize = sizeof(cf);
cf.dwMask = CFM_BACKCOLOR|CFM_COLOR|CFM_FACE|CFM_SIZE|CFM_CHARSET;
cf.dwMask = CFM_ANIMATION|CFM_BACKCOLOR|CFM_CHARSET|CFM_COLOR|CFM_FACE|CFM_KERNING|CFM_LCID|CFM_OFFSET;
cf.dwMask |= CFM_REVAUTHOR|CFM_SIZE|CFM_SPACING|CFM_STYLE|CFM_UNDERLINETYPE|CFM_WEIGHT;
cf.dwMask |= CFM_ALLCAPS|CFM_BOLD|CFM_DISABLED|CFM_EMBOSS|CFM_HIDDEN;
cf.dwMask |= CFM_IMPRINT|CFM_ITALIC|CFM_LINK|CFM_OUTLINE|CFM_PROTECTED;
cf.dwMask |= CFM_REVISED|CFM_SHADOW|CFM_SMALLCAPS|CFM_STRIKEOUT;
cf.dwMask |= CFM_SUBSCRIPT|CFM_UNDERLINETYPE|CFM_WEIGHT;
cf.dwMask |= CFM_SUBSCRIPT|CFM_UNDERLINE;
cf.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR;
lstrcpyW(cf.szFaceName, lf.lfFaceName);
......@@ -69,6 +70,7 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
if (lf.lfStrikeOut) cf.dwEffects |= CFE_STRIKEOUT;
cf.bPitchAndFamily = lf.lfPitchAndFamily;
cf.bCharSet = lf.lfCharSet;
cf.lcid = GetSystemDefaultLCID();
style = ME_MakeStyle(&cf);
text->pDefaultStyle = style;
......
......@@ -764,11 +764,28 @@ static void test_EM_SETCHARFORMAT(void)
CHARRANGE cr;
LOCALESIGNATURE sig;
BOOL rtl;
DWORD expect_effects;
rtl = (GetLocaleInfoA(LOCALE_USER_DEFAULT, LOCALE_FONTSIGNATURE,
(LPSTR) &sig, sizeof(LOCALESIGNATURE)) &&
(sig.lsUsb[3] & 0x08000000) != 0);
/* check charformat defaults */
memset(&cf2, 0, sizeof(CHARFORMAT2A));
cf2.cbSize = sizeof(CHARFORMAT2A);
SendMessageA(hwndRichEdit, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2);
ok(cf2.dwMask == CFM_ALL2, "got %08x\n", cf2.dwMask);
expect_effects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR;
if (cf2.wWeight > 550) expect_effects |= CFE_BOLD;
ok(cf2.dwEffects == expect_effects, "got %08x\n", cf2.dwEffects);
ok(cf2.yOffset == 0, "got %d\n", cf2.yOffset);
ok(cf2.sSpacing == 0, "got %d\n", cf2.sSpacing);
ok(cf2.lcid == GetSystemDefaultLCID(), "got %x\n", cf2.lcid);
ok(cf2.sStyle == 0, "got %d\n", cf2.sStyle);
ok(cf2.wKerning == 0, "got %d\n", cf2.wKerning);
ok(cf2.bAnimation == 0, "got %d\n", cf2.bAnimation);
ok(cf2.bRevAuthor == 0, "got %d\n", cf2.bRevAuthor);
/* Invalid flags, CHARFORMAT2 structure blanked out */
memset(&cf2, 0, sizeof(cf2));
rc = SendMessageA(hwndRichEdit, EM_SETCHARFORMAT, (WPARAM)0xfffffff0, (LPARAM)&cf2);
......
......@@ -1741,7 +1741,6 @@ static void test_GetFont(void)
value = 0;
hr = ITextFont_GetLanguageID(font, &value);
ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine
ok(value == GetSystemDefaultLCID(), "got lcid %x, user lcid %x\n", value,
GetSystemDefaultLCID());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment