From: Peng Wu Date: Tue, 29 Jun 2010 06:50:10 +0000 (+0800) Subject: fixes aux text. X-Git-Tag: 1.3.10~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e02cb1929119ef62eb9e570d2e530ad9c7513985;p=platform%2Fupstream%2Fibus-libpinyin.git fixes aux text. --- diff --git a/src/ExtEditor.cc b/src/ExtEditor.cc index b9f780b..ba61b71 100644 --- a/src/ExtEditor.cc +++ b/src/ExtEditor.cc @@ -241,6 +241,7 @@ ExtEditor::processLabelKey (guint keyval) break; } break; + case LABEL_LIST_NUMBERS: case LABEL_LIST_ALPHA: switch (keyval) { case 'a' ... 'k': @@ -406,7 +407,16 @@ ExtEditor::selectCandidate (guint index) { switch (m_mode) { case LABEL_LIST_NUMBERS: - //TODO: implement pinyin extension i number mode. + { + if ( index >= m_lookup_table.size() ) + return FALSE; + + IBusText * candidate = m_lookup_table.getCandidate(index); + Text text(candidate); + commitText(text); + reset(); + return TRUE; + } break; case LABEL_LIST_COMMANDS: { @@ -568,6 +578,9 @@ ExtEditor::updateStateFromInput (void) else if ( isdigit (m_text[1]) ) { m_mode = LABEL_LIST_NUMBERS; std::string number = m_text.substr(1); + m_auxiliary_text += " "; + m_auxiliary_text += number; + //Generate Chinese number. int num = atoi(number.c_str()); fillChineseNumber (num); diff --git a/src/LookupTable.h b/src/LookupTable.h index eb2a041..d62b978 100644 --- a/src/LookupTable.h +++ b/src/LookupTable.h @@ -53,6 +53,7 @@ public: void setLabel (guint index, IBusText *text) { ibus_lookup_table_set_label (*this, index, text); } void appendCandidate (IBusText *text) { ibus_lookup_table_append_candidate (*this, text); } void appendLabel (IBusText *text) { ibus_lookup_table_append_label (*this, text); } + IBusText * getCandidate(guint index) { return ibus_lookup_table_get_candidate(*this, index); } operator IBusLookupTable * (void) const {