make sure native font exists, before asking about fixed width

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71810 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2012-06-20 10:34:30 +00:00
parent 2979ddbe2f
commit 372d999e64

View 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();
}