Fix problem in ibus_lookup_table_set_label
authorPeng Huang <shawn.p.huang@gmail.com>
Mon, 31 May 2010 08:42:36 +0000 (16:42 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Mon, 31 May 2010 08:42:36 +0000 (16:42 +0800)
src/ibuslookuptable.c

index 7471cea..f476593 100644 (file)
@@ -333,6 +333,10 @@ ibus_lookup_table_set_label (IBusLookupTable *table,
     g_assert (IBUS_IS_LOOKUP_TABLE (table));
     g_assert (IBUS_IS_TEXT (text));
 
+    if (table->labels->len <= index) {
+        g_array_set_size (table->labels, index + 1);
+    }
+
     IBusText *old = ibus_lookup_table_get_label (table, index);
     if (old != NULL) {
         g_object_unref (old);