X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fspv%2Fspv.c;h=398ca59951557246319c514d6b093530cc14f92b;hb=3fa740d165a0c2ef7c03b11633f65c421f07f0a2;hp=83fba9631cc9287f2e3d3cb5b1de99f4493f17fe;hpb=03da9f47f9e0980a10246060636f744a3f83763c;p=pspp diff --git a/src/output/spv/spv.c b/src/output/spv/spv.c index 83fba9631c..398ca59951 100644 --- a/src/output/spv/spv.c +++ b/src/output/spv/spv.c @@ -39,6 +39,7 @@ #include "output/spv/spv-legacy-data.h" #include "output/spv/spv-legacy-decoder.h" #include "output/spv/spv-light-decoder.h" +#include "output/spv/spv-table-look.h" #include "output/spv/structure-xml-parser.h" #include "gl/c-ctype.h" @@ -101,7 +102,7 @@ spv_item_class_from_string (const char *name) SPV_CLASSES #undef SPV_CLASS - return SPV_N_CLASSES; + return (enum spv_item_class) SPV_N_CLASSES; } enum spv_item_type @@ -259,7 +260,7 @@ spv_item_destroy (struct spv_item *item) free (item->children); pivot_table_unref (item->table); - spv_legacy_properties_destroy (item->legacy_properties); + spv_table_look_destroy (item->table_look); free (item->bin_member); free (item->xml_member); free (item->subtype); @@ -827,7 +828,7 @@ pivot_table_open_legacy (struct spv_item *item) error = spvxml_context_finish (&ctx, &v->node_); if (!error) - error = decode_spvdx_table (v, item->subtype, item->legacy_properties, + error = decode_spvdx_table (v, item->subtype, item->table_look, &data, &item->table); if (error) @@ -905,8 +906,10 @@ spv_decode_container (const struct spvsx_container *c, if (ts->path) { item->xml_member = ts->path ? xstrdup (ts->path->text) : NULL; - char *error = decode_spvsx_legacy_properties ( - table->table_properties, &item->legacy_properties); + char *error = (table->table_properties + ? spv_table_look_decode (table->table_properties, + &item->table_look) + : xstrdup ("Legacy table lacks tableProperties")); if (error) { spv_item_destroy (item); @@ -1184,6 +1187,21 @@ spv_close (struct spv_reader *spv) } } +void +spv_item_set_table_look (struct spv_item *item, + const struct spv_table_look *look) +{ + /* If this is a table, install the table look in it. + + (We can't just set item->table_look because light tables ignore it and + legacy tables sometimes override it.) */ + if (spv_item_is_table (item)) + spv_table_look_install (look, spv_item_get_table (item)); + + for (size_t i = 0; i < item->n_children; i++) + spv_item_set_table_look (item->children[i], look); +} + char * WARN_UNUSED_RESULT spv_decode_fmt_spec (uint32_t u32, struct fmt_spec *out) {