text-item: Simplify text_item further to just hold a pivot_value.
[pspp] / src / output / odt.c
index c21acea3757a1d7d820f9df3628c25e7a388cc0e..82480bb3e365e58caffcb0218c0e05f4377539a5 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_value_to_string (f->marker, 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);
+        }
     }
 }
 
@@ -594,7 +598,11 @@ odt_submit (struct output_driver *driver,
   if (is_table_item (output_item))
     write_table (odt, to_table_item (output_item));
   else if (is_text_item (output_item))
-    odt_output_text (odt, text_item_get_text (to_text_item (output_item)));
+    {
+      char *text = text_item_get_plain_text (to_text_item (output_item));
+      odt_output_text (odt, text);
+      free (text);
+    }
   else if (is_message_item (output_item))
     {
       const struct message_item *message_item = to_message_item (output_item);