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:
@@ -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 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user