]> git.saurik.com Git - wxWidgets.git/commitdiff
Only use fonts in wxTextAttr::Combine if they are really present in the attributes.
authorJulian Smart <julian@anthemion.co.uk>
Fri, 7 Mar 2008 08:55:12 +0000 (08:55 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 7 Mar 2008 08:55:12 +0000 (08:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52365 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/textcmn.cpp

index 46741123c2ed8e62ab10a6ff6f237c5dedd6dac0..1e0a0a0f5677a9a6363fb1c8b59f76e2fcd95d77 100644 (file)
@@ -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();