Commit 4152a7f6 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Add include for gsf-output.h (applix_write) : tidy up the constness.


2002-11-29  Jody Goldberg <jody@gnome.org>

	* applix-write.c : Add include for gsf-output.h
	(applix_write) : tidy up the constness.

2002-11-29  Jody Goldberg <jody@gnome.org>

	* ms-excel-write.c (excel_write_WINDOW1) : make view const
	(excel_write_state_new) : ditto.

	* ms-excel-read.c (excel_prepare_autofilter) : new.
	(excel_read_NAME) : handle autofilters.

	* ms-escher.c (ms_escher_read_ClientTextbox) : store the text.

	* plugins/excel/boot.c (excel_save) : make the view const not the
	  output.
	(excel_dsf_file_save) : ditto.
	(excel_biff8_file_save) : ditto.
	(excel_biff7_file_save) : ditto.

2002-11-26  Jody Goldberg <jody@gnome.org>

	* ms-excel-read.c (ms_sheet_create_obj) : use the new label setting
	  utilities.


2002-11-29  Jody Goldberg <jody@gnome.org>

	* src/workbook-control-gui.c (wbcg_menu_state_update) : add auto
	  filter.
	(cb_auto_filter) : initial quicky implementation.
	(cb_data_pivottable) : ditto.
	(workbook_control_gui_init) : init the autofilter.

	* src/value.c (value_equal) : new util.
	(value_cmp) : new.

	* src/style-color.c (gnumeric_color_init) : add green.

	* src/stf.c : quiet a few warnings.

	* src/sheet.c (sheet_new) : init filters and pivots.
	(sheet_destroy_contents) : free the filters and pivots.
	(sheet_range_calc_spans) : no one sets NO_DRAW so don't check for it.
	(sheet_cell_calc_span) : ditto.

	* src/sheet-view.c (sv_edit_pos_in_filter) : new.

	* src/sheet-object.c (sheet_object_print) : no warning if the object
	  does not print.
	(sheet_object_clone) : nor is it a problem if it can not be cloned.

	* src/sheet-object-widget.c (sheet_widget_button_set_label) : new.
	(sheet_widget_checkbox_set_label) : new.
	(cb_checkbox_config_cancel_clicked) :use sheet_widget_checkbox_set_label
	(cb_checkbox_label_changed) : ditto.
	(sheet_widget_radio_button_finalize) : free the label.
	(sheet_widget_radio_button_set_label) : new.

	* src/ranges.c (setup_range_from_value) : remove ugly release argument.
	(setup_range_from_range_ref) : ditto.
	(value_to_global_range) : take a GlobalRange as an arg.  No need to
	  allocate the result.

	* src/item-bar.c (item_bar_realize) : create a GC for filtered regions
	(item_bar_unrealize) : free it.

	* src/io-context.c (workbook_io_progress_set) : const the workbook.

	* src/gnumeric.h : Add GnmFilter.
	  Remove unused SPANCALC_NO_DRAW.

	* src/file.c (gnum_file_saver_save_real) : view is const not output.
	(gnum_file_saver_save) : ditto.

	* src/file-priv.h (save) : view is const not output.  delete save to
	  stream.

	* src/consolidate.c (consolidate_set_destination) : adjust to less
	  silly interface to setup_range_from_value.
	(consolidate_add_source) : ditto.

	* src/pixmaps/Makefile.am : add the pivottable icons
	* src/application.c (gnumeric_application_setup_icons) : ditto.

	* src/Makefile.am : add pivot table stub and auto filter
	  implementation

2002-11-28  Jody Goldberg <jody@gnome.org>

	* src/expr-name.c (sheet_names_get_available) : document.
	(cb_get_names) honour is_hidden.
	(expr_name_new) : init is_hidden.
