#include "xalloc.h"
#include "xmalloca.h"
+
+enum cf_signal_handler {
+ CASES_DELETED,
+ CASE_INSERTED,
+ CASE_CHANGED,
+ n_cf_signals
+};
+
+
static void psppire_data_store_init (PsppireDataStore *data_store);
static void psppire_data_store_class_init (PsppireDataStoreClass *class);
static void psppire_data_store_sheet_model_init (GSheetModelIface *iface);
{
gint i;
+ if ( ds->datasheet)
+ datasheet_destroy (ds->datasheet);
+
ds->datasheet = datasheet_create (reader);
g_sheet_model_range_changed (G_SHEET_MODEL (ds),
ds->dict_handler_id[i]);
}
- return datasheet_make_reader (ds->datasheet);
+ reader = datasheet_make_reader (ds->datasheet);
+
+ /* We must not reference this again */
+ ds->datasheet = NULL;
+
+ return reader;
}
case_clone (&tmp, cc);
result = datasheet_insert_rows (ds->datasheet, posn, &tmp, 1);
+ g_debug ("Result %d. Inserted case at posn %ld", result, posn);
if ( result )
g_signal_emit (ds, signals [CASE_INSERTED], 0, posn);
else
struct dictionary;
-enum cf_signal_handler {
- CASES_DELETED,
- CASE_INSERTED,
- CASE_CHANGED,
- n_cf_signals
-};
-
-
enum dict_signal_handler {
VARIABLE_INSERTED,
VARIABLE_CHANGED,
gboolean show_labels;
- gint cf_handler_id [n_cf_signals];
+ // gint cf_handler_id [n_cf_signals];
gint dict_handler_id [n_dict_signals];
};