]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/fontutil.cpp
use dynamic array for the page breaks positions (patch 1483976)
[wxWidgets.git] / src / unix / fontutil.cpp
index 7ca376fb91e03988707e4bf4390570c528cb3095..501393ac7b503f0cb10d3d3ff7619306615a854e 100644 (file)
     #pragma hdrstop
 #endif
 
+#include "wx/fontutil.h"
+
 #ifndef WX_PRECOMP
+    #include "wx/app.h"
     #include "wx/font.h" // wxFont enums
     #include "wx/encinfo.h"
     #include "wx/hash.h"
     #include "wx/utils.h"       // for wxGetDisplay()
 #endif // PCH
 
-#include "wx/fontutil.h"
 #include "wx/fontmap.h"
 #include "wx/tokenzr.h"
 #include "wx/module.h"
@@ -143,7 +145,8 @@ wxFontFamily wxNativeFontInfo::GetFamily() const
     if ( !family_name )
         return ret;
 
-    char *family_text = g_ascii_strdown( family_name, strlen( family_name ) );
+    wxGtkString family_text(g_ascii_strdown(family_name, strlen(family_name)));
+
     // Check for some common fonts, to salvage what we can from the current win32 centric wxFont API:
     if (strncmp( family_text, "monospace", 9 ) == 0)
         ret = wxFONTFAMILY_TELETYPE; // begins with "Monospace"
@@ -201,7 +204,6 @@ wxFontFamily wxNativeFontInfo::GetFamily() const
             ret = wxFONTFAMILY_DECORATIVE; // Begins with "Old" - "Old English", "Old Town"
     }
 
-    free(family_text);
     return ret;
 }
 
@@ -312,11 +314,9 @@ bool wxNativeFontInfo::FromString(const wxString& s)
 
 wxString wxNativeFontInfo::ToString() const
 {
-    char *str = pango_font_description_to_string( description );
-    wxString tmp = wxGTK_CONV_BACK(  str );
-    g_free( str );
+    wxGtkString str(pango_font_description_to_string( description ));
 
-    return tmp;
+    return wxGTK_CONV_BACK(str);
 }
 
 bool wxNativeFontInfo::FromUserString(const wxString& s)