g_return_val_if_fail (width > 0, false);
assert ( ! (cmptr->flags & STR_CMP_LABELS));
- text = value_to_text (*val, cmptr->dict, *var_get_write_format (cmptr->var));
+ text = value_to_text (*val, cmptr->dict, *var_get_print_format (cmptr->var));
if ( cmptr->flags & STR_CMP_SUBSTR)
found = (NULL != g_strstr_len (text, width, ssc->pattern));
g_return_val_if_fail (width > 0, false);
- text = value_to_text (*val, cmptr->dict, *var_get_write_format (cmptr->var));
+ text = value_to_text (*val, cmptr->dict, *var_get_print_format (cmptr->var));
/* We must remove trailing whitespace, otherwise $ will not match where
one would expect */
g_strchomp (text);
void
missing_val_dialog_show (struct missing_val_dialog *dialog)
{
- const struct fmt_spec *write_spec ;
+ const struct fmt_spec *format ;
gint i;
g_return_if_fail (dialog);
mv_copy (&dialog->mvl, var_get_missing_values (dialog->pv));
- write_spec = var_get_write_format (dialog->pv);
+ format = var_get_print_format (dialog->pv);
/* Blank all entry boxes and make them insensitive */
gtk_entry_set_text (GTK_ENTRY (dialog->low), "");
mv_get_range (&dialog->mvl, &low.f, &high.f);
- low_text = value_to_text (low, dialog->dict, *write_spec);
- high_text = value_to_text (high, dialog->dict, *write_spec);
+ low_text = value_to_text (low, dialog->dict, *format);
+ high_text = value_to_text (high, dialog->dict, *format);
gtk_entry_set_text (GTK_ENTRY (dialog->low), low_text);
gtk_entry_set_text (GTK_ENTRY (dialog->high), high_text);
if ( mv_has_value (&dialog->mvl))
{
gchar *text;
- text = value_to_text (*mv_get_value (&dialog->mvl, 0), dialog->dict, *write_spec);
+ text = value_to_text (*mv_get_value (&dialog->mvl, 0), dialog->dict, *format);
gtk_entry_set_text (GTK_ENTRY (dialog->discrete), text);
g_free (text);
}
gchar *text ;
text = value_to_text (*mv_get_value (&dialog->mvl, i), dialog->dict,
- *write_spec);
+ *format);
gtk_entry_set_text (GTK_ENTRY (dialog->mv[i]), text);
g_free (text);
}
}
}
- fp = var_get_write_format (pv);
+ fp = var_get_print_format (pv);
text = data_out (&v, dict_get_encoding (dict), fp);
psppire_data_store_data_in (store, row,
var_get_case_index (pv), ss_cstr (text),
- var_get_write_format (pv));
+ var_get_print_format (pv));
psppire_sheet_model_range_changed (PSPPIRE_SHEET_MODEL (store), row, col, row, col);
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2009, 2010 Free Software Foundation
+ Copyright (C) 2009, 2010, 2011 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
else
{
- const struct fmt_spec *fs = var_get_write_format (var);
+ const struct fmt_spec *fs = var_get_print_format (var);
int cat = fmt_get_category (fs->type);
switch ( var_get_measure (var))
{
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
const gint current_value = g_strtod (s, NULL);
GtkObject *adj ;
- const struct fmt_spec *fmt = var_get_write_format (var);
+ const struct fmt_spec *fmt = var_get_print_format (var);
switch (column)
{
case PSPPIRE_VAR_STORE_COL_WIDTH:
bool for_input
= var_store->format_type == PSPPIRE_VAR_STORE_INPUT_FORMATS;
struct fmt_spec fmt ;
- fmt = *var_get_write_format (pv);
+ fmt = *var_get_print_format (pv);
if ( width < fmt_min_width (fmt.type, for_input)
||
width > fmt_max_width (fmt.type, for_input))
struct fmt_spec fmt;
if ( ! text) return FALSE;
decimals = atoi (text);
- fmt = *var_get_write_format (pv);
+ fmt = *var_get_print_format (pv);
if ( decimals >
fmt_max_decimals (fmt.type,
fmt.w,
enum {VT_NUMERIC, VT_COMMA, VT_DOT, VT_SCIENTIFIC, VT_DATE, VT_DOLLAR,
VT_CUSTOM, VT_STRING};
- const struct fmt_spec *write_spec = var_get_write_format (pv);
+ const struct fmt_spec *format = var_get_print_format (pv);
switch (c)
{
break;
case PSPPIRE_VAR_STORE_COL_TYPE:
{
- switch ( write_spec->type )
+ switch ( format->type )
{
case FMT_F:
return xstrdup (gettext (type_label[VT_NUMERIC]));
{
char str[FMT_STRING_LEN_MAX + 1];
g_warning ("Unknown format: `%s'\n",
- fmt_to_string (write_spec, str));
+ fmt_to_string (format, str));
}
break;
}
{
gchar *s;
GString *gstr = g_string_sized_new (10);
- g_string_printf (gstr, _("%d"), write_spec->w);
+ g_string_printf (gstr, _("%d"), format->w);
s = g_locale_to_utf8 (gstr->str, gstr->len, 0, 0, err);
g_string_free (gstr, TRUE);
return s;
{
gchar *s;
GString *gstr = g_string_sized_new (10);
- g_string_printf (gstr, _("%d"), write_spec->d);
+ g_string_printf (gstr, _("%d"), format->d);
s = g_locale_to_utf8 (gstr->str, gstr->len, 0, 0, err);
g_string_free (gstr, TRUE);
return s;
g_assert (vl);
{
- gchar *const vstr = value_to_text (vl->value, dict, *write_spec);
+ gchar *const vstr = value_to_text (vl->value, dict, *format);
return g_strdup_printf (_("{%s,`%s'}_"), vstr,
val_lab_get_escaped_label (vl));
gchar *text;
get_selected_tuple (dialog, &value, &label);
- text = value_to_text (value, dialog->dict, *var_get_write_format (dialog->pv));
+ text = value_to_text (value, dialog->dict, *var_get_print_format (dialog->pv));
g_signal_handler_block (GTK_ENTRY (dialog->value_entry),
dialog->value_handler_id);
gchar *const vstr =
value_to_text (vl->value, dialog->dict,
- *var_get_write_format (dialog->pv));
+ *var_get_print_format (dialog->pv));
gchar *const text = g_strdup_printf (_("%s = `%s'"), vstr,
val_lab_get_escaped_label (vl));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2005, 2006, 2010 Free Software Foundation
+ Copyright (C) 2005, 2006, 2010, 2011 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
static void
set_local_width_decimals (struct var_type_dialog *dialog)
{
- dialog->fmt_l = * var_get_write_format (dialog->pv);
+ dialog->fmt_l = * var_get_print_format (dialog->pv);
switch (dialog->active_button)
{
static void
var_type_dialog_set_state (struct var_type_dialog *dialog)
{
- const struct fmt_spec *write_spec ;
+ const struct fmt_spec *format ;
GString *str = g_string_new ("");
g_assert (dialog);
g_assert (dialog->pv);
/* Populate width and decimals */
- write_spec = var_get_write_format (dialog->pv);
+ format = var_get_print_format (dialog->pv);
- g_string_printf (str, "%d", write_spec->d);
+ g_string_printf (str, "%d", format->d);
gtk_entry_set_text (GTK_ENTRY (dialog->entry_decimals),
str->str);
- g_string_printf (str, "%d", write_spec->w);
+ g_string_printf (str, "%d", format->w);
gtk_entry_set_text (GTK_ENTRY (dialog->entry_width),
str->str);
g_string_free (str, TRUE);
/* Populate the radio button states */
- switch (write_spec->type)
+ switch (format->type)
{
case FMT_F:
var_type_dialog_set_active_button (dialog, BUTTON_NUMERIC);
var_type_dialog_set_active_button (dialog, BUTTON_DOLLAR);
gtk_widget_show_all (dialog->width_decimals);
- select_treeview_from_format (dialog->dollar_treeview, write_spec);
+ select_treeview_from_format (dialog->dollar_treeview, format);
break;
case FMT_DATE:
case FMT_EDATE:
var_type_dialog_set_active_button (dialog, BUTTON_DATE);
gtk_widget_hide (dialog->width_decimals);
gtk_widget_show (dialog->date_format_list);
- select_treeview_from_format (dialog->date_format_treeview, write_spec);
+ select_treeview_from_format (dialog->date_format_treeview, format);
break;
case FMT_CCA:
case FMT_CCB:
case FMT_CCE:
var_type_dialog_set_active_button (dialog, BUTTON_CUSTOM);
select_treeview_from_format_type (dialog->custom_treeview,
- write_spec->type);
+ format->type);
gtk_widget_show_all (dialog->width_decimals);
break;
default: