X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7826e2dd838d59c6a8061b4fdd9f7326a6e06de3..4aaef122cbbd5bbe0e70b824e320458e2329dd13:/src/gtk1/font.cpp diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index c58aca2e81..15909254a4 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -146,21 +146,6 @@ wxFontRefData::~wxFontRefData() } } -// ---------------------------------------------------------------------------- -// wxNativeFontInfo -// ---------------------------------------------------------------------------- - -bool wxNativeFontInfo::FromString(const wxString& s) -{ - xFontName = s; - return TRUE; -} - -wxString wxNativeFontInfo::ToString() const -{ - return xFontName; -} - // ---------------------------------------------------------------------------- // wxFont // ---------------------------------------------------------------------------- @@ -169,15 +154,13 @@ IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject) void wxFont::Init() { - if (wxTheFontList) - wxTheFontList->Append( this ); } wxFont::wxFont(const wxNativeFontInfo& info) { Init(); - Create(info.ToString()); + Create(info.xFontName); } bool wxFont::Create(const wxNativeFontInfo& info) @@ -201,8 +184,6 @@ bool wxFont::Create( int pointSize, bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) { - Init(); - if( !fontname ) { *this = wxSystemSettings::GetSystemFont( wxSYS_DEFAULT_GUI_FONT); @@ -320,8 +301,6 @@ void wxFont::Unshare() wxFont::~wxFont() { - if (wxTheFontList) - wxTheFontList->DeleteObject( this ); } // ---------------------------------------------------------------------------- @@ -479,6 +458,12 @@ GdkFont *GtkGetDefaultGuiFont() } gtk_widget_destroy( widget ); } + else + { + // already have it, but ref it once more before returning + gdk_font_ref(g_systemDefaultGuiFont); + } + return g_systemDefaultGuiFont; }