richedit: Uniformly handle the bPitchAndFamily field out of CHARFORMAT.

This commit is contained in:
Eric Pouech 2008-01-04 21:12:20 +01:00 committed by Alexandre Julliard
parent cb4f8a80de
commit d65daea454
3 changed files with 5 additions and 2 deletions

View File

@ -419,6 +419,7 @@ static void ME_RTFCharAttrHook(RTF_Info *info)
fmt.szFaceName[sizeof(fmt.szFaceName)/sizeof(WCHAR)-1] = '\0'; fmt.szFaceName[sizeof(fmt.szFaceName)/sizeof(WCHAR)-1] = '\0';
fmt.bCharSet = f->rtfFCharSet; fmt.bCharSet = f->rtfFCharSet;
fmt.dwMask = CFM_FACE | CFM_CHARSET; fmt.dwMask = CFM_FACE | CFM_CHARSET;
fmt.bPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
} }
} }
break; break;

View File

@ -950,7 +950,8 @@ void ME_GetCharFormat(ME_TextEditor *editor, int nFrom, int nTo, CHARFORMAT2W *p
{ {
if (!(tmp.dwMask & CFM_FACE)) if (!(tmp.dwMask & CFM_FACE))
pFmt->dwMask &= ~CFM_FACE; pFmt->dwMask &= ~CFM_FACE;
else if (lstrcmpW(pFmt->szFaceName, tmp.szFaceName)) else if (lstrcmpW(pFmt->szFaceName, tmp.szFaceName) ||
pFmt->bPitchAndFamily != tmp.bPitchAndFamily)
pFmt->dwMask &= ~CFM_FACE; pFmt->dwMask &= ~CFM_FACE;
} }
if (pFmt->yHeight != tmp.yHeight) if (pFmt->yHeight != tmp.yHeight)

View File

@ -320,7 +320,8 @@ ME_LogFontFromStyle(ME_Context* c, LOGFONTW *lf, const ME_Style *s)
if (s->fmt.dwEffects & s->fmt.dwMask & (CFM_SUBSCRIPT|CFM_SUPERSCRIPT)) if (s->fmt.dwEffects & s->fmt.dwMask & (CFM_SUBSCRIPT|CFM_SUPERSCRIPT))
lf->lfHeight = (lf->lfHeight*2)/3; lf->lfHeight = (lf->lfHeight*2)/3;
/*lf.lfQuality = PROOF_QUALITY; */ /*lf.lfQuality = PROOF_QUALITY; */
lf->lfPitchAndFamily = s->fmt.bPitchAndFamily; if (s->fmt.dwMask & CFM_FACE)
lf->lfPitchAndFamily = s->fmt.bPitchAndFamily;
if (s->fmt.dwMask & CFM_CHARSET) if (s->fmt.dwMask & CFM_CHARSET)
lf->lfCharSet = s->fmt.bCharSet; lf->lfCharSet = s->fmt.bCharSet;
} }