- psppire_case_file_set_value(store->case_file, row, index, &v,
- psppire_variable_get_width(pv));
- return TRUE;
-}
-
-
-/* Attempts to update that part of the variable store which corresponds
- to ROW, COL with the value TEXT.
- Returns true if anything was updated, false otherwise.
-*/
-static gboolean
-psppire_data_store_set_string(GSheetModel *model,
- const gchar *text, gint row, gint col)
-{
- PsppireDataStore *store = PSPPIRE_DATA_STORE(model);
-
- const struct PsppireVariable *pv = psppire_dict_get_variable(store->dict, col);
- g_return_val_if_fail(pv, FALSE);
-
-#if 0
- /* Allow the user to insert a lot of blank cases, simply by skipping rows */
- for(r = psppire_case_file_get_case_count(store->case_file); r <= row ; ++r)
+ Returns true if anything was updated, false otherwise. */
+gboolean
+psppire_data_store_set_string (PsppireDataStore *store,
+ const gchar *text,
+ glong row, const struct variable *var,
+ gboolean use_value_label)
+{
+ gint case_index;
+ glong n_cases;
+ gboolean ok;
+
+ n_cases = psppire_data_store_get_case_count (store);
+ if (row > n_cases)
+ return FALSE;
+ if (row == n_cases)
+ psppire_data_store_insert_new_case (store, row);
+
+ case_index = var_get_case_index (var);
+ if (use_value_label)