#include <gobject/gvaluecollector.h>
-#include "gsheetmodel.h"
+#include <gtksheet/gsheetmodel.h>
#include "psppire-variable.h"
#include "psppire-var-store.h"
#include "var-sheet.h"
+#include "helper.h"
-#include "dictionary.h"
-#include "variable.h"
-#include "missing-values.h"
+#include <data/dictionary.h>
+#include <data/variable.h>
+#include <data/missing-values.h>
#include "val-labs-dialog.h"
#include "missing-val-dialog.h"
-#include "value-labels.h"
+#include <data/value-labels.h>
#define _(A) A
#define N_(A) A
static void psppire_var_store_sheet_model_init (GSheetModelIface *iface);
static void psppire_var_store_finalize (GObject *object);
-static const gchar *const psppire_var_store_get_string(GSheetModel *sheet_model, gint row, gint column);
+static const gchar *psppire_var_store_get_string(GSheetModel *sheet_model, gint row, gint column);
static gboolean psppire_var_store_clear(GSheetModel *model, gint row, gint col);
const gchar *text, gint row, gint column);
-static const gchar *const text_for_column(const struct PsppireVariable *pv, gint c);
+static const gchar *text_for_column(const struct PsppireVariable *pv, gint c);
static GObjectClass *parent_class = NULL;
static void
psppire_var_store_init (PsppireVarStore *var_store)
{
+ GdkColormap *colormap = gdk_colormap_get_system();
g_assert(gdk_color_parse("gray", &var_store->disabled));
- GdkColormap *colormap = gdk_colormap_get_system();
-
gdk_colormap_alloc_color (colormap, &var_store->disabled, FALSE, TRUE);
var_store->dict = 0;
static gboolean
psppire_var_store_item_editable(PsppireVarStore *var_store, gint row, gint column)
{
+ const struct fmt_spec *write_spec ;
struct PsppireVariable *pv = psppire_var_store_get_variable(var_store, row);
if ( ALPHA == psppire_variable_get_type(pv) && column == COL_DECIMALS )
return FALSE;
- const struct fmt_spec *write_spec = psppire_variable_get_write_spec(pv);
+ write_spec = psppire_variable_get_write_spec(pv);
switch ( write_spec->type )
{
(* parent_class->finalize) (object);
}
-static const gchar *const
+static const gchar *
psppire_var_store_get_string(GSheetModel *model, gint row, gint column)
{
+ const gchar *s ;
+
PsppireVarStore *store = PSPPIRE_VAR_STORE(model);
struct PsppireVariable *pv;
pv = psppire_dict_get_variable (store->dict, row);
- const gchar *s = text_for_column(pv, column);
+ s = text_for_column(pv, column);
- return s;
+ return pspp_locale_to_utf8(s, -1, 0);
}
static gboolean
psppire_var_store_clear(GSheetModel *model, gint row, gint col)
{
+ struct PsppireVariable *pv ;
+
PsppireVarStore *var_store = PSPPIRE_VAR_STORE(model);
if ( row >= psppire_dict_get_var_cnt(var_store->dict))
return FALSE;
- struct PsppireVariable *pv = psppire_var_store_get_variable(var_store, row);
+ pv = psppire_var_store_get_variable(var_store, row);
if ( !pv )
return FALSE;
psppire_var_store_set_string(GSheetModel *model,
const gchar *text, gint row, gint col)
{
+ struct PsppireVariable *pv ;
+
PsppireVarStore *var_store = PSPPIRE_VAR_STORE(model);
if ( row >= psppire_dict_get_var_cnt(var_store->dict))
return FALSE;
- struct PsppireVariable *pv = psppire_var_store_get_variable(var_store, row);
-
+ pv = psppire_var_store_get_variable(var_store, row);
if ( !pv )
return FALSE;
#define MAX_CELL_TEXT_LEN 255
-static const gchar *const
+static const gchar *
text_for_column(const struct PsppireVariable *pv, gint c)
{
static gchar buf[MAX_CELL_TEXT_LEN];
g_assert(vl);
- gchar *const vstr = value_to_text(vl->value, *write_spec);
-
- g_snprintf(buf, MAX_CELL_TEXT_LEN, "{%s,\"%s\"}_", vstr, vl->label);
+ {
+ gchar *const vstr = value_to_text(vl->value, *write_spec);
- g_free(vstr);
+ g_snprintf(buf, MAX_CELL_TEXT_LEN, "{%s,\"%s\"}_", vstr, vl->label);
+ g_free(vstr);
+ }
val_labs_done(&ip);