More runtime warnings fixed
[pspp-builds.git] / src / ui / gui / psppire-data-store.c
index fa7a47884a18fa6e2c504595876dbda9d70aba51..e0402dea9ba02cc24fba1b814f5fc83cfd81539f 100644 (file)
@@ -275,7 +275,6 @@ psppire_data_store_sheet_model_init (GSheetModelIface *iface)
   iface->is_editable = NULL;
   iface->get_foreground = NULL;
   iface->get_background = NULL;
-  iface->get_cell_border = NULL;
   iface->get_column_count = psppire_data_store_get_var_count;
   iface->get_row_count = psppire_data_store_get_case_count_wrapper;
 
@@ -647,6 +646,8 @@ psppire_data_store_clear_datum (GSheetModel *model,
   psppire_data_store_set_value (store, row, index, &v,
                                var_get_width (pv));
 
+  g_sheet_model_range_changed (model, row, col, row, col);
+
   return TRUE;
 }
 
@@ -661,7 +662,8 @@ psppire_data_store_set_string (PsppireDataStore *store,
 {
   glong n_cases;
   const struct variable *pv = psppire_dict_get_variable (store->dict, col);
-  g_return_val_if_fail (pv, FALSE);
+  if ( NULL == pv)
+    return FALSE;
 
   n_cases = psppire_data_store_get_case_count (store);
 
@@ -675,6 +677,8 @@ psppire_data_store_set_string (PsppireDataStore *store,
                              var_get_case_index (pv), ss_cstr (text),
                              var_get_write_format (pv));
 
+  g_sheet_model_range_changed (G_SHEET_MODEL (store), row, col, row, col);
+
   return TRUE;
 }
 
@@ -945,6 +949,7 @@ psppire_data_store_set_value (PsppireDataStore *ds, casenumber casenum,
   ok = datasheet_put_value (ds->datasheet, casenum, idx, v, width);
   if (ok)
     g_signal_emit (ds, signals [CASE_CHANGED], 0, casenum);
+
   return ok;
 }
 
@@ -971,12 +976,12 @@ psppire_data_store_data_in (PsppireDataStore *ds, casenumber casenum, gint idx,
         && data_in (input, LEGACY_NATIVE, fmt->type, 0, 0, 0, value, width)
         && datasheet_put_value (ds->datasheet, casenum, idx, value, width));
 
+  freea (value);
+
   if (ok)
     g_signal_emit (ds, signals [CASE_CHANGED], 0, casenum);
 
-  freea (value);
-
-  return TRUE;
+  return ok;
 }
 
 /* Resize the cases in the casefile, by inserting N_VALUES into every