]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/fontutil.cpp
remove the vertical scrollbar completely if the control is empty
[wxWidgets.git] / src / unix / fontutil.cpp
index 84c7abec5d6f4c55661bcca7af629ba7714f0ce7..5230c5a09e912c0285cf8f774764540c8c1afa23 100644 (file)
 #ifndef WX_PRECOMP
     #include "wx/font.h" // wxFont enums
     #include "wx/encinfo.h"
+    #include "wx/hash.h"
 #endif // PCH
 
 #include "wx/fontutil.h"
 #include "wx/fontmap.h"
 #include "wx/tokenzr.h"
-#include "wx/hash.h"
 #include "wx/module.h"
 
 #if wxUSE_PANGO
@@ -256,7 +256,7 @@ void wxNativeFontInfo::SetUnderlined(bool WXUNUSED(underlined))
 
 void wxNativeFontInfo::SetFaceName(const wxString& facename)
 {
-    pango_font_description_set_family( description, wxGTK_CONV(facename) );
+    pango_font_description_set_family(description, wxGTK_CONV_SYS(facename));
 }
 
 void wxNativeFontInfo::SetFamily(wxFontFamily WXUNUSED(family))
@@ -276,7 +276,7 @@ bool wxNativeFontInfo::FromString(const wxString& s)
     if (description)
         pango_font_description_free( description );
 
-    description = pango_font_description_from_string( wxGTK_CONV( s ) );
+    description = pango_font_description_from_string( wxGTK_CONV_SYS( s ) );
 
     return true;
 }
@@ -304,7 +304,7 @@ wxString wxNativeFontInfo::ToUserString() const
 // wxNativeEncodingInfo
 // ----------------------------------------------------------------------------
 
-bool wxNativeEncodingInfo::FromString(const wxString& s)
+bool wxNativeEncodingInfo::FromString(const wxString& WXUNUSED(s))
 {
     return false;
 }
@@ -314,7 +314,7 @@ wxString wxNativeEncodingInfo::ToString() const
     return wxEmptyString;
 }
 
-bool wxTestFontEncoding(const wxNativeEncodingInfo& info)
+bool wxTestFontEncoding(const wxNativeEncodingInfo& WXUNUSED(info))
 {
     return true;
 }
@@ -322,16 +322,11 @@ bool wxTestFontEncoding(const wxNativeEncodingInfo& info)
 bool wxGetNativeFontEncoding(wxFontEncoding encoding,
                              wxNativeEncodingInfo *info)
 {
-    // we *must* return true for default encoding as otherwise wxFontMapper
-    // considers that we can't load any font and aborts with wxLogFatalError!
-    if ( encoding == wxFONTENCODING_SYSTEM )
-    {
-        info->facename.clear();
-        info->encoding = wxFONTENCODING_SYSTEM;
-    }
+    // all encodings are available in GTK+ 2 because we translate text in any
+    // encoding to UTF-8 internally anyhow
+    info->facename.clear();
+    info->encoding = encoding;
 
-    // pretend that we support everything, it's better than to always return
-    // false as the old code did
     return true;
 }