pivot-table: Fix memory leak in pivot_table_destroy()
[pspp] / src / output / render.c
index ebe259d85da518692d5fa4ed5bbe5a2f82895add..21fd53dc91a565b7c582dc18836490a9c2f4683a 100644 (file)
@@ -714,8 +714,8 @@ render_page_create (const struct render_params *params, struct table *table,
 {
   enum { MIN, MAX };
 
-  int nc = table_nc (table);
-  int nr = table_nr (table);
+  int nc = table->n[H];
+  int nr = table->n[V];
 
   /* Figure out rule widths. */
   int *rules[TABLE_N_AXES];
@@ -790,7 +790,7 @@ render_page_create (const struct render_params *params, struct table *table,
   /* Decide final column widths. */
   int table_widths[2];
   for (int i = 0; i < 2; i++)
-    table_widths[i] = calculate_table_width (table_nc (table),
+    table_widths[i] = calculate_table_width (table->n[H],
                                              columns[i], rules[H]);
 
   struct render_page *page;
@@ -1619,7 +1619,9 @@ render_pager_create (const struct render_params *params,
      they won't break across as much vertical space, thus shrinking the table
      vertically more than the scale would imply.  Shrinking only as much as
      necessary would require an iterative search. */
-  if (table_item->pt && table_item->pt->look->shrink_to_fit[V])
+  if (table_item->pt
+      && table_item->pt->look->shrink_to_fit[V]
+      && params->ops->scale)
     {
       int total_height = 0;
       for (size_t i = 0; i < p->n_pages; i++)