X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fodt.c;fp=src%2Foutput%2Fodt.c;h=a29c045d0b67e8920344a0e3e0b6f6a5f99f4db8;hb=8dd405d0900f29f69e54726a79045c119146de89;hp=21aaeb6c1a723ebe9927a0d02beb85fc67456c24;hpb=7ee8dbfc15aa4580c2132e53b64f13815fc93c62;p=pspp diff --git a/src/output/odt.c b/src/output/odt.c index 21aaeb6c1a..a29c045d0b 100644 --- a/src/output/odt.c +++ b/src/output/odt.c @@ -454,6 +454,7 @@ static void write_table (struct odt_driver *odt, const struct table_item *item) { const struct table *tab = table_item_get_table (item); + const char *caption = table_item_get_caption (item); const char *title = table_item_get_title (item); int r, c; @@ -560,6 +561,18 @@ write_table (struct odt_driver *odt, const struct table_item *item) } xmlTextWriterEndElement (odt->content_wtr); /* table */ + + /* Write a caption for the table */ + if (caption != NULL) + { + xmlTextWriterStartElement (odt->content_wtr, _xml("text:h")); + xmlTextWriterWriteFormatAttribute (odt->content_wtr, + _xml("text:outline-level"), "%d", 2); + xmlTextWriterWriteString (odt->content_wtr, + _xml (table_item_get_caption (item)) ); + xmlTextWriterEndElement (odt->content_wtr); + } + } static void