summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-09-15 15:19:49 +0800
committerPeng Wu <alexepico@gmail.com>2011-12-22 12:23:11 +0800
commit48e7bb8f1db150e6e0ea4b76e1d28d7f349c432d (patch)
tree27c742e2f5a21c368d44fecb1e3d6831c6ca400d /src
parentc79a32bd545251896d6bc02f27235669abe86774 (diff)
downloadibus-libpinyin-48e7bb8f1db150e6e0ea4b76e1d28d7f349c432d.tar.gz
ibus-libpinyin-48e7bb8f1db150e6e0ea4b76e1d28d7f349c432d.tar.xz
ibus-libpinyin-48e7bb8f1db150e6e0ea4b76e1d28d7f349c432d.zip
remove special phrase
Diffstat (limited to 'src')
-rw-r--r--src/PYPPhoneticEditor.cc41
-rw-r--r--src/PYPPhoneticEditor.h7
2 files changed, 1 insertions, 47 deletions
diff --git a/src/PYPPhoneticEditor.cc b/src/PYPPhoneticEditor.cc
index ef9a02d..fc4aee2 100644
--- a/src/PYPPhoneticEditor.cc
+++ b/src/PYPPhoneticEditor.cc
@@ -161,27 +161,6 @@ LibPinyinPhoneticEditor::processKeyEvent (guint keyval, guint keycode, guint mod
return FALSE;
}
-gboolean
-LibPinyinPhoneticEditor::updateSpecialPhrases (void)
-{
- guint size = m_special_phrases.size();
- m_special_phrases.clear ();
-
- if (!m_config.specialPhrases ())
- return FALSE;
-
- if (!m_selected_special_phrase.empty ())
- return FALSE;
-
- /* Note: change behavior to match the entire m_text,
- * instead of partial m_text.
- */
- SpecialPhraseTable::instance ().lookup
- (m_text, m_special_phrases);
-
- return size != m_special_phrases.size() || size != 0;
-}
-
void
LibPinyinPhoneticEditor::updateLookupTableFast (void)
{
@@ -204,9 +183,6 @@ LibPinyinPhoneticEditor::updateLookupTable (void)
gboolean
LibPinyinPhoneticEditor::fillLookupTableByPage (void)
{
- if (!m_selected_special_phrase.empty ()) {
- return FALSE;
- }
guint filled_nr = m_lookup_table.size ();
guint page_size = m_lookup_table.pageSize ();
@@ -273,8 +249,6 @@ LibPinyinPhoneticEditor::reset (void)
m_pinyin.clear ();
m_pinyin_len = 0;
m_lookup_table.clear ();
- m_special_phrases.clear ();
- m_selected_special_phrase.clear ();
Editor::reset ();
}
@@ -298,21 +272,6 @@ gboolean
LibPinyinPhoneticEditor::selectCandidate (guint i)
{
- if (i < m_special_phrases.size ()) {
- /* select a special phrase */
- m_selected_special_phrase = m_special_phrases[i];
- if (m_cursor == m_text.size()) {
- m_buffer = m_selected_special_phrase;
- reset ();
- commit ((const gchar *)m_buffer);
- } else {
- updateSpecialPhrases ();
- update ();
- }
- return TRUE;
- }
-
- i -= m_special_phrases.size ();
/* TODO: deal with normal candidates selection here by libpinyin. */
g_assert (FALSE);
}
diff --git a/src/PYPPhoneticEditor.h b/src/PYPPhoneticEditor.h
index f222557..f7a3704 100644
--- a/src/PYPPhoneticEditor.h
+++ b/src/PYPPhoneticEditor.h
@@ -51,7 +51,6 @@ public:
protected:
- gboolean updateSpecialPhrases ();
gboolean selectCandidate (guint i);
gboolean selectCandidateInPage (guint i);
@@ -82,11 +81,7 @@ protected:
String m_buffer;
/* use LibPinyinBackEnd here. */
- CandidateConstraints m_constraints;
- MatchResults m_match_results;
-
- std::vector<std::string> m_special_phrases;
- std::string m_selected_special_phrase;
+ pinyin_instance_t *m_instance;
};
};