if ( m_nativeFontInfoOk )
return m_nativeFontInfo.SetFaceName(faceName);
- m_faceName = faceName;
+ m_faceName = faceName;
return true;
}
bool m_nativeFontInfoOk;
};
-#define M_FONTDATA (wxFontRefData*)m_refData)
+#define M_FONTDATA ((wxFontRefData*)m_refData)
// ============================================================================
// implementation
wxSize wxFont::GetPixelSize() const
{
+ wxCHECK_MSG( Ok(), wxDefaultSize, wxT("invalid font") );
+
return M_FONTDATA->GetPixelSize();
}
const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
{
- return M_FONTDATA->HasNativeFontInfo() ? &(M_FONTDATA->GetNativeFontInfo())
+ return Ok() && M_FONTDATA->HasNativeFontInfo() ? &(M_FONTDATA->GetNativeFontInfo())
: NULL;
}
wxString wxFont::GetNativeFontInfoDesc() const
{
+ wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") );
+
// be sure we have an HFONT associated...
wxConstCast(this, wxFont)->RealizeResource();
return wxFontBase::GetNativeFontInfoDesc();
wxString wxFont::GetNativeFontInfoUserDesc() const
{
+ wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") );
+
// be sure we have an HFONT associated...
wxConstCast(this, wxFont)->RealizeResource();
return wxFontBase::GetNativeFontInfoUserDesc();