From ed44207ce2b4633c1807dda8d617e0164e34b8b2 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 25 Sep 2014 12:10:45 +0800 Subject: fixes bugs --- src/ZYFallbackEditor.cc | 4 ++-- src/ZYZPhoneticEditor.cc | 7 ++++--- src/ZYZUserSymbolListAllSection.cc | 3 +-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ZYFallbackEditor.cc b/src/ZYFallbackEditor.cc index 15587d3..37b28fc 100644 --- a/src/ZYFallbackEditor.cc +++ b/src/ZYFallbackEditor.cc @@ -57,7 +57,7 @@ FallbackEditor::processPunct (guint keyval, guint keycode, guint modifiers) } else { /* Chinese mode, handled by ZhuyinEditor or PinyinEditor. */ - assert (FALSE); + return TRUE; } return FALSE; @@ -88,7 +88,7 @@ FallbackEditor::processEnglish (guint keyval, guint keycode, guint modifiers) { } else { /* Chinese mode, handled by ZhuyinEditor or PinyinEditor. */ - assert (FALSE); + return TRUE; } return FALSE; diff --git a/src/ZYZPhoneticEditor.cc b/src/ZYZPhoneticEditor.cc index dd520c9..c56edc8 100644 --- a/src/ZYZPhoneticEditor.cc +++ b/src/ZYZPhoneticEditor.cc @@ -289,7 +289,6 @@ PhoneticEditor::processCandidateKey (guint keyval, guint keycode, std::size_t found = keys.find (keyval); if (found != std::string::npos) { /* found. */ selectCandidateInPage (found); - m_input_state = STATE_INPUT; return TRUE; } } @@ -332,7 +331,7 @@ PhoneticEditor::processUserSymbolKey (guint keyval, guint keycode, if (!m_config.userSymbol ()) return FALSE; - if ('`' == keyval) + if ('`' != keyval) return FALSE; m_input_state = STATE_USER_SYMBOL_LIST_ALL; @@ -537,9 +536,11 @@ PhoneticEditor::selectCandidate (guint index) } if (1 < offset) { /* show candidate. */ + String choice = symbols->m_choice; + m_input_state = STATE_USER_SYMBOL_SHOWN; m_symbol_sections[m_input_state]->initCandidates - (m_instance, symbols->m_choice); + (m_instance, choice); update (); return TRUE; diff --git a/src/ZYZUserSymbolListAllSection.cc b/src/ZYZUserSymbolListAllSection.cc index 5437d2d..f9f4114 100644 --- a/src/ZYZUserSymbolListAllSection.cc +++ b/src/ZYZUserSymbolListAllSection.cc @@ -49,7 +49,6 @@ UserSymbolListAllSection::~UserSymbolListAllSection () gboolean UserSymbolListAllSection::loadUserSymbolFile (const gchar * filename) { - printf ("load %s.\n", filename); gboolean retval = m_user_symbols.loadFromFile (filename); return retval; } @@ -108,7 +107,7 @@ UserSymbolListAllSection::selectCandidate (guint index) if (index >= m_candidates.size ()) return 0; - m_choice = m_candidates[index]; + m_choice = m_user_symbols.find (m_candidates[index]); return m_choice.utf8Length (); } -- cgit