projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed some problems reported by autoconf -Wall
[pspp]
/
src
/
ui
/
gui
/
psppire-var-store.c
diff --git
a/src/ui/gui/psppire-var-store.c
b/src/ui/gui/psppire-var-store.c
index 3ba2da2a24b6d13692b4aada461a118717d04e15..f9b2d081fbb21c897fdc3bac2afb60ab097cce41 100644
(file)
--- a/
src/ui/gui/psppire-var-store.c
+++ b/
src/ui/gui/psppire-var-store.c
@@
-61,6
+61,7
@@
static gboolean psppire_var_store_set_string (GSheetModel *model,
const gchar *text, glong row, glong column);
static glong psppire_var_store_get_row_count (const GSheetModel * model);
const gchar *text, glong row, glong column);
static glong psppire_var_store_get_row_count (const GSheetModel * model);
+static glong psppire_var_store_get_column_count (const GSheetModel * model);
static gchar *text_for_column (const struct variable *pv, gint c, GError **err);
static gchar *text_for_column (const struct variable *pv, gint c, GError **err);
@@
-223,10
+224,12
@@
psppire_var_store_get_font_desc (const GSheetModel *model,
+
static void
psppire_var_store_sheet_model_init (GSheetModelIface *iface)
{
iface->get_row_count = psppire_var_store_get_row_count;
static void
psppire_var_store_sheet_model_init (GSheetModelIface *iface)
{
iface->get_row_count = psppire_var_store_get_row_count;
+ iface->get_column_count = psppire_var_store_get_column_count;
iface->free_strings = TRUE;
iface->get_string = psppire_var_store_get_string;
iface->set_string = psppire_var_store_set_string;
iface->free_strings = TRUE;
iface->get_string = psppire_var_store_get_string;
iface->set_string = psppire_var_store_set_string;
@@
-271,11
+274,11
@@
var_change_callback (GtkWidget *w, gint n, gpointer data)
static void
static void
-var_delete_callback (GtkWidget *w, gint
first, gint n
, gpointer data)
+var_delete_callback (GtkWidget *w, gint
dict_idx, gint case_idx, gint val_cnt
, gpointer data)
{
GSheetModel *model = G_SHEET_MODEL (data);
{
GSheetModel *model = G_SHEET_MODEL (data);
- g_sheet_model_rows_deleted (model,
first, n
);
+ g_sheet_model_rows_deleted (model,
dict_idx, 1
);
}
}
@@
-288,7
+291,13
@@
var_insert_callback (GtkWidget *w, glong row, gpointer data)
g_sheet_model_rows_inserted (model, row, 1);
}
g_sheet_model_rows_inserted (model, row, 1);
}
+static void
+refresh (PsppireDict *d, gpointer data)
+{
+ PsppireVarStore *vs = data;
+ g_sheet_model_range_changed (G_SHEET_MODEL (vs), -1, -1, -1, -1);
+}
/**
* psppire_var_store_replace_set_dictionary:
/**
* psppire_var_store_replace_set_dictionary:
@@
-308,12
+317,14
@@
psppire_var_store_set_dictionary (PsppireVarStore *var_store, PsppireDict *dict)
g_signal_connect (dict, "variable-changed", G_CALLBACK (var_change_callback),
var_store);
g_signal_connect (dict, "variable-changed", G_CALLBACK (var_change_callback),
var_store);
- g_signal_connect (dict, "variable
s
-deleted", G_CALLBACK (var_delete_callback),
+ g_signal_connect (dict, "variable-deleted", G_CALLBACK (var_delete_callback),
var_store);
var_store);
- g_signal_connect (dict, "variable-inserted",
G_CALLBACK (var_insert_callback),
- var_store);
+ g_signal_connect (dict, "variable-inserted",
+
G_CALLBACK (var_insert_callback),
var_store);
+ g_signal_connect (dict, "backend-changed", G_CALLBACK (refresh),
+ var_store);
/* The entire model has changed */
g_sheet_model_range_changed (G_SHEET_MODEL (var_store), -1, -1, -1, -1);
/* The entire model has changed */
g_sheet_model_range_changed (G_SHEET_MODEL (var_store), -1, -1, -1, -1);
@@
-664,6
+675,13
@@
psppire_var_store_get_row_count (const GSheetModel * model)
return rows ;
}
return rows ;
}
+static glong
+psppire_var_store_get_column_count (const GSheetModel * model)
+{
+ return n_COLS ;
+}
+
+
/* Row related funcs */
static glong
/* Row related funcs */
static glong