summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2010-06-22 15:16:15 +0800
committerPeng Wu <alexepico@gmail.com>2010-06-22 17:44:42 +0800
commit8bb3778bc49ed59114f23f0f80cac738e24e6e0e (patch)
tree1fe6b2b337da5dc1bc9615732d1423c7d1df1458
parent44202f0e3ba96da80197c6ad9a00073015ae7df9 (diff)
downloadibus-libpinyin-8bb3778bc49ed59114f23f0f80cac738e24e6e0e.tar.gz
ibus-libpinyin-8bb3778bc49ed59114f23f0f80cac738e24e6e0e.tar.xz
ibus-libpinyin-8bb3778bc49ed59114f23f0f80cac738e24e6e0e.zip
fixes digit labels gen.
fixes label key '0' to '9'.
-rw-r--r--lua/lua-plugin-init.c1
-rw-r--r--src/ExtEditor.cc8
2 files changed, 5 insertions, 4 deletions
diff --git a/lua/lua-plugin-init.c b/lua/lua-plugin-init.c
index 46e82f8..66aab44 100644
--- a/lua/lua-plugin-init.c
+++ b/lua/lua-plugin-init.c
@@ -181,6 +181,7 @@ static int ime_register_command(lua_State * L){
lua_command_t new_command;
size_t l;
+ memset(&new_command, 0, sizeof(new_command));
new_command.command_name = luaL_checklstring(L, 1, &l);
if ( 2 != l ){
return luaL_error(L, "ime_register_command is called with command_name: %s, whose length is not 2.\n", new_command.command_name);
diff --git a/src/ExtEditor.cc b/src/ExtEditor.cc
index 28f0566..c015bc9 100644
--- a/src/ExtEditor.cc
+++ b/src/ExtEditor.cc
@@ -224,10 +224,10 @@ ExtEditor::processLabelKey (guint keyval)
switch (m_mode) {
case LABEL_LIST_DIGIT:
switch (keyval) {
- case 1 ... 9:
+ case '1' ... '9':
return selectCandidateInPage (keyval - '1');
break;
- case 0:
+ case '0':
return selectCandidateInPage (9);
break;
}
@@ -528,7 +528,7 @@ ExtEditor::updateStateFromInput (void)
m_mode = LABEL_NONE;
clearLookupTable ();
m_lookup_table.clear ();
- return false;
+ return FALSE;
}
if ( command->help ){
@@ -623,7 +623,7 @@ ExtEditor::fillCommand (std::string command_name, const char * argument)
//Generate labels according to m_mode
if ( LABEL_LIST_DIGIT == m_mode ) {
for ( int i = 1; i <= 10; ++i )
- m_lookup_table.setLabel ( i - 1, Text (i - 1 + '0') );
+ m_lookup_table.setLabel ( i - 1, Text (i - 1 + '1') );
}
if ( LABEL_LIST_ALPHA == m_mode) {