diff options
author | BYVoid <byvoid1@gmail.com> | 2010-05-14 10:55:49 +0800 |
---|---|---|
committer | BYVoid <byvoid1@gmail.com> | 2010-05-14 10:57:34 +0800 |
commit | 6b4b7a6a082851ac734de624602dd4e7d013ab95 (patch) | |
tree | e395db3855e7df39520b922e94df533c91d1704e | |
parent | 35e5f6a5e90dde1b3683774247a4d9bb304bcc3c (diff) | |
download | ibus-libpinyin-6b4b7a6a082851ac734de624602dd4e7d013ab95.tar.gz ibus-libpinyin-6b4b7a6a082851ac734de624602dd4e7d013ab95.tar.xz ibus-libpinyin-6b4b7a6a082851ac734de624602dd4e7d013ab95.zip |
Allow multiple tone character
-rw-r--r-- | src/BopomofoEditor.cc | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/BopomofoEditor.cc b/src/BopomofoEditor.cc index 519b70e..9092c73 100644 --- a/src/BopomofoEditor.cc +++ b/src/BopomofoEditor.cc @@ -26,16 +26,7 @@ BopomofoEditor::insert (gint ch) if (G_UNLIKELY (m_text.length () >= MAX_PINYIN_LEN)) return TRUE; - gint key = keyvalToBopomofo(ch); - if (key >= BOPOMOFO_TONE_2 && key <= BOPOMOFO_TONE_5) { - if (m_cursor == 0) - return TRUE; /* invalid format: tone should not be the first character */ - key = keyvalToBopomofo(m_text.c_str()[m_cursor - 1]); - if (key >= BOPOMOFO_TONE_2 && key <= BOPOMOFO_TONE_5) - return TRUE; /* invalid format: two tone character should not be together */ - } - - m_text.insert (m_cursor++, ch); + m_text.insert (m_cursor++, keyvalToBopomofo(ch)); if (G_UNLIKELY (!(Config::option () & PINYIN_INCOMPLETE_PINYIN))) { updateSpecialPhrases (); |