]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixing crash due to referencing a NULL m_font.
authorKevin Ollivier <kevino@theolliviers.com>
Mon, 28 Jun 2004 19:02:16 +0000 (19:02 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Mon, 28 Jun 2004 19:02:16 +0000 (19:02 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28054 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp

index c6cc88f72dc3af807714dd3cf4d7274ce6595e4d..53e18bdc7be1c98a87a8f0509fa11e78c7426e17 100644 (file)
@@ -859,9 +859,10 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant )
 void wxWindowMac::MacUpdateControlFont() 
 {
        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 109 /*mini font */ :       fontStyle.font = -5 ;                           break ;
@@ -872,9 +873,9 @@ void wxWindowMac::MacUpdateControlFont()
        }
        else
        {
-           fontStyle.font = m_font.MacGetFontNum() ;
-           fontStyle.style = m_font.MacGetFontStyle() ;
-           fontStyle.size = m_font.MacGetFontSize() ;
+           fontStyle.font = myfont.MacGetFontNum() ;
+           fontStyle.style = myfont.MacGetFontStyle() ;
+           fontStyle.size = myfont.MacGetFontSize() ;
            fontStyle.flags = kControlUseFontMask | kControlUseFaceMask | kControlUseSizeMask ;
        }