X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fhtml.c;h=644ef49eba9e84082141fc1d5ef1cbb917eb9231;hb=d55fbbb4fda554d02c93dd46c6fa66128060e6f0;hp=ecaf729dd74e4377142dc7f40ec6669ce8df0379;hpb=21f20b8cb6460fd5ac9db7fde038bc00cfa80831;p=pspp
diff --git a/src/output/html.c b/src/output/html.c
index ecaf729dd7..644ef49eba 100644
--- a/src/output/html.c
+++ b/src/output/html.c
@@ -33,11 +33,10 @@
#include "libpspp/i18n.h"
#include "libpspp/message.h"
#include "libpspp/version.h"
-#ifdef HAVE_CAIRO
#include "output/cairo-chart.h"
-#endif
#include "output/chart-item.h"
#include "output/driver-provider.h"
+#include "output/image-item.h"
#include "output/message-item.h"
#include "output/options.h"
#include "output/output-item-provider.h"
@@ -60,10 +59,8 @@
struct html_driver
{
struct output_driver driver;
-#ifdef HAVE_CAIRO
struct cell_color fg;
struct cell_color bg;
-#endif
struct file_handle *handle;
char *chart_file_name;
@@ -201,10 +198,8 @@ html_create (struct file_handle *fh, enum settings_output_devices device_type,
fh_get_file_name (fh)));
html->file = NULL;
html->chart_cnt = 1;
-#ifdef HAVE_CAIRO
html->bg = parse_color (opt (d, o, "background-color", "#FFFFFFFFFFFF"));
html->fg = parse_color (opt (d, o, "foreground-color", "#000000000000"));
-#endif
html->file = fn_open (html->handle, "w");
if (html->file == NULL)
{
@@ -265,7 +260,17 @@ html_submit (struct output_driver *driver,
struct table_item *table_item = to_table_item (output_item);
html_output_table (html, table_item);
}
-#ifdef HAVE_CAIRO
+ else if (is_image_item (output_item) && html->chart_file_name != NULL)
+ {
+ struct image_item *image_item = to_image_item (output_item);
+ char *file_name = xr_write_png_image (
+ image_item->image, html->chart_file_name, ++html->chart_cnt);
+ if (file_name != NULL)
+ {
+ fprintf (html->file, "", file_name);
+ free (file_name);
+ }
+ }
else if (is_chart_item (output_item) && html->chart_file_name != NULL)
{
struct chart_item *chart_item = to_chart_item (output_item);
@@ -284,7 +289,6 @@ html_submit (struct output_driver *driver,
free (file_name);
}
}
-#endif /* HAVE_CAIRO */
else if (is_text_item (output_item))
{
struct text_item *text_item = to_text_item (output_item);
@@ -582,16 +586,20 @@ html_put_table_cell (struct html_driver *html, const struct pivot_table *pt,
if (cell->value->n_footnotes > 0)
{
fputs ("", html->file);
+ size_t n_footnotes = 0;
for (size_t i = 0; i < cell->value->n_footnotes; i++)
{
- if (i > 0)
- putc (',', html->file);
+ const struct pivot_footnote *f
+ = pt->footnotes[cell->value->footnote_indexes[i]];
+ if (f->show)
+ {
+ if (n_footnotes++ > 0)
+ putc (',', html->file);
- size_t idx = cell->value->footnote_indexes[i];
- const struct pivot_footnote *f = pt->footnotes[idx];
- char *marker = pivot_value_to_string (f->marker, pt);
- escape_string (html->file, marker, " ", "
");
- free (marker);
+ char *marker = pivot_footnote_marker_string (f, pt);
+ escape_string (html->file, marker, " ", "
");
+ free (marker);
+ }
}
fputs ("", html->file);
}