Revision: 7394
Author:   nogu.dev
Date:     Mon Jan  2 03:22:21 2012
Log:      * gtk2/pref/gtk-custom-widgets.c
  - (table_pref_dialog_response_cb): Check if value is NULL.
  - (create_table_tree_view): Set NULL instead if empty string.
http://code.google.com/p/uim/source/detail?r=7394

Modified:
 /trunk/gtk2/pref/gtk-custom-widgets.c

=======================================
--- /trunk/gtk2/pref/gtk-custom-widgets.c       Mon Jan  2 02:23:02 2012
+++ /trunk/gtk2/pref/gtk-custom-widgets.c       Mon Jan  2 03:22:21 2012
@@ -1962,6 +1962,14 @@

   for (row = 0; row < n_rows; row++) {
     int n_columnsForRow = n_columns;
+    for (column = 0; column < n_columns; column++) {
+      GValue value = {0, };
+      gtk_tree_model_get_value(model, &iter, column, &value);
+      if (!g_value_get_string(&value)) {
+        n_columnsForRow = column;
+        break;
+      }
+    }
     custom_table[row]
         = (char **)malloc(sizeof(char *) * (n_columnsForRow + 1));
     custom_table[row][n_columnsForRow] = NULL;
@@ -2073,7 +2081,7 @@
       if (!custom_table[i][j])
         expanded = TRUE;
       g_value_init(&value, G_TYPE_STRING);
-      g_value_set_string(&value, expanded ? "" : custom_table[i][j]);
+      g_value_set_string(&value, expanded ? NULL : custom_table[i][j]);
       gtk_list_store_set_value(list_store, &iter, j, &value);
     }
   }

Reply via email to