Module: wine Branch: master Commit: 43ad427a15cbefcd24982781cab5dd099a168be3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=43ad427a15cbefcd24982781ca...
Author: Dylan Smith dylan.ah.smith@gmail.com Date: Fri Jul 11 20:05:57 2008 -0400
richedit: Enforce the maximum font size.
Trying to set the font size to a value larger than 1638 in points (yHeightCharPtsMost) using EM_SETCHARFORMAT will cause it to be set to actually set to the maximum.
---
dlls/riched20/style.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c index 66e45f5..b7dae3e 100644 --- a/dlls/riched20/style.c +++ b/dlls/riched20/style.c @@ -197,7 +197,10 @@ ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style) COPY_STYLE_ITEM(CFM_LCID, lcid); COPY_STYLE_ITEM(CFM_OFFSET, yOffset); COPY_STYLE_ITEM(CFM_REVAUTHOR, bRevAuthor); - COPY_STYLE_ITEM(CFM_SIZE, yHeight); + if (style->dwMask & CFM_SIZE) { + s->fmt.dwMask |= CFM_SIZE; + s->fmt.yHeight = min(style->yHeight, yHeightCharPtsMost * 20); + } COPY_STYLE_ITEM(CFM_SPACING, sSpacing); COPY_STYLE_ITEM(CFM_STYLE, sStyle); COPY_STYLE_ITEM(CFM_UNDERLINETYPE, bUnderlineType);