fix one of reasons for crash if there is no font

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2003-06-20 20:20:16 +00:00
parent e00a5d3ca1
commit 2269ff5679
2 changed files with 4 additions and 4 deletions

View File

@ -330,9 +330,9 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
#ifdef __WXGTK20__
GtkWidget *widget = gtk_button_new();
GtkStyle *def = gtk_rc_get_style( widget );
if (!def)
if ( !def || !def->font_desc )
def = gtk_widget_get_default_style();
if (def)
if ( def && def->font_desc )
{
wxNativeFontInfo info;
info.description = def->font_desc;

View File

@ -330,9 +330,9 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index )
#ifdef __WXGTK20__
GtkWidget *widget = gtk_button_new();
GtkStyle *def = gtk_rc_get_style( widget );
if (!def)
if ( !def || !def->font_desc )
def = gtk_widget_get_default_style();
if (def)
if ( def && def->font_desc )
{
wxNativeFontInfo info;
info.description = def->font_desc;