[PATCH 4/4] [RichEdit]: uniformely handle the bPitchAndFamily field out of CHARFORMAT

Eric Pouech eric.pouech at orange.fr
Fri Jan 4 14:12:20 CST 2008




A+
---

 dlls/riched20/editor.c |    1 +
 dlls/riched20/run.c    |    3 ++-
 dlls/riched20/style.c  |    3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 43c27d1..85ac5b2 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -419,6 +419,7 @@ static void ME_RTFCharAttrHook(RTF_Info *info)
           fmt.szFaceName[sizeof(fmt.szFaceName)/sizeof(WCHAR)-1] = '\0';
           fmt.bCharSet = f->rtfFCharSet;
           fmt.dwMask = CFM_FACE | CFM_CHARSET;
+          fmt.bPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
         }
       }
       break;
diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c
index 5a3119d..2da891e 100644
--- a/dlls/riched20/run.c
+++ b/dlls/riched20/run.c
@@ -950,7 +950,8 @@ void ME_GetCharFormat(ME_TextEditor *editor, int nFrom, int nTo, CHARFORMAT2W *p
     {
       if (!(tmp.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;
     }
     if (pFmt->yHeight != tmp.yHeight)
diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c
index 453c15b..ba7d6d3 100644
--- a/dlls/riched20/style.c
+++ b/dlls/riched20/style.c
@@ -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))
     lf->lfHeight = (lf->lfHeight*2)/3;
 /*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)
     lf->lfCharSet = s->fmt.bCharSet;
 }





More information about the wine-patches mailing list