else
{
union value v = { .f = mapping->to.d };
- mapping->to.s = data_out_stretchy (&v, NULL, format, NULL);
+ mapping->to.s = data_out_stretchy (&v, NULL, format,
+ settings_get_fmt_settings (),
+ NULL);
mapping->to.width = strlen (mapping->to.s);
}
}
static void
decode_spvdx_style_incremental (const struct spvdx_style *in,
const struct spvdx_style *bg,
- struct area_style *out)
+ struct table_area_style *out)
{
if (in && in->font_weight)
out->font_style.bold = in->font_weight == SPVDX_FONT_WEIGHT_BOLD;
static void
decode_spvdx_style (const struct spvdx_style *in,
const struct spvdx_style *bg,
- struct area_style *out)
+ struct table_area_style *out)
{
- *out = (struct area_style) AREA_STYLE_INITIALIZER;
+ *out = (struct table_area_style) TABLE_AREA_STYLE_INITIALIZER;
decode_spvdx_style_incremental (in, bg, out);
}
return NULL;
struct pivot_value **target;
- struct area_style *area;
+ struct table_area_style *area;
if (lf->label->purpose == SPVDX_PURPOSE_TITLE)
{
target = &table->title;
- area = &table->areas[PIVOT_AREA_TITLE];
+ area = &table->look->areas[PIVOT_AREA_TITLE];
}
else if (lf->label->purpose == SPVDX_PURPOSE_SUB_TITLE)
{
target = &table->caption;
- area = &table->areas[PIVOT_AREA_CAPTION];
+ area = &table->look->areas[PIVOT_AREA_CAPTION];
}
else if (lf->label->purpose == SPVDX_PURPOSE_FOOTNOTE)
{
&& lf->label->text[0]->uses_reference != INT_MIN)
{
target = NULL;
- area = &table->areas[PIVOT_AREA_FOOTER];
+ area = &table->look->areas[PIVOT_AREA_FOOTER];
}
else
return NULL;
else if (lf->label->purpose == SPVDX_PURPOSE_LAYER)
{
target = NULL;
- area = &table->areas[PIVOT_AREA_LAYERS];
+ area = &table->look->areas[PIVOT_AREA_LAYERS];
}
else
return NULL;
- area_style_uninit (area);
+ table_area_style_uninit (area);
decode_spvdx_style (lf->label->style, lf->label->text_frame_style, area);
if (target)
if (label_series->values[i].width < 0)
{
union value v = { .f = label_series->values[i].d };
- dest = data_out_stretchy (&v, "UTF-8", &s->format, NULL);
+ dest = data_out_stretchy (&v, "UTF-8", &s->format,
+ settings_get_fmt_settings (), NULL);
}
else
dest = label_series->values[i].s;
&& len == 23
&& data->s[len] == '\0')
{
- double date = calendar_gregorian_to_offset (year, month, day,
- NULL);
+ double date = calendar_gregorian_to_offset (
+ year, month, day, settings_get_fmt_settings (), NULL);
if (date != SYSMIS)
{
v->type = PIVOT_VALUE_NUMERIC;
= find_facet_level (v, base_facet_level + n);
if (fl)
{
- struct area_style *area = (axis_type == PIVOT_AXIS_COLUMN
- ? &table->areas[PIVOT_AREA_COLUMN_LABELS]
- : axis_type == PIVOT_AXIS_ROW
- ? &table->areas[PIVOT_AREA_ROW_LABELS]
- : NULL);
+ struct table_area_style *area
+ = (axis_type == PIVOT_AXIS_COLUMN
+ ? &table->look->areas[PIVOT_AREA_COLUMN_LABELS]
+ : axis_type == PIVOT_AXIS_ROW
+ ? &table->look->areas[PIVOT_AREA_ROW_LABELS]
+ : NULL);
if (area && fl->axis->label)
{
- area_style_uninit (area);
+ table_area_style_uninit (area);
decode_spvdx_style (fl->axis->label->style,
fl->axis->label->text_frame_style, area);
}
decode_spvdx_style_incremental (
fl2->axis->major_ticks->style,
fl2->axis->major_ticks->tick_frame_style,
- &table->areas[PIVOT_AREA_ROW_LABELS]);
+ &table->look->areas[PIVOT_AREA_ROW_LABELS]);
}
const struct spvdx_facet_level *fl3 = find_facet_level (v, base_facet_level);
apply_styles_to_value (struct pivot_table *table,
struct pivot_value *value,
const struct spvdx_set_format *sf,
- const struct area_style *base_area_style,
+ const struct table_area_style *base_area_style,
const struct spvdx_style *fg,
const struct spvdx_style *bg)
{
{
if (sf->reset > 0)
{
- free (value->footnotes);
- value->footnotes = NULL;
+ free (value->footnote_indexes);
+ value->footnote_indexes = NULL;
value->n_footnotes = 0;
}
}
if (fg || bg)
{
- struct area_style area;
+ struct table_area_style area;
pivot_value_get_style (
value,
value->font_style ? value->font_style : &base_area_style->font_style,
&area);
decode_spvdx_style_incremental (fg, bg, &area);
pivot_value_set_style (value, &area);
- area_style_uninit (&area);
+ table_area_style_uninit (&area);
}
}
&& !interval && !major_ticks && !frame && !set_format)
{
/* Sets alt_fg_color and alt_bg_color. */
- struct area_style area;
+ struct table_area_style area;
decode_spvdx_style (labeling, graph, &area);
- table->areas[PIVOT_AREA_DATA].font_style.fg[1]
+ table->look->areas[PIVOT_AREA_DATA].font_style.fg[1]
= area.font_style.fg[0];
- table->areas[PIVOT_AREA_DATA].font_style.bg[1]
+ table->look->areas[PIVOT_AREA_DATA].font_style.bg[1]
= area.font_style.bg[0];
- area_style_uninit (&area);
+ table_area_style_uninit (&area);
}
else if (graph
&& !labeling && !interval && !major_ticks && !frame && !set_format)
struct pivot_category *c = find_category (s, include);
if (c)
{
- const struct area_style *base_area_style
+ const struct table_area_style *base_area_style
= (c->dimension->axis_type == PIVOT_AXIS_ROW
- ? &table->areas[PIVOT_AREA_ROW_LABELS]
- : &table->areas[PIVOT_AREA_COLUMN_LABELS]);
+ ? &table->look->areas[PIVOT_AREA_ROW_LABELS]
+ : &table->look->areas[PIVOT_AREA_COLUMN_LABELS]);
apply_styles_to_value (table, c->name, set_format,
base_area_style, major_ticks, frame);
}
goto skip;
}
apply_styles_to_value (table, cell->value, set_format,
- &table->areas[PIVOT_AREA_DATA],
+ &table->look->areas[PIVOT_AREA_DATA],
labeling, interval);
skip: ;
struct pivot_cell *cell;
HMAP_FOR_EACH (cell, struct pivot_cell, hmap_node, &table->cells)
apply_styles_to_value (table, cell->value, set_format,
- &table->areas[PIVOT_AREA_DATA],
+ &table->look->areas[PIVOT_AREA_DATA],
NULL, NULL);
}
}
char * WARN_UNUSED_RESULT
decode_spvdx_table (const struct spvdx_visualization *v, const char *subtype,
- const struct spv_table_look *look,
+ const struct pivot_table_look *look,
struct spv_data *data, struct pivot_table **outp)
{
struct pivot_table *table = pivot_table_create__ (NULL, subtype);
- spv_table_look_install (look, table);
+
+ pivot_table_set_look (table, look);
+ table->look = pivot_table_look_unshare (table->look);
struct hmap series_map = HMAP_INITIALIZER (series_map);
struct hmap format_map = HMAP_INITIALIZER (format_map);
&min_width, &max_width, &n)
&& v->graph->cell_style->width[n] == '\0')
{
- table->sizing[TABLE_HORZ].range[0] = min_width;
- table->sizing[TABLE_HORZ].range[1] = max_width;
+ table->look->width_ranges[TABLE_HORZ][0] = min_width;
+ table->look->width_ranges[TABLE_HORZ][1] = max_width;
}
}
}
if (v->graph->interval->labeling->style)
{
- area_style_uninit (&table->areas[PIVOT_AREA_DATA]);
+ table_area_style_uninit (&table->look->areas[PIVOT_AREA_DATA]);
decode_spvdx_style (v->graph->interval->labeling->style,
v->graph->cell_style,
- &table->areas[PIVOT_AREA_DATA]);
+ &table->look->areas[PIVOT_AREA_DATA]);
}
/* Decode all of the sourceVariable and derivedVariable */