fixes processEnter
authorPeng Wu <alexepico@gmail.com>
Thu, 9 Aug 2012 03:29:29 +0000 (11:29 +0800)
committerPeng Wu <alexepico@gmail.com>
Thu, 9 Aug 2012 03:29:29 +0000 (11:29 +0800)
src/PYEnglishEditor.cc
src/PYStrokeEditor.cc

index 333ea96..8d58e0f 100644 (file)
@@ -533,10 +533,9 @@ EnglishEditor::processEnter (guint keyval)
     if (m_text.length () == 0)
         return FALSE;
 
-    String preedit = m_text.substr (1);
-    Text text (preedit);
+    Text text(m_text);
     commitText (text);
-    train (preedit.c_str (), m_train_factor);
+    train (m_text.c_str (), m_train_factor);
     reset ();
     return TRUE;
 }
index 252dddd..20bc84f 100644 (file)
@@ -310,8 +310,7 @@ StrokeEditor::processEnter (guint keyval)
     if (m_text.length () == 0)
         return FALSE;
 
-    String preedit = m_text.substr (1);
-    Text text (preedit);
+    Text text(m_text);
     commitText (text);
     reset ();
     return TRUE;