static void
ctables_table_output (struct ctables *ct, struct ctables_table *t)
{
- printf ("\n");
-
struct pivot_table *pt = pivot_table_create__ (
(t->title
? pivot_value_new_user_text (t->title, SIZE_MAX)
&& t->summary_specs.n > 1));
if (summary_dimension)
{
- printf ("summary_dimension\n");
struct pivot_dimension *d = pivot_dimension_create (
pt, t->slabels_axis, N_("Statistics"));
const struct ctables_summary_spec_set *specs = &t->summary_specs;
bool categories_dimension = t->clabels_example != NULL;
if (categories_dimension)
{
- printf ("categories_dimension\n");
struct pivot_dimension *d = pivot_dimension_create (
pt, t->label_axis[t->clabels_from_axis],
t->clabels_from_axis == PIVOT_AXIS_ROW
struct pivot_dimension *d[PIVOT_N_AXES];
for (enum pivot_axis_type a = 0; a < PIVOT_N_AXES; a++)
{
- d[a] = NULL;
- if (!t->axes[a] && a != t->summary_axis)
+ static const char *names[] = {
+ [PIVOT_AXIS_ROW] = N_("Rows"),
+ [PIVOT_AXIS_COLUMN] = N_("Columns"),
+ [PIVOT_AXIS_LAYER] = N_("Layers"),
+ };
+ d[a] = (t->axes[a] || a == t->summary_axis
+ ? pivot_dimension_create (pt, a, names[a])
+ : NULL);
+ if (!d[a])
continue;
+
assert (t->axes[a]);
for (size_t i = 0; i < t->stacks[a].n; i++)
};
}
- if (!n_levels)
- goto next_free;
-
- static const char *names[] = {
- [PIVOT_AXIS_ROW] = N_("Rows"),
- [PIVOT_AXIS_COLUMN] = N_("Columns"),
- [PIVOT_AXIS_LAYER] = N_("Layers"),
- };
- d[a] = pivot_dimension_create (pt, a, names[a]);
- printf ("%s dimension\n", names[a]);
-
/* Pivot categories:
- variable label for nest->vars[0], if vlabel != CTVL_NONE
cell->axes[a].leaf = prev_leaf;
}
- free (groups);
- next_free:
free (sorted);
+ free (groups);
free (levels);
free (sections);
}