diff options
author | Peng Wu <alexepico@gmail.com> | 2015-08-05 15:22:04 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2015-08-05 15:22:04 +0800 |
commit | d8871f3ab4ec70bf58a26eab6e6f948abb5417ec (patch) | |
tree | d97da0ceda2ce4a959abb855d1ab159cc35d7196 /src/ZYZPinyinEditor.cc | |
parent | e92adcdef3188bd879d579fd4b6c3996dee52ef8 (diff) | |
download | ibus-libzhuyin-d8871f3ab4ec70bf58a26eab6e6f948abb5417ec.tar.gz ibus-libzhuyin-d8871f3ab4ec70bf58a26eab6e6f948abb5417ec.tar.xz ibus-libzhuyin-d8871f3ab4ec70bf58a26eab6e6f948abb5417ec.zip |
update updateZhuyin method
Diffstat (limited to 'src/ZYZPinyinEditor.cc')
-rw-r--r-- | src/ZYZPinyinEditor.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ZYZPinyinEditor.cc b/src/ZYZPinyinEditor.cc index debc2e5..aa81602 100644 --- a/src/ZYZPinyinEditor.cc +++ b/src/ZYZPinyinEditor.cc @@ -72,6 +72,8 @@ void PinyinEditor::updateZhuyin (void) { const String & enhanced_text = m_text; + String new_text; + size_t append_offset = 0; resizeInstances (); @@ -89,6 +91,9 @@ PinyinEditor::updateZhuyin (void) zhuyin_parse_more_full_pinyins (instance, section.c_str ()); zhuyin_guess_sentence (instance); + new_text += section; + append_offset += section.length (); + ++index; } @@ -97,11 +102,14 @@ PinyinEditor::updateZhuyin (void) get_symbol_section (enhanced_text, start_pos, end_pos, type, lookup, choice); + insert_symbol (new_text, append_offset, type, lookup, choice); + append_offset ++; } start_pos = end_pos; } + m_text = new_text; return; } |