]> git.saurik.com Git - wxWidgets.git/commitdiff
make sure native font exists, before asking about fixed width
authorStefan Csomor <csomor@advancedconcepts.ch>
Wed, 20 Jun 2012 10:34:30 +0000 (10:34 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Wed, 20 Jun 2012 10:34:30 +0000 (10:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/font.cpp

index 11853c8e5ee7511bd05afbc382190cab9f446632..a0a345c38f3c7add90a5b6cb4c2bc867d6c8c4ac 100644 (file)
@@ -742,8 +742,11 @@ wxSize wxFont::GetPixelSize() const
 
 bool wxFont::IsFixedWidth() const
 {
-    wxCHECK_MSG( M_FONTDATA != NULL , wxFONTWEIGHT_MAX, wxT("invalid font") );
+    wxCHECK_MSG( M_FONTDATA != NULL , false, wxT("invalid font") );
     
+    // cast away constness otherwise lazy font resolution is not possible
+    const_cast<wxFont *>(this)->RealizeResource();
+
     return M_FONTDATA->IsFixedWidth();
 }