projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
output: Introduce pivot tables.
[pspp]
/
src
/
data
/
variable.c
diff --git
a/src/data/variable.c
b/src/data/variable.c
index 14b122fee0eb1d2cdbe95b1fbc22bfa6757dbfda..25b3228de345fb1399440586c85059bb77be9358 100644
(file)
--- a/
src/data/variable.c
+++ b/
src/data/variable.c
@@
-571,33
+571,28
@@
void
var_append_value_name (const struct variable *v, const union value *value,
struct string *str)
{
var_append_value_name (const struct variable *v, const union value *value,
struct string *str)
{
- enum settings_value_style style = settings_get_value_style ();
- const char *name = var_lookup_value_label (v, value);
+ const char *label = var_lookup_value_label (v, value);
- switch (s
tyle
)
+ switch (s
ettings_get_show_values ()
)
{
{
- case SETTINGS_VAL
_STYLE_VALUES
:
+ case SETTINGS_VAL
UE_SHOW_VALUE
:
append_value (v, value, str);
break;
append_value (v, value, str);
break;
- case SETTINGS_VAL_STYLE_LABELS:
- if (name == NULL)
- append_value (v, value, str);
+ default:
+ case SETTINGS_VALUE_SHOW_LABEL:
+ if (label)
+ ds_put_cstr (str, label);
else
else
-
ds_put_cstr (str, name
);
+
append_value (v, value, str
);
break;
break;
- case SETTINGS_VAL_STYLE_BOTH:
- default:
+ case SETTINGS_VALUE_SHOW_BOTH:
append_value (v, value, str);
append_value (v, value, str);
- if (name != NULL)
- {
- ds_put_cstr (str, " (");
- ds_put_cstr (str, name);
- ds_put_cstr (str, ")");
- }
+ if (label != NULL)
+ ds_put_format (str, " %s", label);
break;
break;
- }
;
+ }
}
\f
/* Print and write formats. */
}
\f
/* Print and write formats. */
@@
-720,24
+715,19
@@
update_vl_string (const struct variable *v)
const char *
var_to_string (const struct variable *v)
{
const char *
var_to_string (const struct variable *v)
{
- enum settings_var_style style = settings_get_var_style ();
-
- switch (style)
- {
- case SETTINGS_VAR_STYLE_NAMES:
+ switch (settings_get_show_variables ())
+ {
+ case SETTINGS_VALUE_SHOW_VALUE:
return v->name;
return v->name;
- break;
- case SETTINGS_VAR_STYLE_LABELS:
+
+ case SETTINGS_VALUE_SHOW_LABEL:
+ default:
return v->label != NULL ? v->label : v->name;
return v->label != NULL ? v->label : v->name;
- break;
- case SETTINGS_VA
R_STYLE
_BOTH:
+
+ case SETTINGS_VA
LUE_SHOW
_BOTH:
update_vl_string (v);
return ds_cstr (&v->name_and_label);
update_vl_string (v);
return ds_cstr (&v->name_and_label);
- break;
- default:
- NOT_REACHED ();
- break;
- };
+ }
}
/* Returns V's variable label, or a null pointer if it has none. */
}
/* Returns V's variable label, or a null pointer if it has none. */