remove m_pinyins
authorPeng Wu <alexepico@gmail.com>
Thu, 22 Sep 2011 07:31:06 +0000 (15:31 +0800)
committerPeng Wu <alexepico@gmail.com>
Thu, 22 Dec 2011 04:23:12 +0000 (12:23 +0800)
src/PYPBopomofoEditor.cc
src/PYPDoublePinyinEditor.cc
src/PYPFullPinyinEditor.cc
src/PYPPhoneticEditor.cc
src/PYPPhoneticEditor.h

index 023634b..0c7e46f 100644 (file)
@@ -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, "");
index 0e1e3d3..d37a480 100644 (file)
@@ -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, "");
index 80f8a46..064ae40 100644 (file)
@@ -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);
index 217e545..60e2da9 100644 (file)
@@ -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 ();
 
index 56a8ee4..9d522bf 100644 (file)
@@ -78,7 +78,9 @@ protected:
 
 
     /* varibles */
+#if 0
     PinyinArray                 m_pinyins;
+#endif
     guint                       m_pinyin_len;
     LookupTable                 m_lookup_table;
     String                      m_buffer;