X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/51b0f3719bdc32358f46bef619d1212901e18b59..47e175a24f862aa8b7ca7dd4a2bb5957991e7f2d:/src/osx/carbon/font.cpp diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index 11853c8e5e..634453ec6a 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -667,7 +667,7 @@ wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const void wxFont::SetPointSize(int pointSize) { - if ( M_FONTDATA->GetPointSize() == pointSize ) + if ( M_FONTDATA != NULL && M_FONTDATA->GetPointSize() == pointSize ) return; AllocExclusive(); @@ -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(this)->RealizeResource(); + return M_FONTDATA->IsFixedWidth(); }