diff options
author | Peng Wu <alexepico@gmail.com> | 2017-05-23 17:40:29 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2017-05-23 17:43:17 +0800 |
commit | cd999ede281325cdde1942fbd86487af4b88d3dd (patch) | |
tree | a8d3da6fa5be859ff817d48f562278cb459af5ef /src/ZYZPhoneticSection.cc | |
parent | e6ff8c72bd4de2f02a7c26c9e4d614646fb12e62 (diff) | |
download | ibus-libzhuyin-cd999ede281325cdde1942fbd86487af4b88d3dd.tar.gz ibus-libzhuyin-cd999ede281325cdde1942fbd86487af4b88d3dd.tar.xz ibus-libzhuyin-cd999ede281325cdde1942fbd86487af4b88d3dd.zip |
fixes compile
Diffstat (limited to 'src/ZYZPhoneticSection.cc')
-rw-r--r-- | src/ZYZPhoneticSection.cc | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/src/ZYZPhoneticSection.cc b/src/ZYZPhoneticSection.cc index f8bfe7d..4721885 100644 --- a/src/ZYZPhoneticSection.cc +++ b/src/ZYZPhoneticSection.cc @@ -44,9 +44,8 @@ PhoneticSection::initCandidates (zhuyin_instance_t * instance, m_instance = instance; m_cursor = cursor; - guint16 offset = 0; - zhuyin_get_zhuyin_key_rest_offset - (instance, cursor, &offset); + size_t offset = 0; + zhuyin_get_zhuyin_offset (instance, cursor, &offset); if (m_editor.m_config.candidatesAfterCursor ()) zhuyin_guess_candidates_after_cursor (m_instance, offset); @@ -102,9 +101,6 @@ PhoneticSection::fillLookupTableByPage () int PhoneticSection::selectCandidate (guint index) { - guint16 prev_pos = m_cursor, cur_pos = 0; - ChewingKeyRest * key_rest = NULL; - guint len = 0; zhuyin_get_n_candidate (m_instance, &len); @@ -114,25 +110,13 @@ PhoneticSection::selectCandidate (guint index) lookup_candidate_t * candidate = NULL; zhuyin_get_candidate (m_instance, index, &candidate); - guint16 offset = 0; - zhuyin_get_zhuyin_key_rest_offset - (m_instance, m_cursor, &offset); + size_t offset = 0; + zhuyin_get_zhuyin_offset (m_instance, m_cursor, &offset); offset = zhuyin_choose_candidate (m_instance, offset, candidate); - zhuyin_get_n_zhuyin (m_instance, &len); - - if (offset < len) { - zhuyin_get_zhuyin_key_rest (m_instance, offset, &key_rest); - zhuyin_get_zhuyin_key_rest_positions - (m_instance, key_rest, &cur_pos, NULL); - } else { - assert (offset == len); - cur_pos = zhuyin_get_parsed_input_length (m_instance); - } - - return cur_pos - prev_pos; + return offset - m_cursor; } }; |