From 43ad427a15cbefcd24982781cab5dd099a168be3 Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Fri, 11 Jul 2008 20:05:57 -0400 Subject: [PATCH] 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 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c index 66e45f5a832..b7dae3e97a5 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);