diff options
author | Peng Wu <alexepico@gmail.com> | 2012-07-04 10:23:56 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-07-04 10:31:11 +0800 |
commit | 3f74c3c61b3ea4b0fe13dfe3555477fc68c5d673 (patch) | |
tree | 8975564f0708445277239265f0f5df72b342ab2b /src/PYPPhoneticEditor.cc | |
parent | 268b6cb3d7be7ccbf1a38afcfc2220fab00077d7 (diff) | |
download | ibus-libpinyin-3f74c3c61b3ea4b0fe13dfe3555477fc68c5d673.tar.gz ibus-libpinyin-3f74c3c61b3ea4b0fe13dfe3555477fc68c5d673.tar.xz ibus-libpinyin-3f74c3c61b3ea4b0fe13dfe3555477fc68c5d673.zip |
fixes fillLookupTableByPage
Diffstat (limited to 'src/PYPPhoneticEditor.cc')
-rw-r--r-- | src/PYPPhoneticEditor.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc index 73f5a09..a258a5d 100644 --- a/src/PYPPhoneticEditor.cc +++ b/src/PYPPhoneticEditor.cc @@ -204,7 +204,7 @@ LibPinyinPhoneticEditor::fillLookupTableByPage (void) if (need_nr == 0) return FALSE; - String word; + String word, phrase_string; for (guint i = filled_nr; i < filled_nr + need_nr; i++) { if (i >= m_candidates->len) /* no more candidates */ break; @@ -212,12 +212,21 @@ LibPinyinPhoneticEditor::fillLookupTableByPage (void) lookup_candidate_t * candidate = &g_array_index (m_candidates, lookup_candidate_t, i); + phrase_string = candidate->m_phrase_string; + + if (BEST_MATCH_CANDIDATE == candidate->m_candidate_type) { + /* hide selected part */ + guint cursor = getPinyinCursor (); + phrase_string = g_utf8_offset_to_pointer + (candidate->m_phrase_string, cursor); + } + /* show get candidates. */ if (G_LIKELY (m_props.modeSimp ())) { - word = candidate->m_phrase_string; + word = phrase_string; } else { /* Traditional Chinese */ word.truncate (0); - SimpTradConverter::simpToTrad (candidate->m_phrase_string, word); + SimpTradConverter::simpToTrad (phrase_string, word); } Text text (word); |