Commit cb1d7bec authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

richedit: Fixed bug preventing bold from being set with EM_SETCHARFORMAT.

Previously bold needed to be set by setting CFM_WEIGHT in the CHARFORMAT2 structure, and then setting the appropriate wWeight value. This approach isn't even supported in version 3.0 of the richedit control. Now bold can be set/unset properly for Windows or Wine using CFE_BOLD in dwEffects and with CFM_BOLD set in the dwMask flag.
parent 60757ca6
......@@ -221,6 +221,15 @@ ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style)
s->fmt.bUnderlineType = (style->dwEffects & CFM_UNDERLINE) ?
CFU_CF1UNDERLINE : CFU_UNDERLINENONE;
}
if (style->dwMask & CFM_BOLD && !(style->dwMask & CFM_WEIGHT))
{
s->fmt.wWeight = (style->dwEffects & CFE_BOLD) ? FW_BOLD : FW_NORMAL;
} else if (style->dwMask & CFM_WEIGHT && !(style->dwMask & CFM_BOLD)) {
if (style->wWeight > FW_NORMAL)
s->fmt.dwEffects |= CFE_BOLD;
else
s->fmt.dwEffects &= ~CFE_BOLD;
}
return s;
}
......
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