]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/dcclient.cpp
wxMSW update for CW, wxMac updated
[wxWidgets.git] / src / gtk / dcclient.cpp
index fd0105435aceaf2daa1f7ff0ff4e9dcd8b19248b..17d8ea2baa496dd7cf88d63b64cbae9a65994ac9 100644 (file)
 #include "wx/dcmemory.h"
 #include "wx/image.h"
 #include "wx/gtk/win_gtk.h"
-#include <math.h>               // for floating-point functions
 
-#include "gdk/gdk.h"
-#include "gtk/gtk.h"
+#include <math.h>               // for floating-point functions
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
 
 //-----------------------------------------------------------------------------
 // local data
@@ -813,12 +813,16 @@ void wxWindowDC::DoGetTextExtent(const wxString &string,
 wxCoord wxWindowDC::GetCharWidth() const
 {
     GdkFont *font = m_font.GetInternalFont( m_scaleY );
+    wxCHECK_MSG( font, -1, _T("invalid font") );
+
     return wxCoord(gdk_string_width( font, "H" ) / m_scaleX);
 }
 
 wxCoord wxWindowDC::GetCharHeight() const
 {
     GdkFont *font = m_font.GetInternalFont( m_scaleY );
+    wxCHECK_MSG( font, -1, _T("invalid font") );
+
     return wxCoord((font->ascent + font->descent) / m_scaleY);
 }