pivot-table: Implement hiding footnotes.
[pspp] / src / output / html.c
index 3f07adcfeebd1dd634d19ba55c296054a21f0e5b..644ef49eba9e84082141fc1d5ef1cbb917eb9231 100644 (file)
@@ -586,17 +586,20 @@ html_put_table_cell (struct html_driver *html, const struct pivot_table *pt,
   if (cell->value->n_footnotes > 0)
     {
       fputs ("<sup>", html->file);
+      size_t n_footnotes = 0;
       for (size_t i = 0; i < cell->value->n_footnotes; i++)
         {
-          if (i > 0)
-            putc (',', html->file);
-
-          size_t idx = cell->value->footnote_indexes[i];
-          const struct pivot_footnote *f = pt->footnotes[idx];
+          const struct pivot_footnote *f
+            = pt->footnotes[cell->value->footnote_indexes[i]];
+          if (f->show)
+            {
+              if (n_footnotes++ > 0)
+                putc (',', html->file);
 
-          char *marker = pivot_footnote_marker_string (f, pt);
-          escape_string (html->file, marker, " ", "<br>");
-          free (marker);
+              char *marker = pivot_footnote_marker_string (f, pt);
+              escape_string (html->file, marker, " ", "<br>");
+              free (marker);
+            }
         }
       fputs ("</sup>", html->file);
     }