X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fodt.c;h=60a5b7fd4b337f257c1d6258960cbffdc5809188;hb=6fd821e557390a8f86f37c192fd1a4c4e057c9c3;hp=f0143515e0aac73f6a18aff018901ecc2e416a9a;hpb=a1b7813a6993b8a8822914a83982a52e98c2afe5;p=pspp diff --git a/src/output/odt.c b/src/output/odt.c index f0143515e0..60a5b7fd4b 100644 --- a/src/output/odt.c +++ b/src/output/odt.c @@ -496,7 +496,6 @@ write_table (struct odt_driver *odt, const struct table_item *item) for (c = 0 ; c < table_nc (tab) ; ++c) { struct table_cell cell; - size_t i; table_get_cell (tab, c, r, &cell); @@ -518,34 +517,27 @@ write_table (struct odt_driver *odt, const struct table_item *item) odt->content_wtr, _xml("table:number-rows-spanned"), "%d", rowspan); - for (i = 0; i < cell.n_contents; i++) + xmlTextWriterStartElement (odt->content_wtr, _xml("text:p")); + + if ( r < table_ht (tab) || c < table_hl (tab) ) + xmlTextWriterWriteAttribute (odt->content_wtr, _xml("text:style-name"), _xml("Table_20_Heading")); + else + xmlTextWriterWriteAttribute (odt->content_wtr, _xml("text:style-name"), _xml("Table_20_Contents")); + + if (cell.options & TAB_MARKUP) { - const struct cell_contents *contents = &cell.contents[i]; - int j; - - xmlTextWriterStartElement (odt->content_wtr, _xml("text:p")); - - if ( r < table_ht (tab) || c < table_hl (tab) ) - xmlTextWriterWriteAttribute (odt->content_wtr, _xml("text:style-name"), _xml("Table_20_Heading")); - else - xmlTextWriterWriteAttribute (odt->content_wtr, _xml("text:style-name"), _xml("Table_20_Contents")); - - if (contents->options & TAB_MARKUP) - { - /* XXX */ - char *s = output_get_text_from_markup ( - contents->text); - write_xml_with_line_breaks (odt, s); - free (s); - } - else - write_xml_with_line_breaks (odt, contents->text); - - for (j = 0; j < contents->n_footnotes; j++) - write_footnote (odt, contents->footnotes[j]); - - xmlTextWriterEndElement (odt->content_wtr); /* text:p */ + /* XXX */ + char *s = output_get_text_from_markup (cell.text); + write_xml_with_line_breaks (odt, s); + free (s); } + else + write_xml_with_line_breaks (odt, cell.text); + + for (int i = 0; i < cell.n_footnotes; i++) + write_footnote (odt, cell.footnotes[i]); + + xmlTextWriterEndElement (odt->content_wtr); /* text:p */ xmlTextWriterEndElement (odt->content_wtr); /* table:table-cell */ } else