projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ben's patches to tower.[ch]
[pspp]
/
src
/
ui
/
gui
/
psppire-data-store.c
diff --git
a/src/ui/gui/psppire-data-store.c
b/src/ui/gui/psppire-data-store.c
index f8be1ec1afab2b810980ff45c2b2e7d0b40ff47c..9f7e40754b4851b88678ba450ab8de22370a0264 100644
(file)
--- a/
src/ui/gui/psppire-data-store.c
+++ b/
src/ui/gui/psppire-data-store.c
@@
-39,6
+39,7
@@
#include <data/missing-values.h>
#include <data/value-labels.h>
#include <data/data-in.h>
#include <data/missing-values.h>
#include <data/value-labels.h>
#include <data/data-in.h>
+#include <data/format.h>
static void psppire_data_store_init (PsppireDataStore *data_store);
static void psppire_data_store_init (PsppireDataStore *data_store);
@@
-55,7
+56,6
@@
static gboolean psppire_data_store_clear_datum (GSheetModel *model,
#define MIN_COLUMNS 10
#define MIN_COLUMNS 10
-
#define TRAILING_ROWS 10
static GObjectClass *parent_class = NULL;
#define TRAILING_ROWS 10
static GObjectClass *parent_class = NULL;
@@
-67,7
+67,7
@@
enum {FONT_CHANGED,
static guint signals [n_SIGNALS];
static guint signals [n_SIGNALS];
-
inline
GType
+GType
psppire_data_store_get_type (void)
{
static GType data_store_type = 0;
psppire_data_store_get_type (void)
{
static GType data_store_type = 0;
@@
-161,7
+161,7
@@
psppire_data_store_get_var_count (const GSheetModel *model)
return psppire_dict_get_var_cnt (store->dict);
}
return psppire_dict_get_var_cnt (store->dict);
}
-
inline
casenumber
+casenumber
psppire_data_store_get_case_count (const PsppireDataStore *store)
{
return psppire_case_file_get_case_count (store->case_file);
psppire_data_store_get_case_count (const PsppireDataStore *store)
{
return psppire_case_file_get_case_count (store->case_file);
@@
-173,7
+173,7
@@
psppire_data_store_get_value_count (const PsppireDataStore *store)
return psppire_dict_get_value_cnt (store->dict);
}
return psppire_dict_get_value_cnt (store->dict);
}
-
inline
casenumber
+casenumber
psppire_data_store_get_case_count_wrapper (const GSheetModel *model)
{
const PsppireDataStore *store = PSPPIRE_DATA_STORE (model);
psppire_data_store_get_case_count_wrapper (const GSheetModel *model)
{
const PsppireDataStore *store = PSPPIRE_DATA_STORE (model);
@@
-235,13
+235,6
@@
psppire_data_store_sheet_model_init (GSheetModelIface *iface)
iface->get_row_count = psppire_data_store_get_case_count_wrapper;
}
iface->get_row_count = psppire_data_store_get_case_count_wrapper;
}
-static
-gboolean always_true ()
-{
- return TRUE;
-}
-
-
static void
delete_cases_callback (GtkWidget *w,
casenumber first, casenumber n_cases, gpointer data)
static void
delete_cases_callback (GtkWidget *w,
casenumber first, casenumber n_cases, gpointer data)
@@
-799,9
+792,11
@@
geometry_set_width (GSheetColumn *geom, glong unit, gint width)
{
PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom);
{
PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom);
- struct variable *
p
v = psppire_dict_get_variable (ds->dict, unit);
+ struct variable *v = psppire_dict_get_variable (ds->dict, unit);
- var_set_display_width (pv, width / ds->width_of_m );
+ g_return_if_fail (v);
+
+ var_set_display_width (v, width / ds->width_of_m );
}
}
@@
-880,7
+875,6
@@
psppire_data_store_sheet_column_init (GSheetColumnIface *iface)
iface->get_column_count = geometry_get_column_count;
iface->get_width = geometry_get_width;
iface->set_width = geometry_set_width;
iface->get_column_count = geometry_get_column_count;
iface->get_width = geometry_get_width;
iface->set_width = geometry_set_width;
- iface->get_visibility = always_true;
iface->get_sensitivity = geometry_get_sensitivity;
iface->get_justification = geometry_get_justification;
iface->get_button_label = geometry_get_column_button_label;
iface->get_sensitivity = geometry_get_sensitivity;
iface->get_justification = geometry_get_justification;
iface->get_button_label = geometry_get_column_button_label;
@@
-891,7
+885,7
@@
psppire_data_store_sheet_column_init (GSheetColumnIface *iface)
/* Row related funcs */
static glong
/* Row related funcs */
static glong
-geometry_get_row_count (const GSheetRow *geom
, gpointer data
)
+geometry_get_row_count (const GSheetRow *geom)
{
PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom);
{
PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom);
@@
-901,31
+895,31
@@
geometry_get_row_count (const GSheetRow *geom, gpointer data)
#define ROW_HEIGHT 25
static gint
#define ROW_HEIGHT 25
static gint
-geometry_get_height (const GSheetRow *geom, glong unit
, gpointer data
)
+geometry_get_height (const GSheetRow *geom, glong unit)
{
return ROW_HEIGHT;
}
static guint
{
return ROW_HEIGHT;
}
static guint
-geometry_get_top_ypixel (const GSheetRow *geo, glong row
, gpointer data
)
+geometry_get_top_ypixel (const GSheetRow *geo, glong row)
{
return row * ROW_HEIGHT;
}
static glong
{
return row * ROW_HEIGHT;
}
static glong
-geometry_pixel_to_row (const GSheetRow *geo, guint pixel
, gpointer data
)
+geometry_pixel_to_row (const GSheetRow *geo, guint pixel)
{
glong row = pixel / ROW_HEIGHT;
{
glong row = pixel / ROW_HEIGHT;
- if (row >= geometry_get_row_count (geo
, data
))
- row = geometry_get_row_count (geo
, data
) - 1;
+ if (row >= geometry_get_row_count (geo))
+ row = geometry_get_row_count (geo) - 1;
return row;
}
static gboolean
return row;
}
static gboolean
-geometry_get_row_sensitivity (const GSheetRow *geom, glong unit
, gpointer data
)
+geometry_get_row_sensitivity (const GSheetRow *geom, glong unit)
{
PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom);
{
PsppireDataStore *ds = PSPPIRE_DATA_STORE (geom);
@@
-933,9
+927,8
@@
geometry_get_row_sensitivity (const GSheetRow *geom, glong unit, gpointer data)
return (unit < psppire_case_file_get_case_count (ds->case_file));
}
return (unit < psppire_case_file_get_case_count (ds->case_file));
}
-
static gchar *
static gchar *
-geometry_get_row_button_label (const GSheetRow *geom, glong unit
, gpointer data
)
+geometry_get_row_button_label (const GSheetRow *geom, glong unit)
{
gchar *text;
gchar *s;
{
gchar *text;
gchar *s;
@@
-961,7
+954,6
@@
psppire_data_store_sheet_row_init (GSheetRowIface *iface)
iface->get_height = geometry_get_height;
iface->set_height = 0;
iface->get_height = geometry_get_height;
iface->set_height = 0;
- iface->get_visibility = always_true;
iface->get_sensitivity = geometry_get_row_sensitivity;
iface->top_ypixel = geometry_get_top_ypixel;
iface->pixel_to_row = geometry_pixel_to_row;
iface->get_sensitivity = geometry_get_row_sensitivity;
iface->top_ypixel = geometry_get_top_ypixel;
iface->pixel_to_row = geometry_pixel_to_row;