Commit b5a85def authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Set LC_MONETARY and LC_NUMERIC. Ditto. (xml_workbook_read) : Ditto.


2000-10-31  Jody Goldberg <jgoldberg@home.com>

	* src/workbook-view.c (wb_view_auto_expr) : Set LC_MONETARY and
	  LC_NUMERIC.
	* src/xml-io.c (xml_workbook_write) : Ditto.
	(xml_workbook_read) : Ditto.

2000-10-31  Jody Goldberg <jgoldberg@home.com>

	* src/dialogs/*.[ch] : WorkbookControlGUI is now required for gui
	  operations.  A WorkbookView is required to know which sheet is the
	  current.

	* src/xml-io.c : We now load/save WorkbookViews.

	* src/xml-io-autoft.c : Adjust to signature changes.

	* src/workbook.c : Split the View into WorkbookView.
	  Abstract the Controler interface, and move the GUI specific
	  implementation of the Controler into WorkbookControlGUI.

	* src/workbook-view.c : Complete rewrite with correct semantics.

	* src/workbook-private.h : Move all the GUI specific stuff into
	  WorkbookControlGUI were it belongs.

	* src/workbook-private.c (workbook_private_class_init) : Fix typo.

	* src/workbook-edit.c : These are now WorkbookControlGUI specific.
	  We should rename the functions eventually.
	* src/workbook-format-toolbar.c : Ditto.
	* src/workbook-object-toolbar.c : Ditto.

	* src/workbook-cmd-format.c : Adjust to signature changes.
	  and use WorkbookControlGUI were necessary.

	* src/style.c (style_font_new_from) : Delete dead code.

	* src/solver-lp.c : Adjust to signature changes.
	* src/sort.c : Ditto.
	* src/stf.c : Ditto. Make dialog conditional on gui-ness.

	* src/sheet.c (sheet_new_sheet_view) : IS_SHEET checks for NULL.
	(sheet_detach_sheet_view) : renamed from sheet_destroy_sheet_view
	  and only take a SheetView as argument.
	(sheet_new) : Do not create a view by default.
	(sheet_update_zoom_controls) : foreach control.
	(sheet_update_editpos) : ditto.
	(sheet_update) : handle multiple views and controls.
parent ffac72f5
......@@ -247,11 +247,6 @@ module GNOME {
void parse (in string cellref,
out Gnumeric::Sheet sheet,
out long col, out long row);
//
// Window control
//
void show (in boolean show_toplevel);
};
//
......
/**
* The interfaces that Gnumeric uses to communicate with graphing components
* The interfaces Gnumeric uses to communicate with graphing components
*
* Author:
* Jody Goldberg <jgoldberg@home.com>
*/
#include <Bonobo.idl>
module GNOME {
module Gnumeric {
interface VectorNotify {
oneway void remove ();
oneway void nameChanged (in string name);
oneway void name_changed (in string name);
};
typedef sequence<double> SeqScalar;
interface VectorScalarNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqScalar new_values);
oneway void value_changed (in short start, in SeqScalar new_values);
};
interface VectorScalar : VectorScalarNotify {
void value (out SeqScalar values, out string name);
......@@ -24,7 +23,7 @@ module GNOME {
typedef sequence<long> SeqDate;
interface VectorDateNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqDate new_values);
oneway void value_changed (in short start, in SeqDate new_values);
};
interface VectorDate : VectorDateNotify {
void value (out SeqDate values, out string name);
......@@ -32,7 +31,7 @@ module GNOME {
typedef sequence<string> SeqString;
interface VectorStringNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqString new_values);
oneway void value_changed (in short start, in SeqString new_values);
};
interface VectorString : VectorStringNotify {
void value (out SeqString values, out string name);
......@@ -40,12 +39,12 @@ module GNOME {
module Graph {
interface Manager : Bonobo::Unknown {
Bonobo::Control getTypeSelectControl ();
Bonobo::Control getLayoutControl ();
Bonobo::Control get_type_select_control ();
Bonobo::Control get_layout_control ();
VectorScalarNotify addVectorScalar (in VectorScalar vec);
VectorDateNotify addVectorDate (in VectorDate vec);
VectorStringNotify addVectorString (in VectorString vec);
VectorScalarNotify add_vector_scalar (in VectorScalar vec);
VectorDateNotify add_vector_date (in VectorDate vec);
VectorStringNotify add_vector_string (in VectorString vec);
oneway void freeze ();
oneway void thaw ();
......
......@@ -247,11 +247,6 @@ module GNOME {
void parse (in string cellref,
out Gnumeric::Sheet sheet,
out long col, out long row);
//
// Window control
//
void show (in boolean show_toplevel);
};
//
......
/**
* The interfaces that Gnumeric uses to communicate with graphing components
* The interfaces Gnumeric uses to communicate with graphing components
*
* Author:
* Jody Goldberg <jgoldberg@home.com>
*/
#include <Bonobo.idl>
module GNOME {
module Gnumeric {
interface VectorNotify {
oneway void remove ();
oneway void nameChanged (in string name);
oneway void name_changed (in string name);
};
typedef sequence<double> SeqScalar;
interface VectorScalarNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqScalar new_values);
oneway void value_changed (in short start, in SeqScalar new_values);
};
interface VectorScalar : VectorScalarNotify {
void value (out SeqScalar values, out string name);
......@@ -24,7 +23,7 @@ module GNOME {
typedef sequence<long> SeqDate;
interface VectorDateNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqDate new_values);
oneway void value_changed (in short start, in SeqDate new_values);
};
interface VectorDate : VectorDateNotify {
void value (out SeqDate values, out string name);
......@@ -32,7 +31,7 @@ module GNOME {
typedef sequence<string> SeqString;
interface VectorStringNotify : VectorNotify {
oneway void valueChanged (in short start, in SeqString new_values);
oneway void value_changed (in short start, in SeqString new_values);
};
interface VectorString : VectorStringNotify {
void value (out SeqString values, out string name);
......@@ -40,12 +39,12 @@ module GNOME {
module Graph {
interface Manager : Bonobo::Unknown {
Bonobo::Control getTypeSelectControl ();
Bonobo::Control getLayoutControl ();
Bonobo::Control get_type_select_control ();
Bonobo::Control get_layout_control ();
VectorScalarNotify addVectorScalar (in VectorScalar vec);
VectorDateNotify addVectorDate (in VectorDate vec);
VectorStringNotify addVectorString (in VectorString vec);
VectorScalarNotify add_vector_scalar (in VectorScalar vec);
VectorDateNotify add_vector_date (in VectorDate vec);
VectorStringNotify add_vector_string (in VectorString vec);
oneway void freeze ();
oneway void thaw ();
......
2000-10-29 Jody Goldberg <jgoldberg@home.com>
* dif.c : Adjust to the signature changes for reading views
rather than workbooks.
2000-10-10 Jody Goldberg <jgoldberg@home.com>
* Release 0.57
......
......@@ -20,14 +20,15 @@
#include "gnumeric.h"
#include "cell.h"
#include "value.h"
#include "workbook.h"
#include "file.h"
#include "command-context.h"
#include "rendered-value.h"
#include "io-context.h"
#include "workbook-view.h"
#include "workbook.h"
static int
dif_write_workbook (CommandContext *context,
Workbook *wb, const char *filename);
dif_write_workbook (IOContext *context,
WorkbookView *wb_view, const char *filename);
typedef struct {
char const *data, *cur;
......@@ -243,8 +244,8 @@ g_warning("DIF SUCCESS");
#endif
static int
dif_read_workbook (CommandContext *context,
Workbook *book, char const *filename)
dif_read_workbook (IOContext *context, WorkbookView *wb_view,
char const *filename)
{
int result = 0;
int len;
......@@ -253,50 +254,44 @@ dif_read_workbook (CommandContext *context,
int const fd = open(filename, O_RDONLY);
if (fd < 0) {
gnumeric_error_read (context, g_strerror (errno));
gnumeric_io_error_system (context, g_strerror (errno));
return -1;
}
if (fstat(fd, &sbuf) < 0) {
close (fd);
gnumeric_error_read (context, g_strerror (errno));
gnumeric_io_error_system (context, g_strerror (errno));
return -1;
}
len = sbuf.st_size;
if ((caddr_t)MAP_FAILED != (data = (caddr_t) (mmap(0, len, PROT_READ,
MAP_PRIVATE, fd, 0)))) {
Workbook *wb = wb_view_workbook (wb_view);
FileSource_t src;
char * name = g_strdup_printf (_("Imported %s"), g_basename (filename));
src.data = data;
src.cur = data;
src.len = len;
src.sheet = sheet_new (book, name);
workbook_attach_sheet (book, src.sheet);
g_free (name);
src.sheet = workbook_sheet_add (wb, NULL, FALSE);
if (!dif_parse_sheet (&src)) {
workbook_detach_sheet (book, src.sheet, TRUE);
gnumeric_error_read
(context , _("DIF : Failed to load sheet"));
gnumeric_io_error_read (context,
_("DIF : Failed to load sheet"));
result = -1;
} else
workbook_set_saveinfo (book, filename, FILE_FL_MANUAL,
workbook_set_saveinfo (wb, filename, FILE_FL_MANUAL,
dif_write_workbook);
munmap((char *)data, len);
} else {
result = -1;
gnumeric_error_read (context, _("Unable to mmap the file"));
gnumeric_io_error_read (context, _("Unable to mmap the file"));
}
close(fd);
return result;
}
static int
dif_write_cell (FILE *f, Cell const *cell)
{
......@@ -325,18 +320,19 @@ dif_write_cell (FILE *f, Cell const *cell)
* write every sheet of the workbook to a DIF format file
*/
static int
dif_write_workbook (CommandContext *context,
Workbook *wb, const char *filename)
dif_write_workbook (IOContext *context,
WorkbookView *wb_view, const char *filename)
{
Workbook *wb = wb_view_workbook (wb_view);
GList *sheet_list;
Sheet *sheet;
Cell *cell;
int row, col, rc=0;
FILE *f = fopen (filename, "w");
char *workstring;
FILE *f = fopen (filename, "w");
if (!f) {
gnumeric_error_save (context, g_strerror (errno));
gnumeric_io_error_system (context, g_strerror (errno));
return -1;
}
......@@ -387,7 +383,7 @@ out:
if (f)
fclose (f);
if (rc < 0)
gnumeric_error_save (context, "");
gnumeric_io_error_save (context, "");
return rc; /* Q: what do we have to return here?? */
}
......
2000-10-29 Jody Goldberg <jgoldberg@home.com>
* ms-excel-read.c : Adjust to the signature changes for reading views
rather than workbooks.
* ms-excel-write.c : ditto.
* boot.c : ditto.
2000-10-28 Jody Goldberg <jgoldberg@home.com>
* ms-excel-util.c (init_xl_font_widths) : Add CG Times.
2000-10-30 Morten Welinder <terra@diku.dk>
* ms-biff.c (biff_getdouble, biff_setdouble): Delete. Replace all
......
......@@ -15,8 +15,9 @@
#include "gnumeric-util.h"
#include "file.h"
#include "main.h"
#include "io-context.h"
#include "workbook-view.h"
#include "workbook.h"
#include "command-context.h"
#include "excel.h"
#include "ms-summary.h"
......@@ -26,7 +27,8 @@ extern int ms_excel_read_debug;
MsExcelReadGbFn ms_excel_read_gb = NULL;
static int
excel_save_95 (CommandContext *context, Workbook *wb, const char *filename);
excel_save_95 (IOContext *context, WorkbookView *wb_view,
const char *filename);
static gboolean
excel_probe (const char *filename)
......@@ -55,15 +57,16 @@ excel_probe (const char *filename)
/*
* excel_load
* @context command context
* @wb workbook
* @filename file name
* @context: Command context
* @wb: Workbook
* @filename: File name
*
* Load en excel workbook.
* Returns 0 on success, -1 on failure.
*/
static int
excel_load (CommandContext *context, Workbook *wb, const char *filename)
excel_load (IOContext *context, WorkbookView *new_wb_view,
const char *filename)
{
MsOleErr ole_error;
MsOle *f;
......@@ -74,12 +77,13 @@ excel_load (CommandContext *context, Workbook *wb, const char *filename)
ms_ole_destroy (&f);
/* FIXME : We need a more detailed message from
* ole_open */
gnumeric_error_read (context, "");
gnumeric_io_error_read (context, "");
return -1;
}
result = ms_excel_read_workbook (context, wb, f);
result = ms_excel_read_workbook (context, new_wb_view, f);
if (result == 0) {
Workbook *wb = wb_view_workbook (new_wb_view);
ms_summary_read (f, wb->summary_info);
if (ms_excel_read_debug > 0)
......@@ -107,9 +111,10 @@ excel_load (CommandContext *context, Workbook *wb, const char *filename)
* ExcelWorkbook in ms-excel-read.h.
*/
static int
excel_save (CommandContext *context, Workbook *wb, const char *filename,
excel_save (IOContext *context, WorkbookView *wb_view, const char *filename,
MsBiffVersion ver)
{
Workbook *wb = wb_view_workbook (wb_view);
MsOle *f;
int ans;
struct stat s;
......@@ -117,13 +122,12 @@ excel_save (CommandContext *context, Workbook *wb, const char *filename,
void *state = NULL;
if ((stat (filename, &s) != -1)) {
gnumeric_error_save
(context,
gnumeric_io_error_save (context,
_("Saving over old files disabled for safety"));
return -1;
}
if (ms_excel_check_write (context, &state, wb, ver) != 0)
if (ms_excel_check_write (context, &state, wb_view, ver) != 0)
return -1;
result = ms_ole_create (&f, filename);
......@@ -132,7 +136,7 @@ excel_save (CommandContext *context, Workbook *wb, const char *filename,
char *str = g_strdup_printf ("%s %s",
_("Can't open"),
filename);
gnumeric_error_save (context, str);
gnumeric_io_error_save (context, str);
ms_ole_destroy (&f);
ms_excel_write_free_state (state);
......@@ -155,15 +159,17 @@ excel_save (CommandContext *context, Workbook *wb, const char *filename,
}
static int
excel_save_98 (CommandContext *context, Workbook *wb, const char *filename)
excel_save_98 (IOContext *context, WorkbookView *wb_view,
const char *filename)
{
return excel_save (context, wb, filename, MS_BIFF_V8);
return excel_save (context, wb_view, filename, MS_BIFF_V8);
}
static int
excel_save_95 (CommandContext *context, Workbook *wb, const char *filename)
excel_save_95 (IOContext *context, WorkbookView *wb_view,
const char *filename)
{
return excel_save (context, wb, filename, MS_BIFF_V7);
return excel_save (context, wb_view, filename, MS_BIFF_V7);
}
void
......
......@@ -11,11 +11,9 @@
#include <libole2/ms-ole.h>
#include "command-context.h"
#include "workbook.h"
#include "sheet.h"
#include "gnumeric.h"
typedef gboolean (*MsExcelReadGbFn) (CommandContext *context, Workbook *wb, MsOle *f);
typedef gboolean (*MsExcelReadGbFn) (IOContext *context, Workbook *wb, MsOle *f);
extern MsExcelReadGbFn ms_excel_read_gb;
typedef enum { MS_BIFF_V2 = 2,
......@@ -26,8 +24,8 @@ typedef enum { MS_BIFF_V2 = 2,
MS_BIFF_V8 = 8, /* Excel 97 */
MS_BIFF_V_UNKNOWN = 0} MsBiffVersion ;
extern int ms_excel_read_workbook (CommandContext *context,
Workbook *wb, MsOle *file);
extern int ms_excel_read_workbook (IOContext *context,
WorkbookView *new_wb, MsOle *file);
/*
* Here's why the state which is carried from excel_check_write to
* ms_excel_write_workbook is void *: The state is actually an
......@@ -35,9 +33,9 @@ extern int ms_excel_read_workbook (CommandContext *context,
* import that definition here: There's a different definition of
* ExcelWorkbook in ms-excel-read.h.
*/
extern int ms_excel_check_write (CommandContext *context, void **state,
Workbook *wb, MsBiffVersion ver);
extern int ms_excel_write_workbook (CommandContext *context, MsOle *file,
extern int ms_excel_check_write (IOContext *context, void **state,
WorkbookView *wb, MsBiffVersion ver);
extern int ms_excel_write_workbook (IOContext *context, MsOle *file,
void *state, MsBiffVersion ver);
void ms_excel_write_free_state (void *state);
......@@ -64,4 +62,5 @@ extern FormulaFuncData formula_func_data[];
#define ROW_BLOCK_MAX_LEN 32
#define WRITEACCESS_LEN 112
#endif
#endif /* GNUMERIC_EXCEL_H */
......@@ -9,7 +9,6 @@
**/
#include <config.h>
#include "command-context.h"
#include "ms-formula-read.h"
#include "ms-excel-read.h"
......@@ -28,10 +27,11 @@
#include "gutils.h"
#include "cell-comment.h"
#include "application.h"
#include "io-context.h"
#include "workbook-view.h"
#include "workbook.h"
#include "ms-excel-util.h"
#include "ms-excel-xf.h"
#include "workbook-view.h"
#include "sheet-object-widget.h"
#include "sheet-object-graphic.h"
......@@ -599,7 +599,6 @@ biff_boundsheet_data_new (ExcelWorkbook *wb, BiffQuery *q, MsBiffVersion ver)
if (ans->name == NULL) {
ans->name = g_strdup_printf (_("Sheet%d"),
g_hash_table_size (wb->boundsheet_data_by_index));
}
/*
......@@ -2585,7 +2584,7 @@ ms_excel_workbook_attach (ExcelWorkbook *wb, ExcelSheet *ans)
g_return_if_fail (wb);
g_return_if_fail (ans);
workbook_attach_sheet (wb->gnum_wb, ans->gnum_sheet);
workbook_sheet_attach (wb->gnum_wb, ans->gnum_sheet, NULL);
g_ptr_array_add (wb->excel_sheets, ans);
}
......@@ -2595,7 +2594,7 @@ ms_excel_workbook_detach (ExcelWorkbook *wb, ExcelSheet *ans)
int idx = 0;
if (ans->gnum_sheet) {
if (!workbook_detach_sheet (wb->gnum_wb, ans->gnum_sheet, FALSE))
if (!workbook_sheet_detach (wb->gnum_wb, ans->gnum_sheet, FALSE))
return FALSE;
/* Detaching the sheet deletes it */
ans->gnum_sheet = NULL;
......@@ -3346,7 +3345,6 @@ ms_excel_read_selection (ExcelSheet *sheet, BiffQuery *q)
int num_refs = MS_OLE_GET_GUINT16 (q->data + 7);
guint8 *refs;
#ifndef NO_DEBUG_EXCEL
if (ms_excel_read_debug > 1) {
printf ("Start selection\n");
......@@ -3546,7 +3544,8 @@ ms_excel_biff_dimensions (BiffQuery *q, ExcelWorkbook *wb)
}
static gboolean
ms_excel_read_sheet (BiffQuery *q, ExcelWorkbook *wb, ExcelSheet *sheet)
ms_excel_read_sheet (BiffQuery *q, ExcelWorkbook *wb, WorkbookView *wb_view,
ExcelSheet *sheet)
{
PrintInformation *pi;
......@@ -3840,7 +3839,8 @@ ms_excel_read_sheet (BiffQuery *q, ExcelWorkbook *wb, ExcelSheet *sheet)
}
#endif
if (options & 0x0400)
workbook_focus_sheet (sheet->gnum_sheet);
wb_view_sheet_focus (wb_view,
sheet->gnum_sheet);
}
#ifndef NO_DEBUG_EXCEL
if (q->length >= 14) {
......@@ -3934,7 +3934,7 @@ ms_excel_read_supporting_wb (MsBiffBofData *ver, BiffQuery *q)
}
int
ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
ms_excel_read_workbook (IOContext *context, WorkbookView *wb_view,
MsOle *file)
{
ExcelWorkbook *wb = NULL;
......@@ -3947,7 +3947,7 @@ ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
/* Find that book file */
/* Look for workbook before book so that we load the office97
* format rather than office5 when there are multiple streams. */
* format rather than office5 when there are multiple streams. */
result = ms_ole_stream_open (&stream, file, "/", "workbook", 'r');
if (result != MS_OLE_ERR_OK) {
ms_ole_stream_close (&stream);
......@@ -3955,8 +3955,7 @@ ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
result = ms_ole_stream_open (&stream, file, "/", "book", 'r');
if (result != MS_OLE_ERR_OK) {
ms_ole_stream_close (&stream);
gnumeric_error_read
(context,
gnumeric_io_error_read (context,
_("No book or workbook streams found."));
return -1;
}
......@@ -4029,7 +4028,7 @@ ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
if (ver->type == MS_BIFF_TYPE_Workbook) {
wb = ms_excel_workbook_new (ver->version);
wb->gnum_wb = workbook;
wb->gnum_wb = wb_view_workbook (wb_view);
if (ver->version >= MS_BIFF_V8) {
guint32 ver = MS_OLE_GET_GUINT32 (q->data + 4);
if (ver == 0x4107cd18)
......@@ -4058,7 +4057,7 @@ ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
gboolean kill = FALSE;
ms_excel_sheet_set_version (sheet, ver->version);
if (ms_excel_read_sheet (q, wb, sheet)) {
if (ms_excel_read_sheet (q, wb, wb_view, sheet)) {
ms_container_realize_objs (&sheet->container);
#if 0
......@@ -4334,20 +4333,17 @@ ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
* NOTE : This is the size of the MDI sub-window, not the size of
* the containing excel window.
*/
workbook_view_set_size (wb->gnum_wb,
.5 + width *
application_display_dpi_get (TRUE) / (72. * 20.),
.5 + height *
application_display_dpi_get (FALSE) / (72. * 20.));
wb_view_preferred_size (wb_view,
.5 + width * application_display_dpi_get (TRUE) / (72. * 20.),
.5 + height * application_display_dpi_get (FALSE) / (72. * 20.));
if (options & 0x0001)
printf ("Unsupported : Hidden workbook\n");
if (options & 0x0002)
printf ("Unsupported : Iconic workbook\n");
wb->gnum_wb->show_horizontal_scrollbar = (options & 0x0008);
wb->gnum_wb->show_vertical_scrollbar = (options & 0x0010);
wb->gnum_wb->show_notebook_tabs = (options & 0x0020);
workbook_view_pref_visibility (wb->gnum_wb);
wb_view->show_horizontal_scrollbar = (options & 0x0008);
wb_view->show_vertical_scrollbar = (options & 0x0010);
wb_view->show_notebook_tabs = (options & 0x0020);
}
break;
......@@ -4414,12 +4410,12 @@ ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
/* If we were forced to stop then the load failed */
if (problem_loading != NULL) {
gnumeric_error_read (context, problem_loading);
gnumeric_io_error_read (context, problem_loading);
return -1;
}
return 0;
}
gnumeric_error_read (context, _("Unable to locate valid MS Excel workbook"));
gnumeric_io_error_read (context, _("Unable to locate valid MS Excel workbook"));
return -1;
}
......@@ -185,8 +185,8 @@ init_xl_font_widths ()
*
* The 'default' width is based on the hypothesis that the default
* column width is always 8*default. Edit the 'Normal' Style
* and change the font to 128pt then look the pixel width displayed
* when resizing the column.
* and change the font to 128pt then look at the pixel width
* displayed when resizing the column.
*
* The standard width is also based on setting the Normal styles font.
* However, it is calculated by changing the column width until it is
......@@ -202,6 +202,7 @@ init_xl_font_widths ()
{ 106, 113, "Bookman Old Style" },
{ 95, 102, "Century Gothic" },
{ 95, 102, "Century Schoolbook" },
{ 86, 92, "CG Times" },
{ 104, 111, "Comic Sans MS" },
{ 60, 64, "Courier" },
{ 103, 110, "Courier New" },
......
......@@ -41,8 +41,9 @@
#include "main.h"
#include "parse-util.h"
#include "print-info.h"
#include "command-context.h"
#include "workbook-view.h"
#include "workbook.h"
#include "io-context.h"
#include "expr.h"
#include "gutils.h"
......@@ -2917,14 +2918,14 @@ write_sheet_bools (BiffPut *bp, ExcelSheet *sheet)
}
static void
write_sheet_tail (BiffPut *bp, ExcelSheet *sheet)
write_sheet_tail (IOContext *context, BiffPut *bp, ExcelSheet *sheet)
{
guint8 *data;
MsBiffVersion ver = sheet->wb->ver;
guint16 options = 0x2b6; /* Arabic ? */
if (sheet->gnum_sheet == sheet->wb->gnum_wb->current_sheet)
options |= 0x400;
if (sheet->gnum_sheet == wb_view_cur_sheet (sheet->wb->gnum_wb_view))
options |= 0x400;
write_window1 (bp, ver);
......@@ -3189,7 +3190,7 @@ write_block (BiffPut *bp, ExcelSheet *sheet, guint32 begin, int nrows)
/* See: 'Finding records in BIFF files': S59E28.HTM */
/* and S59D99.HTM */
static void
write_sheet (BiffPut *bp, ExcelSheet *sheet)
write_sheet (IOContext *context, BiffPut *bp, ExcelSheet *sheet)
{
guint32 y, block_end, maxrows;
int rows_in_block = ROW_BLOCK_MAX_LEN;
......@@ -3235,7 +3236,7 @@ write_sheet (BiffPut *bp, ExcelSheet *sheet)
block_end = write_block (bp, sheet, y, rows_in_block);
write_index (bp->pos, sheet, index_off);
write_sheet_tail (bp, sheet);
write_sheet_tail (context, bp, sheet);
biff_eof_write (bp);
}
......@@ -3287,8 +3288,8 @@ free_sheet (ExcelSheet *sheet)
/**
* pre_pass
* @context: Command context.
* @wb: the workbook to scan
* @context: Command context.
* @wb: The workbook to scan
*
* Scans all the workbook items. Adds all styles, fonts, formats and
* colors to tables. Resolves any referencing problems before they
......@@ -3296,7 +3297,7 @@ free_sheet (ExcelSheet *sheet)
*
**/
static int
pre_pass (CommandContext *context, ExcelWorkbook *wb)
pre_pass (IOContext *context, ExcelWorkbook *wb)
{
int ret = 0;
......@@ -3339,7 +3340,7 @@ free_workbook (ExcelWorkbook *wb)
}
static void
write_workbook (BiffPut *bp, ExcelWorkbook *wb, MsBiffVersion ver)
write_workbook (IOContext *context, BiffPut *bp, ExcelWorkbook *wb, MsBiffVersion ver)
{
ExcelSheet *s = 0;
int lp;
......@@ -3371,7 +3372,7 @@ write_workbook (BiffPut *bp, ExcelWorkbook *wb, MsBiffVersion ver)
/* Sheets */
for (lp = 0; lp < wb->sheets->len; lp++)
write_sheet (bp, g_ptr_array_index (wb->sheets, lp));
write_sheet (context, bp, g_ptr_array_index (wb->sheets, lp));
/* End of Sheets */
/* Finalise Workbook stuff */
......@@ -3395,7 +3396,7 @@ write_workbook (BiffPut *bp, ExcelWorkbook *wb, MsBiffVersion ver)
* storing empty row records.
*/
static int
check_sheet (CommandContext *context, ExcelSheet *sheet)
check_sheet (IOContext *context, ExcelSheet *sheet)
{
guint32 maxrows;
int ret = 0;
......@@ -3404,8 +3405,8 @@ check_sheet (CommandContext *context, ExcelSheet *sheet)