#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"
xmlTextWriterStartElement (w, _xml ("office:meta"));
{
xmlTextWriterStartElement (w, _xml ("meta:generator"));
- xmlTextWriterWriteString (w, _xml (stat_version));
+ xmlTextWriterWriteString (w, _xml (version));
xmlTextWriterEndElement (w);
}
}
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)
odt = xzalloc (sizeof *odt);
d = &odt->driver;
+
output_driver_init (d, &odt_driver_class, file_name, device_type);
odt->zip = zip;
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;
}
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