+static void
+psppire_data_store_dispose (GObject *object)
+{
+ PsppireDataStore *ds = PSPPIRE_DATA_STORE (object);
+
+ if (ds->dispose_has_run)
+ return;
+
+ if (ds->case_file) g_object_unref (ds->case_file);
+
+ /* must chain up */
+ (* parent_class->dispose) (object);
+
+ ds->dispose_has_run = TRUE;
+}
+
+
+gboolean
+psppire_data_store_delete_cases (PsppireDataStore *ds,
+ casenumber first, casenumber count)
+{
+ g_return_val_if_fail (ds, FALSE);
+
+ return psppire_case_file_delete_cases (ds->case_file, count, first);
+}
+
+
+
+/* Insert a blank case before POSN */
+gboolean
+psppire_data_store_insert_new_case (PsppireDataStore *ds, casenumber posn)
+{
+ gboolean result;
+ gint val_cnt, v;
+ struct ccase cc;
+ g_return_val_if_fail (ds, FALSE);
+
+ val_cnt = datasheet_get_column_cnt (ds->case_file->datasheet) ;
+
+ g_return_val_if_fail (val_cnt > 0, FALSE);
+
+ g_return_val_if_fail (posn <= psppire_data_store_get_case_count (ds), FALSE);
+
+ case_create (&cc, val_cnt);
+
+ memset ( case_data_rw_idx (&cc, 0), 0, val_cnt * MAX_SHORT_STRING);
+
+ for (v = 0 ; v < psppire_dict_get_var_cnt (ds->dict) ; ++v)
+ {
+ const struct variable *pv = psppire_dict_get_variable (ds->dict, v);
+ if ( var_is_alpha (pv))
+ continue;
+
+ case_data_rw (&cc, pv)->f = SYSMIS;
+ }
+
+ result = psppire_case_file_insert_case (ds->case_file, &cc, posn);
+
+ case_destroy (&cc);
+
+ return result;
+}
+
+
+gchar *
+psppire_data_store_get_string (PsppireDataStore *store, glong row, glong column)