parent 6526d50a
2002-11-29 Jody Goldberg <jody@gnome.org>
* ms-excel-write.c (excel_write_WINDOW1) : make view const
(excel_write_state_new) : ditto.
* ms-excel-read.c (excel_prepare_autofilter) : new.
(excel_read_NAME) : handle autofilters.
* ms-escher.c (ms_escher_read_ClientTextbox) : store the text.
* plugins/excel/boot.c (excel_save) : make the view const not the
output.
(excel_dsf_file_save) : ditto.
(excel_biff8_file_save) : ditto.
(excel_biff7_file_save) : ditto.
2002-11-26 Jody Goldberg <jody@gnome.org>
* ms-excel-read.c (ms_sheet_create_obj) : use the new label setting
utilities.
2002-11-28 Jon K Hellan <hellan@acm.org>
* boot.c (excel_save, excel_dsf_file_save, excel_biff8_file_save)
......
......@@ -62,8 +62,8 @@ MsExcelReadGbFn ms_excel_read_gb = NULL;
gboolean excel_file_probe (GnumFileOpener const *fo, GsfInput *input, FileProbeLevel pl);
void excel_file_open (GnumFileOpener const *fo, IOContext *context, WorkbookView *wbv, GsfInput *input);
void excel_biff7_file_save (GnumFileSaver const *fs, IOContext *context, WorkbookView *wbv, GsfOutput const *output);
void excel_biff8_file_save (GnumFileSaver const *fs, IOContext *context, WorkbookView *wbv, GsfOutput const *output);
void excel_biff7_file_save (GnumFileSaver const *fs, IOContext *context, WorkbookView const *wbv, GsfOutput *output);
void excel_biff8_file_save (GnumFileSaver const *fs, IOContext *context, WorkbookView const *wbv, GsfOutput *output);
void plugin_cleanup (void);
gboolean
......@@ -196,14 +196,13 @@ excel_file_open (GnumFileOpener const *fo, IOContext *context,
}
static void
excel_save (IOContext *context, WorkbookView *wbv, GsfOutput const *output,
excel_save (IOContext *context, WorkbookView const *wbv, GsfOutput *output,
gboolean biff7, gboolean biff8)
{
Workbook *wb;
GsfOutput *content;
GsfOutfile *outfile;
ExcelWriteState *ewb = NULL;
GError *err;
GsfStructuredBlob *macros;
io_progress_message (context, _("Preparing to save..."));
......@@ -248,20 +247,20 @@ excel_save (IOContext *context, WorkbookView *wbv, GsfOutput const *output,
void
excel_dsf_file_save (GnumFileSaver const *fs, IOContext *context,
WorkbookView *wbv, GsfOutput const *output)
WorkbookView const *wbv, GsfOutput *output)
{
excel_save (context, wbv, output, TRUE, TRUE);
}
void
excel_biff8_file_save (GnumFileSaver const *fs, IOContext *context,
WorkbookView *wbv, GsfOutput const *output)
WorkbookView const *wbv, GsfOutput *output)
{
excel_save (context, wbv, output, FALSE, TRUE);
}
void
excel_biff7_file_save (GnumFileSaver const *fs, IOContext *context,
WorkbookView *wbv, GsfOutput const *output)
WorkbookView const *wbv, GsfOutput *output)
{
excel_save (context, wbv, output, TRUE, FALSE);
}
......
......@@ -17,7 +17,7 @@ void excel_read_workbook (IOContext *context, WorkbookView *new_wb,
typedef struct _ExcelWriteState ExcelWriteState;
void excel_write_state_free (ExcelWriteState *ewb);
ExcelWriteState *excel_write_state_new (IOContext *context, WorkbookView *wbv,
ExcelWriteState *excel_write_state_new (IOContext *context, WorkbookView const *wbv,
gboolean biff7, gboolean biff8);
void excel_write_v7 (ExcelWriteState *ewb, GsfOutfile *output);
......
......@@ -1774,11 +1774,10 @@ ms_escher_read_ClientTextbox (MSEscherState *state, MSEscherHeader *h)
has_next_record = ms_biff_query_next (state->q);
g_return_val_if_fail (has_next_record, TRUE);
/* FIXME. Get an object management framework into place
* so that there is somewhere to put the comment text.
*/
text = ms_read_TXO (state->q);
g_free (text);
ms_escher_header_add_attr (h,
ms_obj_attr_new_ptr (MS_OBJ_ATTR_TEXT, text));
d (0 , printf ("'%s';\n", text););
return FALSE;
}
......
......@@ -28,6 +28,7 @@
#include <sheet-view.h>
#include <sheet-style.h>
#include <sheet-merge.h>
#include <sheet-filter.h>
#include <cell.h>
#include <style.h>
#include <format.h>
......@@ -323,6 +324,7 @@ static gboolean
ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
{
float offsets[4];
char const *label;
Range range;
ExcelSheet *esheet;
MSObjAttr *anchor;
......@@ -377,6 +379,21 @@ ms_sheet_realize_obj (MSContainer *container, MSObj *obj)
ms_obj_attr_get_int (obj, MS_OBJ_ATTR_SCROLLBAR_INC, 1),
ms_obj_attr_get_int (obj, MS_OBJ_ATTR_SCROLLBAR_PAGE, 10));
}
label = ms_obj_attr_get_ptr (obj, MS_OBJ_ATTR_TEXT, NULL);
if (label != NULL) {
SheetObject *so = SHEET_OBJECT (obj->gnum_obj);
switch (obj->excel_type) {
case 0x07: sheet_widget_button_set_label (so, label);
break;
case 0x0B: sheet_widget_checkbox_set_label (so, label);
break;
case 0x0C: sheet_widget_radio_button_set_label(so, label);
break;
default:
break;
};
}
}
return FALSE;
......@@ -432,8 +449,8 @@ ms_sheet_create_obj (MSContainer *container, MSObj *obj)
break;
}
/* TextBox */
case 0x06: {
case 0x0E: /* Label */
case 0x06: { /* TextBox */
StyleColor *fill_color = NULL;
StyleColor *outline_color;
......@@ -453,7 +470,7 @@ ms_sheet_create_obj (MSContainer *container, MSObj *obj)
/* Button */
case 0x07: so = g_object_new (sheet_widget_button_get_type (), NULL);
break;
break;
case 0x08: { /* Picture */
MSObjAttr *blip_id = ms_obj_attr_bag_lookup (obj->attrs,
MS_OBJ_ATTR_BLIP_ID);
......@@ -482,20 +499,20 @@ ms_sheet_create_obj (MSContainer *container, MSObj *obj)
break;
case 0x0B: so = g_object_new (sheet_widget_checkbox_get_type (), NULL);
break;
break;
case 0x0C: so = g_object_new (sheet_widget_radio_button_get_type (), NULL);
break;
case 0x0E: so = g_object_new (sheet_object_text_get_type (), NULL);
break;
break;
case 0x10: so = sheet_object_box_new (FALSE); break; /* Spinner */
case 0x11: so = g_object_new (sheet_widget_scrollbar_get_type (), NULL);
break;
break;
case 0x12: so = g_object_new (sheet_widget_list_get_type (), NULL);
break;
break;
/* ignore combos associateed with filters */
case 0x14: if (!obj->ignore_combo_in_filter)
so = g_object_new (sheet_widget_combo_get_type (), NULL);
break;
case 0x14:
if (!obj->ignore_combo_in_filter)
so = g_object_new (sheet_widget_combo_get_type (), NULL);
break;
case 0x19: /* Comment */
/* TODO: we'll need a special widget for this */
......@@ -2613,7 +2630,7 @@ excel_builtin_name (guint8 const *ptr)
case 0x0A: return "Auto_Activate";
case 0x0B: return "Auto_Deactivate";
case 0x0C: return "Sheet_Title";
case 0x0D: return "AutoFilter";
case 0x0D: return "_FilterDatabase";
default:
g_warning ("Unknown builtin named expression %d", (int)*ptr);
......@@ -2734,6 +2751,27 @@ excel_read_EXTERNNAME (BiffQuery *q, MSContainer *container)
}
}
/* Do some error checking to handle the magic name associated with an
* autofilter in a sheet */
static void
excel_prepare_autofilter (ExcelWorkbook *ewb, GnmNamedExpr *nexpr)
{
if (nexpr->pos.sheet != NULL) {
Value *v = gnm_expr_get_range (nexpr->expr_tree);
if (v != NULL) {
GlobalRange r;
gboolean valid = value_to_global_range (v, &r);
value_release (v);
if (valid) {
(void) gnm_filter_new (r.sheet, &r.range);
return;
}
}
}
gnm_io_warning (ewb->context, _("Failure parsing AutoFilter."));
}
static void
excel_read_NAME (BiffQuery *q, ExcelWorkbook *ewb)
{
......@@ -2809,10 +2847,16 @@ excel_read_NAME (BiffQuery *q, ExcelWorkbook *ewb)
/* Add a ref to keep it around after the excel-sheet/wb goes
* away. externames do not get references and are unrefed
* after import finishes, which destroys them if they are not
* in use.
*/
if (nexpr != NULL)
* in use. */
if (nexpr != NULL) {
expr_name_ref (nexpr);
nexpr->is_hidden = (flags & 0x0001) ? TRUE : FALSE;
/* Undocumented magic.
* XL stores a hidden name with the details of an autofilter */
if (nexpr->is_hidden && !strcmp (nexpr->name->str, "_FilterDatabase"))
excel_prepare_autofilter (ewb, nexpr);
}
}
/* nexpr is potentially NULL if there was an error,
......@@ -4188,6 +4232,8 @@ excel_read_AUTOFILTER (BiffQuery *q, ExcelSheet *esheet)
guint16 const flags = GSF_LE_GET_GUINT16 (q->data + 2);
read_DOPER (q->data + 4, 0, esheet);
read_DOPER (q->data + 14, 1, esheet);
printf ("%hu\n", active_filter);
}
static void
excel_read_SCL (BiffQuery *q, ExcelSheet *esheet)
......
......@@ -442,7 +442,7 @@ excel_write_externsheets_v8 (ExcelWriteState *ewb)
}
static void
excel_write_WINDOW1 (BiffPut *bp, WorkbookView *wb_view)
excel_write_WINDOW1 (BiffPut *bp, WorkbookView const *wb_view)
{
guint8 *data = ms_biff_put_len_next (bp, BIFF_WINDOW1, 18);
float hdpi = application_display_dpi_get (TRUE) / (72. * 20.);
......@@ -3562,7 +3562,7 @@ sst_collect_str (gpointer ignored, Cell const *cell, ExcelWriteState *ewb)
}
ExcelWriteState *
excel_write_state_new (IOContext *context, WorkbookView *gwb_view,
excel_write_state_new (IOContext *context, WorkbookView const *gwb_view,
gboolean biff7, gboolean biff8)
{
ExcelWriteState *ewb = g_new (ExcelWriteState, 1);
......
......@@ -48,8 +48,8 @@ struct _ExcelWriteState {
BiffPut *bp;
IOContext *io_context;
Workbook *gnum_wb;
WorkbookView *gnum_wb_view;
Workbook const *gnum_wb;
WorkbookView const *gnum_wb_view;
GPtrArray *sheets;
struct {
......
......@@ -520,6 +520,8 @@ ms_obj_read_pre_biff8_obj (BiffQuery *q, MSContainer *container, MSObj *obj)
case 0x13 : /* group box */
break;
case 0x14 : /* drop down */
obj->ignore_combo_in_filter =
(GSF_LE_GET_GUINT16 (q->data + 8) & 0x8000) ? TRUE : FALSE;
break;
default :
;
......
2002-11-29 Jody Goldberg <jody@gnome.org>
* roff.c (roff_file_save) : const the view and include gsf-output.h
* latex.c (latex_file_save) : const the view.
* html.c : include gsf-output.h and remove some vacuous comments.
(html_write_cell_content) : remove trailing argument from a puts.
(html_file_save) : const the view.
(html40_file_save) : ditto.
(html32_file_save) : ditto.
(html40frag_file_save) : ditto.
(xhtml_file_save) : ditto.
2002-11-28 Jon K Hellan <hellan@acm.org>
* html.[ch] (html40_file_save, html32_file_save)
......
......@@ -44,9 +44,9 @@
#include "style-border.h"
#include <rendered-value.h>
#include "mstyle.h"
#include <errno.h>
#include <string.h>
#include <gsf/gsf-output.h>
#include <string.h>
/*
* html_version_t:
......@@ -155,55 +155,43 @@ html_write_cell_content (GsfOutput *output, Cell *cell, MStyle *mstyle, html_ver
guint b = 0;
char *rendered_string;
gboolean hidden = mstyle_get_content_hidden (mstyle);
if (version ==HTML32 && hidden)
gsf_output_puts (output, "<!-- 'HIDDEN DATA' -->",output);
else
{
if (mstyle != NULL) {
if (mstyle_get_font_italic (mstyle))
gsf_output_puts (output, "<i>");
if (mstyle_get_font_bold (mstyle))
gsf_output_puts (output, "<b>");
if (font_is_monospaced (mstyle))
gsf_output_puts (output, "<tt>");
}
if (cell != NULL) {
if (mstyle != NULL && version != HTML40) {
html_get_text_color (cell, mstyle, &r, &g, &b);
if (r > 0 || g > 0 || b > 0)
gsf_output_printf (output, "<font color=\"#%02X%02X%02X\">", r, g, b);
gsf_output_puts (output, "<!-- 'HIDDEN DATA' -->");
else {
if (mstyle != NULL) {
if (mstyle_get_font_italic (mstyle))
gsf_output_puts (output, "<i>");
if (mstyle_get_font_bold (mstyle))
gsf_output_puts (output, "<b>");
if (font_is_monospaced (mstyle))
gsf_output_puts (output, "<tt>");
}
rendered_string = cell_get_rendered_text (cell);
html_print_encoded (output, rendered_string);
g_free (rendered_string);
}
if (r > 0 || g > 0 || b > 0)
gsf_output_puts (output, "</font>");
if (mstyle != NULL) {
if (font_is_monospaced (mstyle))
gsf_output_puts (output, "</tt>");
if (mstyle_get_font_bold (mstyle))
gsf_output_puts (output, "</b>");
if (mstyle_get_font_italic (mstyle))
gsf_output_puts (output, "</i>");
}}
}
if (cell != NULL) {
if (mstyle != NULL && version != HTML40) {
html_get_text_color (cell, mstyle, &r, &g, &b);
if (r > 0 || g > 0 || b > 0)
gsf_output_printf (output, "<font color=\"#%02X%02X%02X\">", r, g, b);
}
rendered_string = cell_get_rendered_text (cell);
html_print_encoded (output, rendered_string);
g_free (rendered_string);
}
/*
* html_get_border_style :
*
*
*
*/
if (r > 0 || g > 0 || b > 0)
gsf_output_puts (output, "</font>");
if (mstyle != NULL) {
if (font_is_monospaced (mstyle))
gsf_output_puts (output, "</tt>");
if (mstyle_get_font_bold (mstyle))
gsf_output_puts (output, "</b>");
if (mstyle_get_font_italic (mstyle))
gsf_output_puts (output, "</i>");
}
}
}
static char *
html_get_border_style (StyleBorder *border)
......@@ -268,16 +256,6 @@ html_get_border_style (StyleBorder *border)
return result;
}
/*
* html_write_border_style_40 :
*
* @output: the stream
* @border: a non-blank border
* @border_name:
*
*
*/
static void
html_write_one_border_style_40 (GsfOutput *output, StyleBorder *border, char const *border_name)
{
......@@ -288,14 +266,6 @@ html_write_one_border_style_40 (GsfOutput *output, StyleBorder *border, char con
gsf_output_printf (output, " %s:%s;", border_name, text);
g_free (text);
}
/*
* html_write_border_style_40 :
*
* @output: the stream
* @mstyle: style
*
*
*/
static void
html_write_border_style_40 (GsfOutput *output, MStyle *mstyle)
......@@ -316,27 +286,15 @@ html_write_border_style_40 (GsfOutput *output, MStyle *mstyle)
html_write_one_border_style_40 (output, border, "border-right");
}
/*
* write_cell:
*
* @output: the stream
* @sheet: the gnumeric sheet
* @row: the row number
* @col: the col number
*
* Output all cell info for the given cell
*
*/
static void
write_cell (GsfOutput *output, Sheet *sheet, gint row, gint col, html_version_t version)
{
Cell *cell;
MStyle *mstyle;
guint r, g, b;
mstyle = sheet_style_get (sheet, col, row);
if (mstyle != NULL && version != HTML32 && version != HTML40 &&
if (mstyle != NULL && version != HTML32 && version != HTML40 &&
mstyle_get_pattern (mstyle) != 0 &&
mstyle_is_element_set (mstyle, MSTYLE_COLOR_BACK)) {
html_get_color (mstyle, MSTYLE_COLOR_BACK, &r, &g, &b);
......@@ -395,10 +353,10 @@ write_cell (GsfOutput *output, Sheet *sheet, gint row, gint col, html_version_t
html_get_text_color (cell, mstyle, &r, &g, &b);
if (r > 0 || g > 0 || b > 0)
gsf_output_printf (output, " color:#%02X%02X%02X;", r, g, b);
if(mstyle_get_content_hidden(mstyle))
gsf_output_puts (output, " visibility:hidden;",output);
if (mstyle_get_content_hidden (mstyle))
gsf_output_puts (output, " visibility:hidden;");
}
html_write_border_style_40 (output, mstyle);
gsf_output_printf (output, "\"");
}
......@@ -419,9 +377,7 @@ write_cell (GsfOutput *output, Sheet *sheet, gint row, gint col, html_version_t
* Set up a TD node for each cell in the given row, witht eh appropriate
* colspan and rowspan.
* Call write_cell for each cell.
*
*/
static void
write_row (GsfOutput *output, Sheet *sheet, gint row, Range *range, html_version_t version)
{
......@@ -473,9 +429,7 @@ write_row (GsfOutput *output, Sheet *sheet, gint row, Range *range, html_version
* @sheet: the gnumeric sheet
*
* set up a table and call write_row for each row
*
*/
static void
write_sheet (GsfOutput *output, Sheet *sheet, html_version_t version)
{
......@@ -493,7 +447,7 @@ write_sheet (GsfOutput *output, Sheet *sheet, html_version_t version)
gsf_output_puts (output, "<p><table border=\"1\">\n");
break;
}
gsf_output_puts (output, "<caption>");
html_print_encoded (output, sheet->name_unquoted);
gsf_output_puts (output, "</caption>\n");
......@@ -501,7 +455,7 @@ write_sheet (GsfOutput *output, Sheet *sheet, html_version_t version)
total_range = sheet_get_extent (sheet, TRUE);
for (row = total_range.start.row; row <= total_range.end.row; row++) {
gsf_output_puts (output, "<tr>\n");
write_row (output, sheet, row, &total_range,
write_row (output, sheet, row, &total_range,
(version == XHTML) ? HTML40 : version);
gsf_output_puts (output, "</tr>\n");
}
......@@ -515,18 +469,17 @@ write_sheet (GsfOutput *output, Sheet *sheet, html_version_t version)
*/
static void
html_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, GsfOutput *output, html_version_t version)
WorkbookView const *wb_view, GsfOutput *output, html_version_t version)
{
GList *sheets, *ptr;
Workbook *wb = wb_view_workbook (wb_view);
ErrorInfo *open_error;
g_return_if_fail (wb != NULL);
g_return_if_fail (output != NULL);
switch (version) {
case HTML32:
gsf_output_puts (output,
gsf_output_puts (output,
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n"
"<html>\n"
"<head>\n\t<title>Tables</title>\n"
......@@ -548,7 +501,7 @@ html_file_save (GnumFileSaver const *fs, IOContext *io_context,
"</head>\n<body>\n");
break;
case HTML40:
gsf_output_puts (output,
gsf_output_puts (output,
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\"\n"
"\t\t\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html>\n"
......@@ -571,7 +524,7 @@ html_file_save (GnumFileSaver const *fs, IOContext *io_context,
"</head>\n<body>\n");
break;
case XHTML :
gsf_output_puts (output,
gsf_output_puts (output,
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n"
"\t\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
......@@ -603,51 +556,34 @@ html_file_save (GnumFileSaver const *fs, IOContext *io_context,
write_sheet (output, (Sheet *) ptr->data, version);
}
g_list_free (sheets);
if (version == HTML32 || version == HTML40 || version == XHTML)
if (version == HTML32 || version == HTML40 || version == XHTML)
gsf_output_puts (output, "</body>\n</html>\n");
}
/*
* write every sheet of the workbook to an html 4.0 table
*
*/
void
html40_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, GsfOutput *output)
WorkbookView const *wb_view, GsfOutput *output)
{
html_file_save (fs, io_context, wb_view, output, HTML40);
}
/*
* write every sheet of the workbook to an html 3.2 table
*
*/
void
html32_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, GsfOutput *output)
WorkbookView const *wb_view, GsfOutput *output)
{
html_file_save (fs, io_context, wb_view, output, HTML32);
}
/*
* write every sheet of the workbook to an html 4.0 fragment table
*
*/
void
html40frag_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, GsfOutput *output)
WorkbookView const *wb_view, GsfOutput *output)
{
html_file_save (fs, io_context, wb_view, output, HTML40F);
}
/*
* write every sheet of the workbook to an xhtml 1.0 table
*
*/
void
xhtml_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, GsfOutput *output)
WorkbookView const *wb_view, GsfOutput *output)
{
html_file_save (fs, io_context, wb_view, output, XHTML);
}
......
......@@ -26,17 +26,17 @@
#include "file.h"
#include "error-info.h"
void html32_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, GsfOutput *output);
void html40_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, GsfOutput *output);
void html32_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView const *wb_view, GsfOutput *output);
void html40_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView const *wb_view, GsfOutput *output);
void html40frag_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, GsfOutput *output);
void xhtml_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, GsfOutput *output);
WorkbookView const *wb_view, GsfOutput *output);
void xhtml_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView const *wb_view, GsfOutput *output);
void html_file_open (GnumFileOpener const *fo, IOContext *io_context,
WorkbookView *wb_view, GsfInput *input);
WorkbookView *wb_view, GsfInput *input);
#define G_PLUGIN_FOR_HTML "GPFH/0.5"
......
......@@ -57,9 +57,8 @@
#include <cellspan.h>
#include <rendered-value.h>
#include <errno.h>
#include <stdio.h>
#include <locale.h>
#include <gsf/gsf-output.h>
typedef enum {
LATEX_NO_BORDER = 0,
......@@ -869,7 +868,7 @@ latex2e_print_hhline (GsfOutput *output, StyleBorderType *clines, int n, StyleBo
*/
void
latex_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView *wb_view, GsfOutput *output)
WorkbookView const *wb_view, GsfOutput *output)
{
Cell *cell;
Sheet *current_sheet;
......@@ -877,17 +876,10 @@ latex_file_save (GnumFileSaver const *fs, IOContext *io_context,
Range const *merge_range;
int row, col, num_cols, length;
int num_merged_cols, num_merged_rows;
Workbook *wb = wb_view_workbook (wb_view);
ErrorInfo *open_error;
StyleBorderType *clines, *this_clines;
StyleBorderType *prev_vert = NULL, *next_vert = NULL, *this_vert;
gboolean needs_hline;
/* Sanity check */
g_return_if_fail (wb != NULL);
g_return_if_fail (output != NULL);
/* This is the preamble of the LaTeX2e file. */
latex2e_write_file_header(output);
......
......@@ -25,6 +25,7 @@
#include <gnumeric.h>
#include <file.h>
void latex_file_save (GnumFileSaver const *fs, IOContext *io_context, WorkbookView *wb_view, GsfOutput *output);
void latex_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView const *wb_view, GsfOutput *output);
#endif
......@@ -34,8 +34,8 @@
#include "plugin-util.h"
#include "cellspan.h"
#include <errno.h>
#include <string.h>
#include <gsf/gsf-output.h>
/*
* escape special characters .. needs work
......@@ -84,8 +84,9 @@ roff_fprintf (GsfOutput *output, const Cell *cell)
*
* FIXME: Should roff quote sheet name (and everything else)
*/
static void
write_wb_roff (IOContext *io_context, WorkbookView *wb_view, GsfOutput *output)
void
roff_file_save (GnumFileSaver const *fs, IOContext *io_context,
WorkbookView const *wb_view, GsfOutput *output)
{
GList *sheets, *ptr;
Cell *cell;
......@@ -191,18 +192,3 @@ write_wb_roff (IOContext *io_context, WorkbookView *wb_view, GsfOutput *output)
}
g_list_free (sheets);