summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2014-09-25 12:10:45 +0800
committerPeng Wu <alexepico@gmail.com>2014-09-25 12:10:45 +0800
commited44207ce2b4633c1807dda8d617e0164e34b8b2 (patch)
tree7a9f96e7930d7bc430fe77f9aac568b2ebe94eae
parentae3662e847b115dabb2f1f80676d5f19286eae0d (diff)
downloadibus-libzhuyin-ed44207ce2b4633c1807dda8d617e0164e34b8b2.tar.gz
ibus-libzhuyin-ed44207ce2b4633c1807dda8d617e0164e34b8b2.tar.xz
ibus-libzhuyin-ed44207ce2b4633c1807dda8d617e0164e34b8b2.zip
fixes bugs
-rw-r--r--src/ZYFallbackEditor.cc4
-rw-r--r--src/ZYZPhoneticEditor.cc7
-rw-r--r--src/ZYZUserSymbolListAllSection.cc3
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 ();
}