X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03647350fc7cd141953c72e0284e928847d30f44..c81394808bf7efd84e4294e44a9a9a7b7f6dd8a9:/src/unix/fontutil.cpp?ds=sidebyside diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index aa47c514c4..8a0fbb2193 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -53,8 +53,8 @@ #include "wx/x11/private.h" #include "wx/gtk/private/string.h" - #define wxPANGO_CONV(s) (wxConvUTF8.cWX2MB((s))) - #define wxPANGO_CONV_BACK(s) (wxConvUTF8.cMB2WX((s))) + #define wxPANGO_CONV(s) s.utf8_str() + #define wxPANGO_CONV_BACK(s) wxString::FromUTF8Unchecked(s) #endif // ---------------------------------------------------------------------------- @@ -581,8 +581,7 @@ wxString wxNativeFontInfo::GetXFontComponent(wxXLFDField field) const if ( !HasElements() ) { - // const_cast - if ( !((wxNativeFontInfo *)this)->FromXFontName(xFontName) ) + if ( !const_cast(this)->FromXFontName(xFontName) ) return wxEmptyString; } @@ -639,8 +638,7 @@ wxString wxNativeFontInfo::GetXFontName() const elt = wxT('*'); } - // const_cast - ((wxNativeFontInfo *)this)->xFontName << wxT('-') << elt; + const_cast(this)->xFontName << wxT('-') << elt; } } @@ -658,8 +656,7 @@ wxNativeFontInfo::SetXFontComponent(wxXLFDField field, const wxString& value) if ( !HasElements() ) { - // const_cast - if ( !((wxNativeFontInfo *)this)->FromXFontName(xFontName) ) + if ( !const_cast(this)->FromXFontName(xFontName) ) { wxFAIL_MSG( wxT("can't set font element for invalid XLFD") ); @@ -1465,9 +1462,7 @@ bool wxFontModule::OnInit() void wxFontModule::OnExit() { - delete g_fontHash; - - g_fontHash = NULL; + wxDELETE(g_fontHash); } #endif // GTK 2.0/1.x