e.g. N_("Descriptive Statistics"). The un-translated text string is used as
the pivot table's subtype.
- Operations commonly performed on the new pivot_table:
-
- - If empty rows or columns should not be displayed, set ->omit_empty to
- true.
-
- - Set the format to use for "count" values with pivot_table_set_weight_var()
- or pivot_table_set_weight_format().
-
This function is a shortcut for pivot_table_create__() for the most common
case. Use pivot_table_create__() directly if the title should be some kind
of value other than an ordinary text string, or if the subtype should be
-different from the title.
+ different from the title.
See the large comment at the top of pivot-table.h for general advice on
creating pivot tables. */
}
/* Creates and returns a new pivot table with the given TITLE, and takes
- ownership of TITLE. The new pivot table's subtype is SUBTYPE, which
- should be an untranslated English string that describes the contents of
- the table at a high level without being specific about the variables or
- other context involved.
-
- Operations commonly performed on the new pivot_table:
+ ownership of TITLE. The new pivot table's subtype is SUBTYPE, which should
+ be an untranslated English string that describes the contents of the table
+ at a high level without being specific about the variables or other context
+ involved.
- - If empty rows or columns should not be displayed, set ->omit_empty to
- true.
-
- - Set the format to use for "count" values with pivot_table_set_weight_var()
- or pivot_table_set_weight_format().
+ TITLE and SUBTYPE may be NULL, but in that case the client must add them
+ later because they are both mandatory for a pivot table.
See the large comment at the top of pivot-table.h for general advice on
creating pivot tables. */
{
struct pivot_table *table = xzalloc (sizeof *table);
table->ref_cnt = 1;
+ table->show_title = true;
table->show_caption = true;
table->weight_format = (struct fmt_spec) { FMT_F, 40, 0 };
table->title = title;
struct pivot_value *value)
{
assert (n == table->n_dimensions);
+ for (size_t i = 0; i < n; i++)
+ assert (dindexes[i] < table->dimensions[i]->n_leaves);
if (value->type == PIVOT_VALUE_NUMERIC && !value->numeric.format.w)
{
settings_set_decimal_char (table->decimal);
pivot_table_dump_value (table->title, "title", indentation);
+ pivot_table_dump_value (table->subtype, "subtype", indentation);
pivot_table_dump_string (table->command_c, "command", indentation);
pivot_table_dump_string (table->dataset, "dataset", indentation);
pivot_table_dump_string (table->datafile, "datafile", indentation);
pivot_value_dump (d->root->name);
fputs (" =", stdout);
- struct pivot_value **names = xnmalloc (layer_axis->label_depth,
- sizeof *names);
+ struct pivot_value **names = xnmalloc (d->n_leaves, sizeof *names);
size_t n_names = 0;
for (const struct pivot_category *c
= d->presentation_leaves[layer_indexes[i]];
/* Appends a text representation of VALUE to OUT. SHOW_VALUES and
SHOW_VARIABLES control whether variable and value labels are included.
- Subscripts and superscripts and footnotes are included. */
+ Subscripts and footnotes are included. */
void
pivot_value_format (const struct pivot_value *value,
enum settings_value_show show_values,
ds_put_format (out, "%c%s", i ? ',' : '_', value->subscripts[i]);
}
- if (value->superscript)
- ds_put_format (out, "^%s", value->superscript);
-
for (size_t i = 0; i < value->n_footnotes; i++)
{
ds_put_byte (out, '^');
free (value->subscripts[i]);
free (value->subscripts);
- free (value->superscript);
-
switch (value->type)
{
case PIVOT_VALUE_NUMERIC: