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

Alexandre Julliard julliard at winehq.org
Mon Mar 17 10:46:35 CDT 2008


Module: wine
Branch: master
Commit: 9c6c9d63a2e3a118b647f116a0bba9f4df85958c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9c6c9d63a2e3a118b647f116a0bba9f4df85958c

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Sun Mar 16 21:47:39 2008 +0100

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

---

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

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 0ad55ea..d472e0f 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -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:
diff --git a/dlls/riched20/para.c b/dlls/riched20/para.c
index fcf2dca..4fb24e9 100644
--- a/dlls/riched20/para.c
+++ b/dlls/riched20/para.c
@@ -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;
diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c
index 149e556..43b2a96 100644
--- a/dlls/riched20/style.c
+++ b/dlls/riched20/style.c
@@ -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




More information about the wine-cvs mailing list