axis->dimensions, (axis->n_dimensions + 1) * sizeof *axis->dimensions);
axis->dimensions[axis->n_dimensions++] = d;
+ if (axis_type == PIVOT_AXIS_LAYER)
+ {
+ free (table->current_layer);
+ table->current_layer = xcalloc (axis[PIVOT_AXIS_LAYER].n_dimensions,
+ sizeof *table->current_layer);
+ }
+
/* XXX extent and label_depth need to be calculated later. */
return d;
pivot_category_destroy (d->root);
free (d->data_leaves);
free (d->presentation_leaves);
+ free (d);
}
/* Returns the first leaf node in an in-order traversal that is a child of
pivot_value_destroy (c->name);
for (size_t i = 0; i < c->n_subs; i++)
pivot_category_destroy (c->subs[i]);
+ free (c->subs);
free (c);
}
\f
font_style_uninit (value->font_style);
free (value->font_style);
free (value->cell_style);
- for (size_t i = 0; i < value->n_footnotes; i++)
- pivot_footnote_destroy (value->footnotes[i]);
+ /* Do not free the elements of footnotes because VALUE does not own
+ them. */
free (value->footnotes);
switch (value->type)
free (value->numeric.value_label);
break;
- case SETTINGS_VALUE_SHOW_VALUE:
+ case PIVOT_VALUE_STRING:
+ free (value->string.s);
free (value->string.var_name);
free (value->string.value_label);
break;
struct pivot_value *pv = xzalloc (sizeof *pv);
if (width > 0)
{
- char *s = recode_string (UTF8, encoding,
- CHAR_CAST (char *, value_str (value, width)),
+ char *s = recode_string (UTF8, encoding, CHAR_CAST (char *, value->s),
width);
size_t n = strlen (s);
while (n > 0 && s[n - 1] == ' ')