summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2014-07-02 17:28:26 +0800
committerPeng Wu <alexepico@gmail.com>2014-07-02 17:28:26 +0800
commit0434a44ca4c15f53598128936d036b8c6cf49577 (patch)
tree142012ee74c8abf44c93d28dc4026753a6d76410 /src
parentcde4b45e75e2cf7bcf2b22ab8056322b1ad04cba (diff)
downloadibus-libzhuyin-0434a44ca4c15f53598128936d036b8c6cf49577.tar.gz
ibus-libzhuyin-0434a44ca4c15f53598128936d036b8c6cf49577.tar.xz
ibus-libzhuyin-0434a44ca4c15f53598128936d036b8c6cf49577.zip
update method selectCandidate
Diffstat (limited to 'src')
-rw-r--r--src/ZYZPhoneticEditor.cc12
-rw-r--r--src/ZYZSymbolSection.h1
2 files changed, 11 insertions, 2 deletions
diff --git a/src/ZYZPhoneticEditor.cc b/src/ZYZPhoneticEditor.cc
index 5e2a7df..9054f06 100644
--- a/src/ZYZPhoneticEditor.cc
+++ b/src/ZYZPhoneticEditor.cc
@@ -378,8 +378,16 @@ PhoneticEditor::selectCandidate (guint index)
STATE_BOPOMOFO_SYMBOL_SHOWN == m_input_state /* ||
STATE_USER_SYMBOL_LIST_ALL == m_input_state ||
STATE_USER_SYMBOL_SHOWN == m_input_state */) {
- return m_symbol_sections[m_input_state]->
- selectCandidate (index);
+ SymbolSectionPtr symbols = m_symbol_sections[m_input_state];
+
+ int retval = symbols->selectCandidate (index);
+
+ erase_input_sequence (m_text, m_cursor, 1);
+ insert_symbol (m_text, m_cursor, symbols->m_type,
+ symbols->m_lookup, symbols->m_choice);
+
+ update ();
+ return retval;
}
return FALSE;
diff --git a/src/ZYZSymbolSection.h b/src/ZYZSymbolSection.h
index 8e75888..fce65f2 100644
--- a/src/ZYZSymbolSection.h
+++ b/src/ZYZSymbolSection.h
@@ -31,6 +31,7 @@ namespace ZY {
class ZhuyinProperties;
class SymbolSection {
+ friend class PhoneticEditor;
public:
SymbolSection (PhoneticEditor & editor, ZhuyinProperties & props) :
m_editor (editor), m_props(props) {}