output: Rename page-eject-item to page-break-item.
[pspp] / src / output / spv / spv-legacy-decoder.c
index 1894092a14bf2e97e5b2bf8f5b084c1f620e5654..0b224405b7913a297f5236144d4ad804ae4e1edd 100644 (file)
@@ -203,7 +203,9 @@ spv_map_insert (struct hmap *map, double from, const char *to,
       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);
         }
     }
@@ -718,6 +720,9 @@ decode_label_frame (struct pivot_table *table,
               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;
     }
@@ -803,7 +808,8 @@ decode_spvdx_source_variable (const struct spvxml_node *node,
             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;
@@ -965,8 +971,8 @@ pivot_value_from_data_value (const struct spv_data_value *data,
               && 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;
@@ -1269,6 +1275,11 @@ add_dimension (struct spv_series **series, size_t n,
   /* Now drop unnamed 1-category groups and add parent pointers. */
   for (size_t j = 0; j < n_cats; j++)
     add_parents (cats[j], d->root, j);
+  for (size_t j = 0; j < d->n_leaves; j++)
+    {
+      d->data_leaves[j]->data_index = j;
+      d->presentation_leaves[j]->presentation_index = j;
+    }
 
   d->root->subs = cats;
   d->root->n_subs = n_cats;
@@ -1418,8 +1429,8 @@ apply_styles_to_value (struct pivot_table *table,
     {
       if (sf->reset > 0)
         {
-          free (value->footnotes);
-          value->footnotes = NULL;
+          free (value->footnote_indexes);
+          value->footnote_indexes = NULL;
           value->n_footnotes = 0;
         }