]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/fontutil.cpp
help search is much faster now (7 times! that's what I call optimization ;-)
[wxWidgets.git] / src / msw / fontutil.cpp
index ecaeb8e2bcb959cb7bf716626cf103c63b724624..6d80870a2231d942285efa24643d21e06d15af30 100644 (file)
 // ----------------------------------------------------------------------------
 
 // convert to/from the string representation: format is
-//      facename[;charset]
+//      encodingid;facename[;charset]
 
 bool wxNativeEncodingInfo::FromString(const wxString& s)
 {
     wxStringTokenizer tokenizer(s, _T(";"));
 
+    wxString encid = tokenizer.GetNextToken();
+    long enc;
+    if ( !encid.ToLong(&enc) )
+        return FALSE;
+    encoding = (wxFontEncoding)enc;
+
     facename = tokenizer.GetNextToken();
     if ( !facename )
         return FALSE;
@@ -81,10 +87,12 @@ bool wxNativeEncodingInfo::FromString(const wxString& s)
 
 wxString wxNativeEncodingInfo::ToString() const
 {
-    wxString s(facename);
+    wxString s;
+    
+    s << (long)encoding << _T(';') << facename;
     if ( charset != ANSI_CHARSET )
     {
-        s << _T(';') << charset;
+         s << _T(';') << charset;
     }
 
     return s;
@@ -158,6 +166,8 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding,
             return FALSE;
     }
 
+    info->encoding = encoding;
+   
     return TRUE;
 }