pivot-table: Add support for hiding the caption.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 29 Dec 2019 05:50:39 +0000 (05:50 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 29 Dec 2019 05:53:23 +0000 (05:53 +0000)
This will receive its first real user in an upcoming commit that adds
support for SPV files.

src/output/pivot-output.c
src/output/pivot-table.c
src/output/pivot-table.h

index fc41cb870f36d6439c3955982d1bed0760a42eaf..1394af4d09a539572e9a827ed5e2213acd1e1abd 100644 (file)
@@ -483,7 +483,7 @@ pivot_table_submit_layer (const struct pivot_table *pt,
       table_item_layers_destroy (layers);
     }
 
-  if (pt->caption)
+  if (pt->caption && pt->show_caption)
     {
       struct table_item_text *caption = pivot_value_to_table_item_text (
         pt->caption, &pt->areas[PIVOT_AREA_CAPTION], footnotes,
index ead1a1cc473ad81a8d30f08264746f42d74b8023..cc7ca59d0fc06487ce00b8c4dc216c13c4ead496 100644 (file)
@@ -701,6 +701,7 @@ pivot_table_create__ (struct pivot_value *title, const char *subtype)
 {
   struct pivot_table *table = xzalloc (sizeof *table);
   table->ref_cnt = 1;
+  table->show_caption = true;
   table->weight_format = (struct fmt_spec) { FMT_F, 40, 0 };
   table->title = title;
   table->subtype = pivot_value_new_text (subtype);
index f2f0c564ab6c88e6b7ac32f8257797b8811859ac..e36565bd48815b88678ab327c64ccf95fd464162 100644 (file)
@@ -385,6 +385,7 @@ struct pivot_table
     bool rotate_outer_row_labels;
     bool row_labels_in_corner;
     bool show_grid_lines;
+    bool show_caption;
     bool omit_empty;       /* Omit empty rows and columns? */
     size_t *current_layer; /* axis[PIVOT_AXIS_LAYER].n_dimensions elements. */
     char *table_look;