]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/fontutil.cpp
Italian translation corrections from Roberto Boriotti.
[wxWidgets.git] / src / unix / fontutil.cpp
index 84b4e557904aa8ee5d7f82f291076a8c2dc3bb2d..8a0fbb21939b403c4c36f496a437fc9906112874 100644 (file)
@@ -53,8 +53,8 @@
     #include "wx/x11/private.h"
     #include "wx/gtk/private/string.h"
 
     #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
 
 // ----------------------------------------------------------------------------
 #endif
 
 // ----------------------------------------------------------------------------
@@ -187,7 +187,7 @@ wxFontFamily wxNativeFontInfo::GetFamily() const
 
         g_free(families);
 
 
         g_free(families);
 
-        // Some gtk+ systems might query for a non-existing font from 
+        // Some gtk+ systems might query for a non-existing font from
         // wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) on initialization,
         // don't assert until wxSystemSettings::GetFont is checked for this - MR
         // wxASSERT_MSG( family, "No appropriate PangoFontFamily found for ::description" );
         // wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT) on initialization,
         // don't assert until wxSystemSettings::GetFont is checked for this - MR
         // wxASSERT_MSG( family, "No appropriate PangoFontFamily found for ::description" );
@@ -581,8 +581,7 @@ wxString wxNativeFontInfo::GetXFontComponent(wxXLFDField field) const
 
     if ( !HasElements() )
     {
 
     if ( !HasElements() )
     {
-        // const_cast
-        if ( !((wxNativeFontInfo *)this)->FromXFontName(xFontName) )
+        if ( !const_cast<wxNativeFontInfo *>(this)->FromXFontName(xFontName) )
             return wxEmptyString;
     }
 
             return wxEmptyString;
     }
 
@@ -639,8 +638,7 @@ wxString wxNativeFontInfo::GetXFontName() const
                 elt = wxT('*');
             }
 
                 elt = wxT('*');
             }
 
-            // const_cast
-            ((wxNativeFontInfo *)this)->xFontName << wxT('-') << elt;
+            const_cast<wxNativeFontInfo *>(this)->xFontName << wxT('-') << elt;
         }
     }
 
         }
     }
 
@@ -658,8 +656,7 @@ wxNativeFontInfo::SetXFontComponent(wxXLFDField field, const wxString& value)
 
     if ( !HasElements() )
     {
 
     if ( !HasElements() )
     {
-        // const_cast
-        if ( !((wxNativeFontInfo *)this)->FromXFontName(xFontName) )
+        if ( !const_cast<wxNativeFontInfo *>(this)->FromXFontName(xFontName) )
         {
             wxFAIL_MSG( wxT("can't set font element for invalid XLFD") );
 
         {
             wxFAIL_MSG( wxT("can't set font element for invalid XLFD") );
 
@@ -1027,7 +1024,7 @@ wxNativeFont wxLoadQueryNearestFont(int pointSize,
 
         int i, round; // counters
 
 
         int i, round; // counters
 
-        // first round: search for equal, then for smaller and for larger size 
+        // first round: search for equal, then for smaller and for larger size
         // with the given weight and style
         int testweight = weight;
         int teststyle = style;
         // with the given weight and style
         int testweight = weight;
         int teststyle = style;
@@ -1465,9 +1462,7 @@ bool wxFontModule::OnInit()
 
 void wxFontModule::OnExit()
 {
 
 void wxFontModule::OnExit()
 {
-    delete g_fontHash;
-
-    g_fontHash = NULL;
+    wxDELETE(g_fontHash);
 }
 
 #endif // GTK 2.0/1.x
 }
 
 #endif // GTK 2.0/1.x