Commit 9c6c9d63 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

richedit: Use the FW_ constants instead of the raw values.

parent 6e02f5db
...@@ -336,7 +336,7 @@ static void ME_RTFCharAttrHook(RTF_Info *info) ...@@ -336,7 +336,7 @@ static void ME_RTFCharAttrHook(RTF_Info *info)
fmt.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINETYPE | CFM_STRIKEOUT | CFM_COLOR | CFM_BACKCOLOR | CFM_SIZE | CFM_WEIGHT; fmt.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINETYPE | CFM_STRIKEOUT | CFM_COLOR | CFM_BACKCOLOR | CFM_SIZE | CFM_WEIGHT;
fmt.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR; fmt.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR;
fmt.yHeight = 12*20; /* 12pt */ fmt.yHeight = 12*20; /* 12pt */
fmt.wWeight = 400; fmt.wWeight = FW_NORMAL;
fmt.bUnderlineType = CFU_UNDERLINENONE; fmt.bUnderlineType = CFU_UNDERLINENONE;
break; break;
case rtfBold: case rtfBold:
......
...@@ -55,7 +55,7 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor) ...@@ -55,7 +55,7 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
cf.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR; cf.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR;
lstrcpyW(cf.szFaceName, lf.lfFaceName); lstrcpyW(cf.szFaceName, lf.lfFaceName);
cf.yHeight = ME_twips2pointsY(&c, lf.lfHeight); cf.yHeight = ME_twips2pointsY(&c, lf.lfHeight);
if (lf.lfWeight >= 700) cf.dwEffects |= CFE_BOLD; if (lf.lfWeight > FW_NORMAL) cf.dwEffects |= CFE_BOLD;
cf.wWeight = lf.lfWeight; cf.wWeight = lf.lfWeight;
if (lf.lfItalic) cf.dwEffects |= CFE_ITALIC; if (lf.lfItalic) cf.dwEffects |= CFE_ITALIC;
cf.bUnderlineType = (lf.lfUnderline) ? CFU_CF1UNDERLINE : CFU_UNDERLINENONE; cf.bUnderlineType = (lf.lfUnderline) ? CFU_CF1UNDERLINE : CFU_UNDERLINENONE;
......
...@@ -303,9 +303,9 @@ ME_LogFontFromStyle(ME_Context* c, LOGFONTW *lf, const ME_Style *s) ...@@ -303,9 +303,9 @@ ME_LogFontFromStyle(ME_Context* c, LOGFONTW *lf, const ME_Style *s)
lf->lfHeight = ME_twips2pointsY(c, -s->fmt.yHeight); lf->lfHeight = ME_twips2pointsY(c, -s->fmt.yHeight);
lf->lfWeight = 400; lf->lfWeight = FW_NORMAL;
if (s->fmt.dwEffects & s->fmt.dwMask & CFM_BOLD) if (s->fmt.dwEffects & s->fmt.dwMask & CFM_BOLD)
lf->lfWeight = 700; lf->lfWeight = FW_BOLD;
if (s->fmt.dwMask & CFM_WEIGHT) if (s->fmt.dwMask & CFM_WEIGHT)
lf->lfWeight = s->fmt.wWeight; lf->lfWeight = s->fmt.wWeight;
if (s->fmt.dwEffects & s->fmt.dwMask & CFM_ITALIC) if (s->fmt.dwEffects & s->fmt.dwMask & CFM_ITALIC)
...@@ -337,7 +337,7 @@ void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt) ...@@ -337,7 +337,7 @@ void ME_CharFormatFromLogFont(HDC hDC, const LOGFONTW *lf, CHARFORMAT2W *fmt)
fmt->dwMask = CFM_WEIGHT|CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT|CFM_SIZE|CFM_FACE|CFM_CHARSET; fmt->dwMask = CFM_WEIGHT|CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT|CFM_SIZE|CFM_FACE|CFM_CHARSET;
fmt->wWeight = lf->lfWeight; fmt->wWeight = lf->lfWeight;
fmt->yHeight = -lf->lfHeight*1440/ry; fmt->yHeight = -lf->lfHeight*1440/ry;
if (lf->lfWeight>400) fmt->dwEffects |= CFM_BOLD; if (lf->lfWeight > FW_NORMAL) fmt->dwEffects |= CFM_BOLD;
if (lf->lfItalic) fmt->dwEffects |= CFM_ITALIC; if (lf->lfItalic) fmt->dwEffects |= CFM_ITALIC;
if (lf->lfUnderline) fmt->dwEffects |= CFM_UNDERLINE; if (lf->lfUnderline) fmt->dwEffects |= CFM_UNDERLINE;
/* notice that if a logfont was created with underline due to CFM_LINK, this /* notice that if a logfont was created with underline due to CFM_LINK, this
......
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