vme->from);
char *error = spv_map_insert (map, from, vme->to, true,
- &(struct fmt_spec) { FMT_A, 40, 0 });
+ &(struct fmt_spec) { .type = FMT_A, .w = 40 });
if (error)
return error;
if (d < 0 || d > 15)
d = 2;
- struct fmt_spec f = (struct fmt_spec) { type, 40, d };
+ struct fmt_spec f = (struct fmt_spec) { .type = type, .w = 40, .d = d };
fmt_fix_output (&f);
return f;
}
value->text.local = new;
}
}
+ if (!value->text.local)
+ value->text.local = xstrdup ("");
+ value->text.c = value->text.id = value->text.local;
pivot_value_destroy (*target);
*target = value;
}
static char * WARN_UNUSED_RESULT
decode_spvdx_source_variable (const struct spvxml_node *node,
- struct spv_data *data,
+ const struct spv_data *data,
struct hmap *series_map)
{
const struct spvdx_source_variable *sv = spvdx_cast_source_variable (node);
struct spv_series *s = xzalloc (sizeof *s);
s->name = xstrdup (node->id);
s->xml = node;
- s->label = sv->label ? xstrdup (sv->label) : NULL;
+ s->label = xstrdup_if_nonnull (sv->label);
s->label_series = label_series;
s->values = spv_data_values_clone (var->values, var->n_values);
s->n_values = var->n_values;
{
if (sf)
{
- if (sf->reset > 0)
+ if (sf->reset > 0 && value->ex)
{
- free (value->footnote_indexes);
- value->footnote_indexes = NULL;
- value->n_footnotes = 0;
+ free (value->ex->footnote_indexes);
+ value->ex->footnote_indexes = NULL;
+ value->ex->n_footnotes = 0;
}
struct fmt_spec format = { .w = 0 };
}
if (fg || bg)
{
+ const struct pivot_value_ex *ex = pivot_value_ex (value);
struct table_area_style area;
pivot_value_get_style (
value,
- value->font_style ? value->font_style : &base_area_style->font_style,
- value->cell_style ? value->cell_style : &base_area_style->cell_style,
+ ex->font_style ? ex->font_style : &base_area_style->font_style,
+ ex->cell_style ? ex->cell_style : &base_area_style->cell_style,
&area);
decode_spvdx_style_incremental (fg, bg, &area);
pivot_value_set_style (value, &area);
char * WARN_UNUSED_RESULT
decode_spvdx_table (const struct spvdx_visualization *v, const char *subtype,
const struct pivot_table_look *look,
- struct spv_data *data, struct pivot_table **outp)
+ const struct spv_data *data, struct pivot_table **outp)
{
struct pivot_table *table = pivot_table_create__ (NULL, subtype);
if (value->type == PIVOT_VALUE_NUMERIC
&& value->numeric.x == SYSMIS
- && !value->n_footnotes)
+ && !pivot_value_ex (value)->n_footnotes)
{
/* Apparently, system-missing values are just empty cells? */
pivot_value_destroy (value);