summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-05-27 14:06:52 +0800
committerPeng Wu <alexepico@gmail.com>2017-05-27 14:06:52 +0800
commit8389a11f7f766f8a87c09ff5d729be99f030236f (patch)
tree8c66cb39be422668234e01e4f458532e9b7254ae
parent960e30985b27f955ce3ce41ed7540b9e237a8cba (diff)
downloadibus-libzhuyin-8389a11f7f766f8a87c09ff5d729be99f030236f.tar.gz
ibus-libzhuyin-8389a11f7f766f8a87c09ff5d729be99f030236f.tar.xz
ibus-libzhuyin-8389a11f7f766f8a87c09ff5d729be99f030236f.zip
clean code
-rw-r--r--src/ZYZZhuyinEditor.cc37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/ZYZZhuyinEditor.cc b/src/ZYZZhuyinEditor.cc
index 1d7b99a..d8e7b84 100644
--- a/src/ZYZZhuyinEditor.cc
+++ b/src/ZYZZhuyinEditor.cc
@@ -70,8 +70,6 @@ ZhuyinEditor::reset (void)
void
ZhuyinEditor::updateZhuyin (void)
{
- static const char * tones[] = {" ", "ˊ", "ˇ", "ˋ", "˙", NULL};
-
const String & enhanced_text = m_text;
const size_t text_len = get_enhanced_text_length (enhanced_text);
String new_text;
@@ -97,41 +95,6 @@ ZhuyinEditor::updateZhuyin (void)
new_text += section;
append_offset += section.length ();
-#if 0
- /* check whether the last character is tone,
- if not part of parsed chewing input,
- turn the tone into symbol. */
- if (m_cursor == text_len && end_pos == m_text.size ()) {
-
- /* check tone symbol. */
- const char tone = section[section.size () - 1];
- gchar ** symbols = NULL;
- zhuyin_in_chewing_keyboard (instance, tone, &symbols);
-
- gboolean is_tone = FALSE;
- /* TODO: use g_strv_contains in future. */
- if (1 == g_strv_length (symbols)) {
- for (const char ** strs = tones; *strs != NULL; ++strs) {
- if (g_str_equal (*strs, symbols[0])) {
- is_tone = TRUE;
- break;
- }
- }
- }
-
- if (is_tone && section.size () > len) {
- erase_input_sequence (new_text, append_offset - 1, 1);
- insert_symbol (new_text, append_offset - 1,
- BUILTIN_SYMBOL_TYPE,
- "", symbols[0]);
- /* as we changed the last space character,
- reached the end of user input, exit the loop. */
- g_strfreev (symbols);
- break;
- }
- g_strfreev (symbols);
- }
-#endif
++index;
}