X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fodt.c;h=065ef379a6d176455dde3d0a523b1c7ea28872b8;hb=8180c5dd1591446174c0753ee960921786113403;hp=a29c045d0b67e8920344a0e3e0b6f6a5f99f4db8;hpb=0df9cdd3df66caf4353128feff3008289cda8115;p=pspp diff --git a/src/output/odt.c b/src/output/odt.c index a29c045d0b..065ef379a6 100644 --- a/src/output/odt.c +++ b/src/output/odt.c @@ -36,6 +36,7 @@ #include "libpspp/temp-file.h" #include "libpspp/version.h" #include "libpspp/zip-writer.h" +#include "data/file-handle-def.h" #include "output/driver-provider.h" #include "output/message-item.h" #include "output/options.h" @@ -148,7 +149,7 @@ write_style_data (struct odt_driver *odt) _xml ("urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0") ); xmlTextWriterWriteAttribute (w, _xml ("office:version"), _xml ("1.1")); - + xmlTextWriterStartElement (w, _xml ("office:styles")); @@ -244,7 +245,7 @@ write_meta_data (struct odt_driver *odt) xmlTextWriterStartElement (w, _xml ("office:meta")); { xmlTextWriterStartElement (w, _xml ("meta:generator")); - xmlTextWriterWriteString (w, _xml (stat_version)); + xmlTextWriterWriteString (w, _xml (version)); xmlTextWriterEndElement (w); } @@ -290,12 +291,13 @@ write_meta_data (struct odt_driver *odt) } static struct output_driver * -odt_create (const char *file_name, enum settings_output_devices device_type, +odt_create (struct file_handle *fh, enum settings_output_devices device_type, struct string_map *o UNUSED) { struct output_driver *d; struct odt_driver *odt; struct zip_writer *zip; + const char *file_name = fh_get_file_name (fh); zip = zip_writer_create (file_name); if (zip == NULL) @@ -303,6 +305,7 @@ odt_create (const char *file_name, enum settings_output_devices device_type, odt = xzalloc (sizeof *odt); d = &odt->driver; + output_driver_init (d, &odt_driver_class, file_name, device_type); odt->zip = zip; @@ -382,7 +385,7 @@ odt_destroy (struct output_driver *driver) zip_writer_close (odt->zip); } - + free (odt->file_name); free (odt->command_name); free (odt); @@ -471,7 +474,7 @@ write_table (struct odt_driver *odt, const struct table_item *item) /* Start table */ xmlTextWriterStartElement (odt->content_wtr, _xml("table:table")); - xmlTextWriterWriteFormatAttribute (odt->content_wtr, _xml("table:name"), + xmlTextWriterWriteFormatAttribute (odt->content_wtr, _xml("table:name"), "TABLE-%d", odt->table_num++); @@ -484,7 +487,7 @@ write_table (struct odt_driver *odt, const struct table_item *item) /* Deal with row headers */ if ( table_ht (tab) > 0) xmlTextWriterStartElement (odt->content_wtr, _xml("table:table-header-rows")); - + /* Write all the rows */ for (r = 0 ; r < table_nr (tab); ++r) @@ -553,7 +556,7 @@ write_table (struct odt_driver *odt, const struct table_item *item) table_cell_free (&cell); } - + xmlTextWriterEndElement (odt->content_wtr); /* row */ if ( table_ht (tab) > 0 && r == table_ht (tab) - 1)