value: Get rid of value_str(), value_str_rw(), value_num().
[pspp] / src / output / pivot-table.c
index 2adcf62634d32a3385a513cd85e344b9870a0d77..dc15285b48b130d0eb94b9b5ca2e2d6c557cfb6b 100644 (file)
@@ -279,6 +279,13 @@ pivot_dimension_create__ (struct pivot_table *table,
     axis->dimensions, (axis->n_dimensions + 1) * sizeof *axis->dimensions);
   axis->dimensions[axis->n_dimensions++] = d;
 
+  if (axis_type == PIVOT_AXIS_LAYER)
+    {
+      free (table->current_layer);
+      table->current_layer = xcalloc (axis[PIVOT_AXIS_LAYER].n_dimensions,
+                                      sizeof *table->current_layer);
+    }
+
   /* XXX extent and label_depth need to be calculated later. */
 
   return d;
@@ -2017,8 +2024,7 @@ pivot_value_new_value (const union value *value, int width,
   struct pivot_value *pv = xzalloc (sizeof *pv);
   if (width > 0)
     {
-      char *s = recode_string (UTF8, encoding,
-                               CHAR_CAST (char *, value_str (value, width)),
+      char *s = recode_string (UTF8, encoding, CHAR_CAST (char *, value->s),
                                width);
       size_t n = strlen (s);
       while (n > 0 && s[n - 1] == ' ')