X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fa2f57be4db838388659fe48dbf5546daf5364f8..795b0f144495454aac0dc23e865f7a8f87f6dfa3:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index d57e3eca0b..16a0ef075b 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -2410,9 +2410,12 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) // the real height in twips and not the negative number which // wxFillLogFont() returns (this is correct in general and works with // the Windows font mapper, but not here) + + wxFont font(style.GetFont()); + LOGFONT lf; - wxFillLogFont(&lf, &style.GetFont()); - cf.yHeight = 20*style.GetFont().GetPointSize(); // 1 pt = 20 twips + wxFillLogFont(&lf, &font); + cf.yHeight = 20*font.GetPointSize(); // 1 pt = 20 twips cf.bCharSet = lf.lfCharSet; cf.bPitchAndFamily = lf.lfPitchAndFamily; wxStrncpy( cf.szFaceName, lf.lfFaceName, WXSIZEOF(cf.szFaceName) );