]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/settings.cpp
Swap client data pointers in wxRearrangeList too.
[wxWidgets.git] / src / gtk / settings.cpp
index 6e5e0f363f21e95c4cd16766f1cbd5515296222a..7de06c56e34fdf9535462bc6bb9776eff7adec82 100644 (file)
@@ -19,6 +19,7 @@
 #endif
 
 #include "wx/fontutil.h"
+#include "wx/fontenum.h"
 
 #include <gtk/gtk.h>
 #include "wx/gtk/private/win_gtk.h"
@@ -227,11 +228,12 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index )
 
         case wxSYS_COLOUR_MAX:
         default:
-            wxFAIL_MSG( _T("unknown system colour index") );
+            wxFAIL_MSG( wxT("unknown system colour index") );
             color = *wxWHITE;
             break;
     }
 
+    wxASSERT(color.IsOk());
     return color;
 }
 
@@ -255,6 +257,13 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
                 wxNativeFontInfo info;
                 info.description = ButtonStyle()->font_desc;
                 gs_fontSystem = wxFont(info);
+
+                // (try to) heal the default font (on some common systems e.g. Ubuntu
+                // it's "Sans Serif" but the real font is called "Sans"):
+                if (!wxFontEnumerator::IsValidFacename(gs_fontSystem.GetFaceName()) &&
+                    gs_fontSystem.GetFaceName() == "Sans Serif")
+                    gs_fontSystem.SetFaceName("Sans");
+
                 info.description = NULL;
             }
             font = gs_fontSystem;
@@ -263,6 +272,9 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
         default:
             break;
     }
+
+    wxASSERT(font.IsOk() && wxFontEnumerator::IsValidFacename(font.GetFaceName()));
+
     return font;
 }