]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/settings.cpp
disable warning about _set_se_translator() requiring /EHa for VC9 too (it was disable...
[wxWidgets.git] / src / msw / settings.cpp
index 476873b4af9ef8cf45a4ece9d83a85041c7198a3..e627033416467762824e0e5bda30b5fb6c7b29a3 100644 (file)
@@ -40,6 +40,7 @@
 #endif
 
 #include "wx/fontutil.h"
+#include "wx/fontenum.h"
 
 // ----------------------------------------------------------------------------
 // private classes
@@ -127,7 +128,12 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         0,          // MENUBAR (unused)
     };
 
-    if ( index == wxSYS_COLOUR_LISTBOX )
+    if ( index == wxSYS_COLOUR_LISTBOXTEXT)
+    {
+        // there is no standard colour with this index, map to another one
+        index = wxSYS_COLOUR_WINDOWTEXT;
+    }
+    else if ( index == wxSYS_COLOUR_LISTBOX )
     {
         // there is no standard colour with this index, map to another one
         index = wxSYS_COLOUR_WINDOW;
@@ -202,8 +208,10 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index)
         colSys = ::GetSysColor(index);
 #endif
     }
-
-    return wxRGBToColour(colSys);
+    
+    wxColour ret = wxRGBToColour(colSys);
+    wxASSERT(ret.IsOk());
+    return ret;
 }
 
 // ----------------------------------------------------------------------------
@@ -262,6 +270,8 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
         gs_fontDefault = new wxFont(wxCreateFontFromStockObject(SYSTEM_FONT));
     }
 
+    wxASSERT(gs_fontDefault->IsOk() && 
+             wxFontEnumerator::IsValidFacename(gs_fontDefault->GetFaceName()));
     return *gs_fontDefault;
 #else // !__WXWINCE__
     // wxWindow ctor calls GetFont(wxSYS_DEFAULT_GUI_FONT) so we're
@@ -281,6 +291,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
         gs_fontDefault = new wxFont(font);
     }
 
+    wxASSERT(font.IsOk() && wxFontEnumerator::IsValidFacename(font.GetFaceName()));
     return font;
 #endif // __WXWINCE__/!__WXWINCE__
 }