From d8871f3ab4ec70bf58a26eab6e6f948abb5417ec Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 5 Aug 2015 15:22:04 +0800 Subject: update updateZhuyin method --- src/ZYZPinyinEditor.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ZYZPinyinEditor.cc') 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; } -- cgit