pivot-table: Implement hiding footnotes.
[pspp] / src / output / odt.c
index 406ef14069c32b31f2d1661f24343f2b540223e7..4a87815548d43b2473e58f977e233870470e2663 100644 (file)
@@ -423,14 +423,18 @@ write_footnotes (struct odt_driver *odt,
 {
   for (size_t i = 0; i < n_footnotes; i++)
     {
-      xmlTextWriterStartElement (odt->content_wtr, _xml("text:span"));
-      xmlTextWriterWriteAttribute (odt->content_wtr, _xml("text:style-name"),
-                                   _xml("superscript"));
       const struct pivot_footnote *f = pt->footnotes[footnote_indexes[i]];
-      char *s = pivot_footnote_marker_string (f, pt);
-      write_xml_with_line_breaks (odt, s);
-      free (s);
-      xmlTextWriterEndElement (odt->content_wtr);
+      if (f->show)
+        {
+          xmlTextWriterStartElement (odt->content_wtr, _xml("text:span"));
+          xmlTextWriterWriteAttribute (odt->content_wtr,
+                                       _xml("text:style-name"),
+                                       _xml("superscript"));
+          char *s = pivot_footnote_marker_string (f, pt);
+          write_xml_with_line_breaks (odt, s);
+          free (s);
+          xmlTextWriterEndElement (odt->content_wtr);
+        }
     }
 }