X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fhtml.c;h=29a44721d455ae3f0336e1f95d52610e9c5df1c1;hb=refs%2Fbuilds%2F20130812030507%2Fpspp;hp=989752b627fc9c54dcbf59410c5729769a96488c;hpb=d6ecde013d55ee2ea64d5f0e770d6d6325b44a88;p=pspp diff --git a/src/output/html.c b/src/output/html.c index 989752b627..29a44721d4 100644 --- a/src/output/html.c +++ b/src/output/html.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,7 +56,8 @@ struct html_driver FILE *file; size_t chart_cnt; - bool in_syntax; + bool css; + bool borders; }; static const struct output_driver_class html_driver_class; @@ -93,6 +94,8 @@ html_create (const char *file_name, enum settings_output_devices device_type, d = &html->driver; output_driver_init (&html->driver, &html_driver_class, file_name, device_type); + html->css = parse_boolean (opt (d, o, "css", "true")); + html->borders = parse_boolean (opt (d, o, "borders", "true")); html->file_name = xstrdup (file_name); html->chart_file_name = parse_chart_file_name (opt (d, o, "charts", @@ -103,7 +106,7 @@ html_create (const char *file_name, enum settings_output_devices device_type, html->file = fn_open (html->file_name, "w"); if (html->file == NULL) { - error (0, errno, _("error opening output file \"%s\""), html->file_name); + error (0, errno, _("error opening output file `%s'"), html->file_name); goto error; } @@ -113,62 +116,66 @@ html_create (const char *file_name, enum settings_output_devices device_type, fputs ("
\n", html->file); print_title_tag (html->file, "TITLE", _("PSPP Output")); fprintf (html->file, "\n", version); - fputs ("\n", - html->file); fputs ("\n", html->file); - fputs ("\n", - html->file); + "CONTENT=\"text/html; charset=utf-8\">\n", html->file); + + if ( html->css) + { + fputs ("\n", + html->file); + fputs ("\n", + html->file); + } fputs ("\n", html->file); fputs ("file); fputs (" LINK=\"#1f00ff\" ALINK=\"#ff0000\" VLINK=\"#9900dd\">\n", html->file); @@ -200,11 +207,6 @@ html_destroy (struct output_driver *driver) if (html->file != NULL) { - if (html->in_syntax) - { - fprintf (html->file, "\n"); - html->in_syntax = false; - } fprintf (html->file, "\n" "