From: Peng Wu Date: Thu, 22 Sep 2011 07:31:06 +0000 (+0800) Subject: remove m_pinyins X-Git-Tag: 1.4.0~139 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=567aec11de7f8df43a12deda4227ebd975ef6d2e;p=platform%2Fupstream%2Fibus-libpinyin.git remove m_pinyins --- diff --git a/src/PYPBopomofoEditor.cc b/src/PYPBopomofoEditor.cc index 023634b..0c7e46f 100644 --- a/src/PYPBopomofoEditor.cc +++ b/src/PYPBopomofoEditor.cc @@ -232,7 +232,6 @@ void LibPinyinBopomofoEditor::updatePinyin (void) { if (G_UNLIKELY (m_text.empty ())) { - m_pinyins.clear (); m_pinyin_len = 0; /* TODO: check whether to replace "" with NULL. */ pinyin_parse_more_chewings (m_instance, ""); diff --git a/src/PYPDoublePinyinEditor.cc b/src/PYPDoublePinyinEditor.cc index 0e1e3d3..d37a480 100644 --- a/src/PYPDoublePinyinEditor.cc +++ b/src/PYPDoublePinyinEditor.cc @@ -98,7 +98,6 @@ void LibPinyinDoublePinyinEditor::updatePinyin (void) { if (G_UNLIKELY (m_text.empty ())) { - m_pinyins.clear (); m_pinyin_len = 0; /* TODO: check whether to replace "" with NULL. */ pinyin_parse_more_double_pinyins (m_instance, ""); diff --git a/src/PYPFullPinyinEditor.cc b/src/PYPFullPinyinEditor.cc index 80f8a46..064ae40 100644 --- a/src/PYPFullPinyinEditor.cc +++ b/src/PYPFullPinyinEditor.cc @@ -67,17 +67,18 @@ void LibPinyinFullPinyinEditor::updatePinyin (void) { if (G_UNLIKELY (m_text.empty ())) { - m_pinyins.clear (); m_pinyin_len = 0; /* TODO: check whether to replace "" with NULL. */ pinyin_parse_more_full_pinyins (m_instance, ""); return; } + PinyinArray pinyins (MAX_PINYIN_LEN); + m_pinyin_len = PinyinParser::parse (m_text, // text m_text.length (), // text length m_config.option (), // option - m_pinyins, // result + pinyins, // result MAX_PHRASE_LEN); // max result length /* propagate to libpinyin */ @@ -85,8 +86,8 @@ LibPinyinFullPinyinEditor::updatePinyin (void) g_array_set_size (m_instance->m_pinyin_poses, 0); PinyinKey key; PinyinKeyPos pos; - PinyinArray::const_iterator iter = m_pinyins.begin (); - for ( ; iter != m_pinyins.end (); ++iter ) { + PinyinArray::const_iterator iter = pinyins.begin (); + for ( ; iter != pinyins.end (); ++iter ) { PinyinSegment py = *iter; pinyin_parse_full_pinyin (m_instance, py.pinyin->text, &key); pos.set_pos (py.begin); pos.set_length (py.len); diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc index 217e545..60e2da9 100644 --- a/src/PYPPhoneticEditor.cc +++ b/src/PYPPhoneticEditor.cc @@ -29,7 +29,6 @@ using namespace PY; LibPinyinPhoneticEditor::LibPinyinPhoneticEditor (PinyinProperties &props, Config &config): Editor (props, config), - m_pinyins (MAX_PHRASE_LEN), m_pinyin_len (0), m_lookup_table (m_config.pageSize ()) { @@ -273,7 +272,6 @@ LibPinyinPhoneticEditor::candidateClicked (guint index, guint button, guint stat void LibPinyinPhoneticEditor::reset (void) { - m_pinyins.clear (); m_pinyin_len = 0; m_lookup_table.clear (); diff --git a/src/PYPPhoneticEditor.h b/src/PYPPhoneticEditor.h index 56a8ee4..9d522bf 100644 --- a/src/PYPPhoneticEditor.h +++ b/src/PYPPhoneticEditor.h @@ -78,7 +78,9 @@ protected: /* varibles */ +#if 0 PinyinArray m_pinyins; +#endif guint m_pinyin_len; LookupTable m_lookup_table; String m_buffer;