From: Julian Smart Date: Fri, 7 Mar 2008 08:55:12 +0000 (+0000) Subject: Only use fonts in wxTextAttr::Combine if they are really present in the attributes. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7c3c990ecf8be60d40e6b6ac3835064daee321aa Only use fonts in wxTextAttr::Combine if they are really present in the attributes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index 46741123c2..1e0a0a0f56 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -542,10 +542,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();