pivot-table: New functions for setting captions, etc.
[pspp] / src / language / stats / factor.c
index 4feece0da0b813018f63a36a3eb947f7214b0723..3c1ce6094e5a2854be019066efdffae0e6afa618 100644 (file)
@@ -250,7 +250,7 @@ struct idata
 static struct idata *
 idata_alloc (size_t n_vars)
 {
-  struct idata *id = xzalloc (sizeof (*id));
+  struct idata *id = XZALLOC (struct idata);
 
   id->n_extractions = 0;
   id->msr = gsl_vector_alloc (n_vars);
@@ -1945,8 +1945,11 @@ show_correlation_matrix (const struct cmd_factor *factor, const struct idata *id
     }
 
   if (factor->print & PRINT_DETERMINANT)
-    table->caption = pivot_value_new_user_text_nocopy (
-      xasprintf ("%s: %.2f", _("Determinant"), idata->detR));
+    {
+      struct pivot_value *caption = pivot_value_new_user_text_nocopy (
+        xasprintf ("%s: %.2f", _("Determinant"), idata->detR));
+      pivot_table_set_caption (table, caption);
+    }
 
   pivot_table_submit (table);
 }