- xmlTextWriterStartElement (odt->content_wtr, _xml("text:note"));
- xmlTextWriterWriteAttribute (odt->content_wtr, _xml("text:note-class"),
- _xml("footnote"));
-
- xmlTextWriterStartElement (odt->content_wtr, _xml("text:note-citation"));
- if (strlen (f->marker) > 1)
- xmlTextWriterWriteFormatAttribute (odt->content_wtr, _xml("text:label"),
- "(%s)", f->marker);
- else
- xmlTextWriterWriteAttribute (odt->content_wtr, _xml("text:label"),
- _xml(f->marker));
- xmlTextWriterEndElement (odt->content_wtr);
-
- xmlTextWriterStartElement (odt->content_wtr, _xml("text:note-body"));
- xmlTextWriterStartElement (odt->content_wtr, _xml("text:p"));
- write_xml_with_line_breaks (odt, f->content);
- xmlTextWriterEndElement (odt->content_wtr);
- xmlTextWriterEndElement (odt->content_wtr);
-
- xmlTextWriterEndElement (odt->content_wtr);
-}
-
-static void
-write_table_item_text (struct odt_driver *odt,
- const struct table_item_text *text)
-{
- if (!text)
- return;
-
- xmlTextWriterStartElement (odt->content_wtr, _xml("text:h"));
- xmlTextWriterWriteFormatAttribute (odt->content_wtr,
- _xml("text:outline-level"), "%d", 2);
- xmlTextWriterWriteString (odt->content_wtr, _xml (text->content));
- for (size_t i = 0; i < text->n_footnotes; i++)
- write_footnote (odt, text->footnotes[i]);
- xmlTextWriterEndElement (odt->content_wtr);
+ for (size_t i = 0; i < n_footnotes; i++)
+ {
+ const struct pivot_footnote *f = pt->footnotes[footnote_indexes[i]];
+ 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);
+ }
+ }