X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c40766261bb2ee37b450a25346dac138f48088c7..4d425deeb2ff4abe56e7b9cc85fa4e216ec94b36:/src/common/textcmn.cpp diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index 46741123c2..c69ba3aea1 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -297,8 +297,11 @@ bool wxTextAttr::EqPartial(const wxTextAttr& attr, int flags) const } // Create font from font attributes. -wxFont wxTextAttr::CreateFont() const +wxFont wxTextAttr::GetFont() const { + if ( !HasFont() ) + return wxNullFont; + int fontSize = 10; if (HasFontSize()) fontSize = GetFontSize(); @@ -542,10 +545,14 @@ wxTextAttr wxTextAttr::Combine(const wxTextAttr& attr, const wxTextAttr& attrDef, const wxTextCtrlBase *text) { - wxFont font = attr.GetFont(); + wxFont font; + if (attr.HasFont()) + font = attr.GetFont(); + if ( !font.Ok() ) { - font = attrDef.GetFont(); + if (attrDef.HasFont()) + font = attrDef.GetFont(); if ( text && !font.Ok() ) font = text->GetFont();