]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fmapbase.cpp
fixed bug #976725: "RETURN closes dialog instead of combobox dropdown" (applied fix...
[wxWidgets.git] / src / common / fmapbase.cpp
index 07faf9ef98ecba03afe6a2c48ab3b4da6f7afef9..8aba4bafc8b43ec6482fd7605ec389ffadb167df 100644 (file)
@@ -706,5 +706,26 @@ wxString wxFontMapperBase::GetEncodingName(wxFontEncoding encoding)
     return str;
 }
 
+/* static */
+wxFontEncoding wxFontMapperBase::GetEncodingFromName(const wxString& name)
+{
+    const size_t count = WXSIZEOF(gs_encodingNames);
+
+    for ( size_t i = 0; i < count; i++ )
+    {
+        if ( gs_encodingNames[i] == name )
+        {
+            return gs_encodings[i];
+        }
+    }
+
+    if ( name == _("default") )
+    {
+        return wxFONTENCODING_DEFAULT;
+    }
+
+    return wxFONTENCODING_MAX;
+}
+
 #endif // wxUSE_FONTMAP