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

This commit is contained in:
Eric Pouech 2008-03-16 21:47:39 +01:00 committed by Alexandre Julliard
parent 6e02f5db4b
commit 9c6c9d63a2
3 changed files with 5 additions and 5 deletions

View File

@ -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.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR;
fmt.yHeight = 12*20; /* 12pt */
fmt.wWeight = 400;
fmt.wWeight = FW_NORMAL;
fmt.bUnderlineType = CFU_UNDERLINENONE;
break;
case rtfBold:

View File

@ -55,7 +55,7 @@ void ME_MakeFirstParagraph(ME_TextEditor *editor)
cf.dwEffects = CFE_AUTOCOLOR | CFE_AUTOBACKCOLOR;
lstrcpyW(cf.szFaceName, lf.lfFaceName);
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;
if (lf.lfItalic) cf.dwEffects |= CFE_ITALIC;
cf.bUnderlineType = (lf.lfUnderline) ? CFU_CF1UNDERLINE : CFU_UNDERLINENONE;

View File

@ -303,9 +303,9 @@ ME_LogFontFromStyle(ME_Context* c, LOGFONTW *lf, const ME_Style *s)
lf->lfHeight = ME_twips2pointsY(c, -s->fmt.yHeight);
lf->lfWeight = 400;
lf->lfWeight = FW_NORMAL;
if (s->fmt.dwEffects & s->fmt.dwMask & CFM_BOLD)
lf->lfWeight = 700;
lf->lfWeight = FW_BOLD;
if (s->fmt.dwMask & CFM_WEIGHT)
lf->lfWeight = s->fmt.wWeight;
if (s->fmt.dwEffects & s->fmt.dwMask & CFM_ITALIC)
@ -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->wWeight = lf->lfWeight;
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->lfUnderline) fmt->dwEffects |= CFM_UNDERLINE;
/* notice that if a logfont was created with underline due to CFM_LINK, this