sack works
[pspp] / src / output / spv / spv.c
index 9b0fe17a21ea4878ccac8e1be290b6003f3d1e35..7a3dae4d3d4a733834bf534534a1483b9ae9772e 100644 (file)
@@ -282,9 +282,9 @@ decode_container_text (const struct spvsx_container_text *ct)
 {
   struct font_style *font_style = xmalloc (sizeof *font_style);
   char *text = decode_embedded_html (ct->html->node_.raw, font_style);
+
   struct pivot_value *value = xmalloc (sizeof *value);
   *value = (struct pivot_value) {
-    .font_style = font_style,
     .text = {
       .type = PIVOT_VALUE_TEXT,
       .local = text,
@@ -293,6 +293,7 @@ decode_container_text (const struct spvsx_container_text *ct)
       .user_provided = true,
     },
   };
+  pivot_value_ex_rw (value)->font_style = font_style;
 
   struct output_item *item = text_item_create_value (TEXT_ITEM_LOG,
                                                      value, NULL);
@@ -320,6 +321,9 @@ decode_page_paragraph (const struct spvsx_page_paragraph *page_paragraph,
 {
   memset (ph, 0, sizeof *ph);
 
+  if (!page_paragraph)
+    return;
+
   const struct spvsx_page_paragraph_text *page_paragraph_text
     = page_paragraph->page_paragraph_text;
   if (!page_paragraph_text)
@@ -838,7 +842,6 @@ spv_read (const char *filename, struct output_item **outp,
   if (psp)
     *psp = NULL;
 
-  struct spv_reader *spv = xzalloc (sizeof *spv);
   struct zip_reader *zip;
   char *error = zip_reader_create (filename, &zip);
   if (error)
@@ -882,15 +885,13 @@ spv_decode_fmt_spec (uint32_t u32, struct fmt_spec *out)
   uint8_t w = u32 >> 8;
   uint8_t d = u32;
 
-  msg_disable ();
   *out = (struct fmt_spec) { .type = FMT_F, .w = w, .d = d };
   bool ok = raw_type >= 40 || fmt_from_io (raw_type, &out->type);
   if (ok)
     {
       fmt_fix_output (out);
-      ok = fmt_check_width_compat (out, 0);
+      ok = fmt_check_width_compat (*out, 0);
     }
-  msg_enable ();
 
   if (!ok)
     {