#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"
SPV_CLASSES
#undef SPV_CLASS
- return SPV_N_CLASSES;
+ return (enum spv_item_class) SPV_N_CLASSES;
}
enum spv_item_type
free (item->children);
pivot_table_unref (item->table);
- spv_legacy_properties_destroy (item->legacy_properties);
+ pivot_table_look_unref (item->table_look);
free (item->bin_member);
free (item->xml_member);
free (item->subtype);
else
{
uint8_t r, g, b;
- if (sscanf (color, "rgb (%"SCNu8", %"SCNu8", %"SCNu8" )",
+ if (sscanf (color, "rgb (%"SCNu8", %"SCNu8", %"SCNu8")",
&r, &g, &b) == 3)
{
char color2[8];
Do the same for U+2007 FIGURE SPACE, which also crops out weirdly
sometimes. */
ds_extend (s, ds_length (s) + xmlStrlen (node->content));
- for (const uint8_t *p = node->content; *p; )
+ for (const uint8_t *p = node->content; *p;)
{
int c;
if (p[0] == 0xc2 && p[1] == 0xa0)
struct spvbin_input input;
spvbin_input_init (&input, data, size);
- struct spvlb_table *table;
+ struct spvlb_table *table = NULL;
error = (!size
? xasprintf ("light table member is empty")
: !spvlb_parse_table (&input, &table)
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)
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);
{
const struct spvxml_node *node = seq[i];
- char *error;
+ char *error = NULL;
if (spvsx_is_container (node))
{
const struct spvsx_container *container
}
}
+void
+spv_item_set_table_look (struct spv_item *item,
+ const struct pivot_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))
+ pivot_table_set_look (spv_item_get_table (item), look);
+
+ 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)
{