diff options
author | Peng Wu <alexepico@gmail.com> | 2011-09-22 15:18:37 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-12-22 12:23:12 +0800 |
commit | aea71c5a524cb814cb1697ed4b97a944eb899db6 (patch) | |
tree | 14c02794b5db9ba15b0de24bb7ba732c7730b9c8 /src/PYPPinyinEditor.cc | |
parent | 3b2103d9293ce891f4b47173f60b194916046b18 (diff) | |
download | ibus-libpinyin-aea71c5a524cb814cb1697ed4b97a944eb899db6.tar.gz ibus-libpinyin-aea71c5a524cb814cb1697ed4b97a944eb899db6.tar.xz ibus-libpinyin-aea71c5a524cb814cb1697ed4b97a944eb899db6.zip |
write bopomofo editor
Diffstat (limited to 'src/PYPPinyinEditor.cc')
-rw-r--r-- | src/PYPPinyinEditor.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/PYPPinyinEditor.cc b/src/PYPPinyinEditor.cc index 8108002..5599416 100644 --- a/src/PYPPinyinEditor.cc +++ b/src/PYPPinyinEditor.cc @@ -200,8 +200,7 @@ LibPinyinPinyinEditor::processKeyEvent (guint keyval, guint keycode, void LibPinyinPinyinEditor::commit () { - - if (G_UNLIKELY (m_buffer.empty ())) + if (G_UNLIKELY (m_text.empty ())) return; m_buffer.clear (); @@ -209,9 +208,12 @@ LibPinyinPinyinEditor::commit () /* sentence candidate */ char *tmp = NULL; pinyin_get_sentence(m_instance, &tmp); - m_buffer << tmp; + if (m_props.modeSimp ()) { + m_buffer << tmp; + } else { + SimpTradConverter::simpToTrad (tmp, m_buffer); + } g_free (tmp); - tmp = NULL; /* text after pinyin */ const gchar *p = m_text.c_str() + m_pinyin_len; |