]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't use font encoding in Unicode mode
authorRobert Roebling <robert@roebling.de>
Sat, 24 May 2008 19:16:47 +0000 (19:16 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 24 May 2008 19:16:47 +0000 (19:16 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53735 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/textctrl.cpp

index 340ab8038f48836d8ef229ddca1dd3eceb2227a0..7e5b5f5472b761bfa86711b3d290f2e9f38b6317 100644 (file)
@@ -968,6 +968,9 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags )
         return;
     }
 
+#ifdef wxUSE_UNICODE
+    const wxCharBuffer buffer(value.utf8_str());
+#else
     wxFontEncoding enc = m_defaultStyle.HasFont()
                             ? m_defaultStyle.GetFont().GetEncoding()
                             : wxFONTENCODING_SYSTEM;
@@ -982,6 +985,7 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags )
         wxLogWarning(_("Failed to set text in the text control."));
         return;
     }
+#endif
 
     if ( !(flags & SetValue_SendEvent) )
     {
@@ -1020,6 +1024,9 @@ void wxTextCtrl::WriteText( const wxString &text )
         return;
     }
 
+#ifdef wxUSE_UNICODE
+    const wxCharBuffer buffer(text.utf8_str());
+#else
     // check if we have a specific style for the current position
     wxFontEncoding enc = wxFONTENCODING_SYSTEM;
     wxTextAttr style;
@@ -1040,6 +1047,7 @@ void wxTextCtrl::WriteText( const wxString &text )
         wxLogWarning(_("Failed to insert text in the control."));
         return;
     }
+#endif
 
     // First remove the selection if there is one
     // TODO:  Is there an easier GTK specific way to do this?