Fixing crash due to referencing a NULL m_font.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28054 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier
2004-06-28 19:02:16 +00:00
parent 84be293d47
commit 1711ac7b90

View File

@@ -859,9 +859,10 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant )
void wxWindowMac::MacUpdateControlFont() void wxWindowMac::MacUpdateControlFont()
{ {
ControlFontStyleRec fontStyle; ControlFontStyleRec fontStyle;
if ( m_font.MacGetThemeFontID() != kThemeCurrentPortFont ) wxFont myfont = GetFont();
if ( myfont.MacGetThemeFontID() != kThemeCurrentPortFont )
{ {
switch( m_font.MacGetThemeFontID() ) switch( myfont.MacGetThemeFontID() )
{ {
case kThemeSmallSystemFont : fontStyle.font = kControlFontSmallSystemFont ; break ; case kThemeSmallSystemFont : fontStyle.font = kControlFontSmallSystemFont ; break ;
case 109 /*mini font */ : fontStyle.font = -5 ; break ; case 109 /*mini font */ : fontStyle.font = -5 ; break ;
@@ -872,9 +873,9 @@ void wxWindowMac::MacUpdateControlFont()
} }
else else
{ {
fontStyle.font = m_font.MacGetFontNum() ; fontStyle.font = myfont.MacGetFontNum() ;
fontStyle.style = m_font.MacGetFontStyle() ; fontStyle.style = myfont.MacGetFontStyle() ;
fontStyle.size = m_font.MacGetFontSize() ; fontStyle.size = myfont.MacGetFontSize() ;
fontStyle.flags = kControlUseFontMask | kControlUseFaceMask | kControlUseSizeMask ; fontStyle.flags = kControlUseFontMask | kControlUseFaceMask | kControlUseSizeMask ;
} }