Commit 94e8312b authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

add libgsf and remove libole remove libole


2002-07-09  Jody Goldberg <jody@gnome.org>

	* README : add libgsf and remove libole
	* configure.in : remove libole
parent 60e3d019
2002-07-09 Jody Goldberg <jody@gnome.org>
* README : add libgsf and remove libole
* configure.in : remove libole
2002-07-08 Jon K Hellan <hellan@acm.org>
* src/gnumeric-graph.c: modernize a little bit more.
......
......@@ -25,6 +25,8 @@ Jody:
* Save selection correctly for xls.
* Move freeze state to SheetView.
* Decrease dependence on gal in favour of libgsf.
* Move libgsf for XL export
* Remove dependence on libole2 !
Jukka:
* More solver enhancements:
......
2002-07-09 Jody Goldberg <jody@gnome.org>
* README : add libgsf and remove libole
* configure.in : remove libole
2002-07-08 Jon K Hellan <hellan@acm.org>
* src/gnumeric-graph.c: modernize a little bit more.
......
2002-07-09 Jody Goldberg <jody@gnome.org>
* README : add libgsf and remove libole
* configure.in : remove libole
2002-07-08 Jon K Hellan <hellan@acm.org>
* src/gnumeric-graph.c: modernize a little bit more.
......
......@@ -37,13 +37,12 @@ You need:
libbonoboui >= 1.106.0 ??
libgnomeprint >= 1.106.0 ??
libgnomeprintui >= 1.106.0 ??
libgsf >= 1.1.0
intltools >= 0.9
libglade >= 1.99.4
gal-2 >= 0.0.0 (gal-2 branch of module gal)
gnome-xml >= 2.4.12
NOTE : gnome-xml is also known as libxml
libole2 >= 1.3.0
NOTE : libole2 is also known as libgnomeole2
Optionally:
gda >= 0.2.92 (GDA plugin, for accessing databases)
......
......@@ -188,28 +188,6 @@ AC_ARG_WITH(long_double,
fi]
)
dnl ****************************
dnl MS Excel (tm) Plugin
dnl ****************************
try_ole=true
excel_msg=yes
AC_ARG_WITH(excel,
[--{with,without}-excel Compile the Excel plugin],
if test "x$withval" = xno; then
try_ole=false
excel_msg="Disabled by request"
fi
)
if test "$try_ole" = "true"; then
PKG_CHECK_MODULES(LIBOLE2, [libole2-2.0 >= 2.2.7],
[excel_msg="yes"],
[excel_msg="NO. libole2 problem"])
fi
AM_CONDITIONAL(WITH_EXCEL, test x"$excel_msg" = "xyes")
AC_SUBST(LIBOLE2_CFLAGS)
AC_SUBST(LIBOLE2_LIBS)
dnl ****************************
dnl GDA Plugin
dnl ****************************
......@@ -750,10 +728,7 @@ Configuration:
Compiler flags: ${CFLAGS}
Floating point type: ${float_msg}
MS Excel Support: ${excel_msg}
GDA support: ${gda_msg}
GB support: ${gb_msg}
Bonobo Support: ${bonobo_msg}
Guile Support: ${guile_msg}
Evolution Support: ${evolution}
......
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-I$(top_srcdir)/src -I$(top_builddir)/src \
$(LIBOLE2_CFLAGS) \
$(GNUMERIC_CFLAGS)
gnumeric_plugin_exceldir = $(gnumeric_plugindir)/excel
xmldir = $(gnumeric_plugin_exceldir)
gnumeric_plugin_excel_LTLIBRARIES = excel.la
excel_la_LDFLAGS = -module -avoid-version $(LIBOLE2_LIBS)
excel_la_LDFLAGS = -module -avoid-version
excel_la_SOURCES = \
boot.c \
boot.h \
......@@ -37,8 +36,6 @@ excel_la_SOURCES = \
ms-obj.h \
ms-chart.h \
ms-chart.c \
ms-summary.c \
ms-summary.h \
rc4.c \
rc4.h \
md5.c \
......
......@@ -21,15 +21,17 @@
#include "module-plugin-defs.h"
#include "excel.h"
#include "ms-summary.h"
#include "boot.h"
#include "ms-excel-util.h"
#include "ms-excel-read.h"
#include <gsf/gsf-input-stdio.h>
#include <gsf/gsf-infile.h>
#include <gsf/gsf-infile-msole.h>
#include <gsf/gsf-output-stdio.h>
#include <gsf/gsf-outfile.h>
#include <gsf/gsf-outfile-msole.h>
GNUMERIC_MODULE_PLUGIN_INFO_DECL;
/* Used to toggle debug messages on & off */
......@@ -153,10 +155,10 @@ static void
excel_save (IOContext *context, WorkbookView *wb_view, const char *filename,
MsBiffVersion ver)
{
Workbook *wb = wb_view_workbook (wb_view);
MsOle *f;
MsOleErr result;
GsfOutput *output;
GsfOutfile *outfile;
void *state = NULL;
GError *err;
gint res;
io_progress_message (context, _("Preparing for save..."));
......@@ -169,28 +171,30 @@ excel_save (IOContext *context, WorkbookView *wb_view, const char *filename,
return;
}
result = ms_ole_create (&f, filename);
if (result != MS_OLE_ERR_OK) {
char *str = g_strdup_printf ("%s %s",
_("Can't open"),
filename);
output = gsf_output_stdio_new (filename, &err);
if (output == NULL) {
char *str = g_strdup_printf (_("Can't open '%s' : %s"),
filename, err->message);
gnumeric_io_error_save (context, str);
ms_ole_destroy (&f);
ms_excel_write_free_state (state);
g_error_free (err);
g_free (str);
return;
}
io_progress_message (context, _("Saving file..."));
io_progress_range_push (context, 0.1, 1.0);
ms_excel_write_workbook (context, f, state, ver);
outfile = gsf_outfile_msole_new (output);
g_object_unref (G_OBJECT (output));
ms_excel_write_workbook (context, outfile, state, ver);
io_progress_range_pop (context);
#warning re-enable when gsf meta data generator is ready
#if 0
Workbook *wb = wb_view_workbook (wb_view);
ms_summary_write (f, wb->summary_info);
ms_ole_destroy (&f);
#endif
g_object_unref (G_OBJECT (outfile));
}
void
......
......@@ -10,10 +10,9 @@
#define GNUMERIC_EXCEL_H
#include "gnumeric.h"
#include <libole2/ms-ole.h>
#include <gsf/gsf.h>
typedef gboolean (*MsExcelReadGbFn) (IOContext *context, Workbook *wb, MsOle *f);
typedef gboolean (*MsExcelReadGbFn) (IOContext *context, Workbook *wb, GsfInput *input);
extern MsExcelReadGbFn ms_excel_read_gb;
typedef enum { MS_BIFF_V2 = 2,
......@@ -35,7 +34,7 @@ void ms_excel_read_workbook (IOContext *context,
*/
extern int ms_excel_check_write (IOContext *context, void **state,
WorkbookView *wb, MsBiffVersion ver);
extern void ms_excel_write_workbook (IOContext *context, MsOle *file,
extern void ms_excel_write_workbook (IOContext *context, GsfOutfile *output,
void *state, MsBiffVersion ver);
void ms_excel_write_free_state (void *state);
......
......@@ -16,8 +16,8 @@
#include "ms-biff.h"
#include "biff-types.h"
#include <libole2/ms-ole.h>
#include <gsf/gsf-input.h>
#include <gsf/gsf-output.h>
#include <gsf/gsf-utils.h>
#define BIFF_DEBUG 0
......@@ -37,8 +37,8 @@ dump_biff (BiffQuery *q)
{
g_print ("Opcode 0x%x length %d malloced? %d\nData:\n", q->opcode, q->length, q->data_malloced);
if (q->length > 0)
ms_ole_dump (q->data, q->length);
/* dump_stream (q->pos); */
gsf_mem_dump (q->data, q->length);
/* dump_stream (q->output); */
}
/*******************************************************************************/
......@@ -388,21 +388,22 @@ ms_biff_query_destroy (BiffQuery *q)
/* Sets up a record on a stream */
BiffPut *
ms_biff_put_new (MsOleStream *s)
ms_biff_put_new (GsfOutput *output)
{
BiffPut *bp;
g_return_val_if_fail (s != NULL, 0);
g_return_val_if_fail (output != NULL, 0);
bp = g_new (BiffPut, 1);
bp->ms_op = bp->ls_op = 0;
bp->length = 0;
bp->length = 0;
bp->streamPos = s->tell (s);
bp->streamPos = gsf_output_tell (output);
bp->data_malloced = FALSE;
bp->data = 0;
bp->len_fixed = 0;
bp->pos = s;
bp->output = output;
return bp;
}
......@@ -411,7 +412,7 @@ void
ms_biff_put_destroy (BiffPut *bp)
{
g_return_if_fail (bp != NULL);
g_return_if_fail (bp->pos != NULL);
g_return_if_fail (bp->output != NULL);
g_free (bp);
}
......@@ -420,7 +421,7 @@ guint8 *
ms_biff_put_len_next (BiffPut *bp, guint16 opcode, guint32 len)
{
g_return_val_if_fail (bp, 0);
g_return_val_if_fail (bp->pos, 0);
g_return_val_if_fail (bp->output, 0);
g_return_val_if_fail (bp->data == NULL, 0);
g_return_val_if_fail (len < MAX_LIKED_BIFF_LEN, 0);
......@@ -432,7 +433,7 @@ ms_biff_put_len_next (BiffPut *bp, guint16 opcode, guint32 len)
bp->ms_op = (opcode >> 8);
bp->ls_op = (opcode & 0xff);
bp->length = len;
bp->streamPos = bp->pos->tell (bp->pos);
bp->streamPos = gsf_output_tell (bp->output);
if (len > 0) {
bp->data = g_new (guint8, len);
bp->data_malloced = TRUE;
......@@ -445,7 +446,7 @@ ms_biff_put_var_next (BiffPut *bp, guint16 opcode)
{
guint8 data[4];
g_return_if_fail (bp != NULL);
g_return_if_fail (bp->pos != NULL);
g_return_if_fail (bp->output != NULL);
#if BIFF_DEBUG > 0
printf ("Biff put var 0x%x\n", opcode);
......@@ -457,11 +458,11 @@ ms_biff_put_var_next (BiffPut *bp, guint16 opcode)
bp->curpos = 0;
bp->length = 0;
bp->data = 0;
bp->streamPos = bp->pos->tell (bp->pos);
bp->streamPos = gsf_output_tell (bp->output);
MS_OLE_SET_GUINT16 (data, opcode);
MS_OLE_SET_GUINT16 (data + 2,0xfaff); /* To be corrected later */
bp->pos->write (bp->pos, data, 4);
GSF_LE_SET_GUINT16 (data, opcode);
GSF_LE_SET_GUINT16 (data + 2,0xfaff); /* To be corrected later */
gsf_output_write (bp->output, 4, data);
}
void
......@@ -469,7 +470,7 @@ ms_biff_put_var_write (BiffPut *bp, guint8 *data, guint32 len)
{
g_return_if_fail (bp != NULL);
g_return_if_fail (data != NULL);
g_return_if_fail (bp->pos != NULL);
g_return_if_fail (bp->output != NULL);
g_return_if_fail (!bp->data);
g_return_if_fail (!bp->len_fixed);
......@@ -477,45 +478,45 @@ ms_biff_put_var_write (BiffPut *bp, guint8 *data, guint32 len)
/* Temporary */
g_return_if_fail (bp->length + len < 0xf000);
bp->pos->write (bp->pos, data, len);
bp->curpos+= len;
gsf_output_write (bp->output, len, data);
bp->curpos += len;
if (bp->curpos > bp->length)
bp->length = bp->curpos;
}
void
ms_biff_put_var_seekto (BiffPut *bp, MsOlePos pos)
ms_biff_put_var_seekto (BiffPut *bp, int pos)
{
g_return_if_fail (bp != NULL);
g_return_if_fail (bp->pos != NULL);
g_return_if_fail (bp->output != NULL);
g_return_if_fail (!bp->len_fixed);
g_return_if_fail (!bp->data);
bp->curpos = pos;
bp->pos->lseek (bp->pos, bp->streamPos + bp->curpos + 4, MsOleSeekSet);
gsf_output_seek (bp->output, bp->streamPos + bp->curpos + 4, GSF_SEEK_SET);
}
static void
ms_biff_put_var_commit (BiffPut *bp)
{
guint8 tmp [4];
MsOlePos endpos;
int endpos;
g_return_if_fail (bp != NULL);
g_return_if_fail (bp->pos != NULL);
g_return_if_fail (bp->output != NULL);
g_return_if_fail (!bp->len_fixed);
g_return_if_fail (!bp->data);
endpos = bp->streamPos + bp->length + 4;
bp->pos->lseek (bp->pos, bp->streamPos, MsOleSeekSet);
gsf_output_seek (bp->output, bp->streamPos, GSF_SEEK_SET);
MS_OLE_SET_GUINT16 (tmp, (bp->ms_op<<8) + bp->ls_op);
MS_OLE_SET_GUINT16 (tmp+2, bp->length);
bp->pos->write (bp->pos, tmp, 4);
GSF_LE_SET_GUINT16 (tmp, (bp->ms_op<<8) + bp->ls_op);
GSF_LE_SET_GUINT16 (tmp+2, bp->length);
gsf_output_write (bp->output, 4, tmp);
bp->pos->lseek (bp->pos, endpos, MsOleSeekSet);
gsf_output_seek (bp->output, endpos, GSF_SEEK_SET);
bp->streamPos = endpos;
bp->curpos = 0;
}
......@@ -525,23 +526,23 @@ ms_biff_put_len_commit (BiffPut *bp)
guint8 tmp[4];
g_return_if_fail (bp != NULL);
g_return_if_fail (bp->pos != NULL);
g_return_if_fail (bp->output != NULL);
g_return_if_fail (bp->len_fixed);
g_return_if_fail (bp->length == 0 || bp->data);
g_return_if_fail (bp->length < MAX_LIKED_BIFF_LEN);
/* if (!bp->data_malloced) Unimplemented optimisation
bp->pos->lseek (bp->pos, bp->length, MsOleSeekCur);
bp->output->lseek (bp->output, bp->length, GSF_SEEK_CUR);
else */
MS_OLE_SET_GUINT16 (tmp, (bp->ms_op<<8) + bp->ls_op);
MS_OLE_SET_GUINT16 (tmp + 2, bp->length);
bp->pos->write (bp->pos, tmp, 4);
bp->pos->write (bp->pos, bp->data, bp->length);
GSF_LE_SET_GUINT16 (tmp, (bp->ms_op<<8) + bp->ls_op);
GSF_LE_SET_GUINT16 (tmp + 2, bp->length);
gsf_output_write (bp->output, 4, tmp);
gsf_output_write (bp->output, bp->length, bp->data);
g_free (bp->data);
bp->data = 0 ;
bp->data_malloced = FALSE;
bp->streamPos = bp->pos->tell (bp->pos);
bp->streamPos = gsf_output_tell (bp->output);
bp->curpos = 0;
}
......
......@@ -9,7 +9,6 @@
#ifndef GNUMERIC_BIFF_H
#define GNUMERIC_BIFF_H
#include <libole2/ms-ole.h>
#include <gsf/gsf.h>
#include "rc4.h"
#include "md5.h"
......@@ -61,15 +60,15 @@ typedef struct _BiffPut
guint8 ls_op;
guint32 length; /* NB. can be extended by a continue opcode */
guint8 *data;
MsOlePos streamPos;
MsOlePos curpos; /* Curpos is offset from beggining of header */
int streamPos;
unsigned curpos; /* Curpos is offset from beginning of header */
int data_malloced;
int len_fixed;
MsOleStream *pos;
GsfOutput *output;
} BiffPut;
/* Sets up a record on a stream */
BiffPut *ms_biff_put_new (MsOleStream *);
BiffPut *ms_biff_put_new (GsfOutput *);
void ms_biff_put_destroy (BiffPut *);
/**
......@@ -82,7 +81,7 @@ guint8 *ms_biff_put_len_next (BiffPut *, guint16 opcode, guint32 len);
void ms_biff_put_var_next (BiffPut *, guint16 opcode);
void ms_biff_put_var_write (BiffPut *, guint8 *, guint32 len);
/* Seeks to pos bytes after the beggining of the record */
void ms_biff_put_var_seekto (BiffPut *, MsOlePos pos);
void ms_biff_put_var_seekto (BiffPut *, int pos);
/* Must commit after each record */
void ms_biff_put_commit (BiffPut *);
......
......@@ -15,15 +15,15 @@
#include "ms-biff.h"
/* Pass this a BiffQuery * */
#define EX_GETROW(p) (MS_OLE_GET_GUINT16(p->data + 0))
#define EX_GETCOL(p) (MS_OLE_GET_GUINT16(p->data + 2))
#define EX_GETXF(p) (MS_OLE_GET_GUINT16(p->data + 4))
#define EX_GETSTRLEN(p) (MS_OLE_GET_GUINT16(p->data + 6))
#define EX_SETROW(p,d) (MS_OLE_SET_GUINT16(p + 0, d))
#define EX_SETCOL(p,d) (MS_OLE_SET_GUINT16(p + 2, d))
#define EX_SETXF(p,d) (MS_OLE_SET_GUINT16(p + 4, d))
#define EX_SETSTRLEN(p,d) (MS_OLE_SET_GUINT16(p + 6, d))
#define EX_GETROW(p) (GSF_LE_GET_GUINT16(p->data + 0))
#define EX_GETCOL(p) (GSF_LE_GET_GUINT16(p->data + 2))
#define EX_GETXF(p) (GSF_LE_GET_GUINT16(p->data + 4))
#define EX_GETSTRLEN(p) (GSF_LE_GET_GUINT16(p->data + 6))
#define EX_SETROW(p,d) (GSF_LE_SET_GUINT16(p + 0, d))
#define EX_SETCOL(p,d) (GSF_LE_SET_GUINT16(p + 2, d))
#define EX_SETXF(p,d) (GSF_LE_SET_GUINT16(p + 4, d))
#define EX_SETSTRLEN(p,d) (GSF_LE_SET_GUINT16(p + 6, d))
/* Version info types as found in various Biff records */
typedef enum { MS_BIFF_TYPE_Workbook=0, MS_BIFF_TYPE_VBModule=1, MS_BIFF_TYPE_Worksheet=2,
......
......@@ -545,7 +545,7 @@ ms_excel_unexpected_biff (BiffQuery *q, char const *state,
printf ("Unexpected Opcode in %s: 0x%x, length 0x%x\n",
state, q->opcode, q->length);
if (debug_level > 2)
ms_ole_dump (q->data, q->length);
gsf_mem_dump (q->data, q->length);
}
#endif
}
......@@ -721,7 +721,7 @@ biff_get_text (guint8 const *pos, guint32 length, guint32 *byte_length)
d (5, {
printf ("String:\n");
ms_ole_dump (pos, length + 1);
gsf_mem_dump (pos, length + 1);
});
header = biff_string_get_flags (pos,
......@@ -746,7 +746,7 @@ biff_get_text (guint8 const *pos, guint32 length, guint32 *byte_length)
d (4, {
printf ("String len %d, byte length %d: %d %d %d:\n",
length, (*byte_length), high_byte, rich_str, ext_str);
ms_ole_dump (pos, *byte_length);
gsf_mem_dump (pos, *byte_length);
});
......@@ -820,7 +820,7 @@ get_string (char **output, BiffQuery *q, guint32 offset, MsBiffVersion ver)
&rich_str);
if (!header) {
g_warning ("Seriously broken string with no header 0x%x", *(q->data + new_offset));
ms_ole_dump (q->data + new_offset, q->length - new_offset);
gsf_mem_dump (q->data + new_offset, q->length - new_offset);
return 0;
}
......@@ -864,7 +864,7 @@ read_sst (BiffQuery *q, ExcelWorkbook *wb, MsBiffVersion ver)
d (4, {
printf ("SST\n");
ms_ole_dump (q->data, q->length);
gsf_mem_dump (q->data, q->length);
});
wb->global_string_max = GSF_LE_GET_GUINT32 (q->data + 4);
......@@ -928,7 +928,7 @@ ms_biff_bof_data_new (BiffQuery *q)
d (2, {
printf ("Complicated BIFF version 0x%x\n",
GSF_LE_GET_GUINT16 (q->non_decrypted_data));
ms_ole_dump (q->non_decrypted_data, q->length);
gsf_mem_dump (q->non_decrypted_data, q->length);
});
switch (GSF_LE_GET_GUINT16 (q->non_decrypted_data)) {
......@@ -2123,7 +2123,7 @@ ms_excel_read_formula (BiffQuery *q, ExcelSheet *esheet)
esheet->gnum_sheet->name_unquoted,
cell_name (cell));
if (ms_excel_read_debug > 5)
ms_ole_dump (q->data + 6, 8);
gsf_mem_dump (q->data + 6, 8);
});
val = value_new_empty ();
......@@ -3476,7 +3476,7 @@ ms_excel_read_cf (BiffQuery *q, ExcelSheet *esheet)
}
puts ("Header");
ms_ole_dump (q->data+6, 6);
gsf_mem_dump (q->data+6, 6);
/* UNDOCUMENTED : the format of the conditional format
* is unspecified.
......@@ -3507,14 +3507,14 @@ ms_excel_read_cf (BiffQuery *q, ExcelSheet *esheet)
if (fmt_type & 0x04) { /* font */
puts ("Font");
ms_ole_dump (q->data+offset, 118);
gsf_mem_dump (q->data+offset, 118);
offset += 118;
}
if (fmt_type & 0x10) { /* borders */
puts ("Border");
ms_ole_dump (q->data+offset, 8);
gsf_mem_dump (q->data+offset, 8);
offset += 8;
}
......@@ -3549,7 +3549,7 @@ ms_excel_read_cf (BiffQuery *q, ExcelSheet *esheet)
g_return_if_fail (q->length == offset + expr1_len + expr2_len);
ms_ole_dump (q->data+6, 6);
gsf_mem_dump (q->data+6, 6);
#if 0
printf ("%d == %d (%d + %d + %d) (0x%x)\n",
q->length, offset + expr1_len + expr2_len,
......@@ -4099,7 +4099,7 @@ ms_excel_read_sheet (BiffQuery *q, ExcelWorkbook *wb,
Value *v = biff_get_rk (q->data + 6);
d (2, {
printf ("RK number: 0x%x, length 0x%x\n", q->opcode, q->length);
ms_ole_dump (q->data, q->length);
gsf_mem_dump (q->data, q->length);
});
ms_excel_sheet_insert_val (esheet, EX_GETXF (q), EX_GETCOL (q),
......@@ -4396,7 +4396,7 @@ ms_excel_externsheet_v8 (BiffQuery const *q, ExcelWorkbook *ewb)
num = GSF_LE_GET_GUINT16 (q->data);
d (1, printf ("ExternSheet (%d entries)\n", num););
d (10, ms_ole_dump (q->data, q->length););
d (10, gsf_mem_dump (q->data, q->length););
ewb->extern_sheet_v8 = g_array_set_size (
g_array_sized_new (FALSE, FALSE,
......@@ -4671,7 +4671,7 @@ ms_excel_read_workbook (IOContext *context, WorkbookView *wb_view,
case BIFF_FORMAT: { /* S59D8E.HTM */
BiffFormatData *d = g_new (BiffFormatData, 1);
/* printf ("Format data 0x%x %d\n", q->ms_op, ver->version);
ms_ole_dump (q->data, q->length);*/
gsf_mem_dump (q->data, q->length);*/
if (ver->version == MS_BIFF_V7) { /* Totaly guessed */
d->idx = GSF_LE_GET_GUINT16 (q->data);
d->name = biff_get_text (q->data + 3, GSF_LE_GET_GUINT8 (q->data + 2), NULL);
......
This diff is collapsed.
......@@ -9,8 +9,6 @@
#ifndef GNUMERIC_MS_EXCEL_WRITE_H
#define GNUMERIC_MS_EXCEL_WRITE_H
#include <libole2/ms-ole.h>
#include "ms-biff.h"
#include "ms-excel-biff.h"
#include "ms-excel-util.h"
......@@ -60,7 +58,7 @@ struct _ExcelSheet {
ExcelWorkbook *wb;
Sheet *gnum_sheet;
GArray *dbcells;
MsOlePos streamPos;
unsigned streamPos;
guint32 boundsheetPos;
gint32 max_col, max_row;
GHashTable *formula_cache;
......@@ -82,7 +80,7 @@ struct _ExcelWorkbook {
Fonts *fonts;
Formats *formats;
GPtrArray *names;
MsOlePos streamPos;
unsigned streamPos;
};
typedef enum {
......@@ -112,8 +110,8 @@ biff_convert_text (char **buf, const char *txt, MsBiffVersion ver);
extern int
biff_put_text (BiffPut *bp, const char *txt, int len, MsBiffVersion ver,
gboolean write_len, PutType how);
extern int ms_excel_write_ExcelWorkbook (MsOle *file, ExcelWorkbook *wb,
MsBiffVersion ver);
extern int ms_excel_write_ExcelWorkbook (GsfOutfile *file, ExcelWorkbook *wb,
MsBiffVersion ver);
extern int ms_excel_write_get_sheet_idx (ExcelWorkbook *wb, Sheet *gnum_sheet);
extern int ms_excel_write_get_externsheet_idx (ExcelWorkbook *wb,
Sheet *gnum_sheeta,
......
......@@ -738,7 +738,7 @@ ms_excel_parse_formula (ExcelWorkbook const *ewb,
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 1 && esheet != NULL) {
ms_excel_dump_cellname (ewb, esheet, fn_col, fn_row);
ms_ole_dump (mem, length);
gsf_mem_dump (mem, length);
}
#endif
......@@ -872,7 +872,7 @@ ms_excel_parse_formula (ExcelWorkbook const *ewb,
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 2) {
printf ("Optimised IF 0x%x 0x%x\n", grbit, w);
ms_ole_dump (mem, length);
gsf_mem_dump (mem, length);
}
#endif
tr = w ? ms_excel_parse_formula (ewb, esheet, fn_col, fn_row,
......@@ -889,7 +889,7 @@ ms_excel_parse_formula (ExcelWorkbook const *ewb,
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 1) {
printf ("'Optimised' choose\n");
ms_ole_dump (mem,length);
gsf_mem_dump (mem,length);
}
#endif
for (lp=0;lp<w;lp++) { /* w = wCases */
......@@ -913,7 +913,7 @@ ms_excel_parse_formula (ExcelWorkbook const *ewb,
if (ms_excel_formula_debug > 2) {
printf ("Goto %d: cur = 0x%x\n", w,
(int)(cur-mem));
ms_ole_dump (mem, length);
gsf_mem_dump (mem, length);
}
#endif
ptg_length = w;
......@@ -978,7 +978,7 @@ ms_excel_parse_formula (ExcelWorkbook const *ewb,
case FORMULA_PTG_STR: {
char *str;
guint32 len;
/* ms_ole_dump (mem, length);*/
/* gsf_mem_dump (mem, length);*/
if (ver >= MS_BIFF_V8) {
str = biff_get_text (cur+2, GSF_LE_GET_GUINT16(cur), &len);
ptg_length = 2 + len;
......@@ -1095,7 +1095,7 @@ ms_excel_parse_formula (ExcelWorkbook const *ewb,
} else {
printf ("-------------------\n");
printf ("XL : Extended ptg %x\n", eptg_type);
ms_ole_dump (mem+2, length-2);
gsf_mem_dump (mem+2, length-2);
printf ("-------------------\n");
}
}
......@@ -1113,7 +1113,7 @@ ms_excel_parse_formula (ExcelWorkbook const *ewb,
if (ms_excel_formula_debug > 1) {
printf ("An Array how interesting: (%d,%d)\n",
cols, rows);
ms_ole_dump (mem, length);
gsf_mem_dump (mem, length);
}
#endif
array_data += 3;
......@@ -1158,7 +1158,7 @@ ms_excel_parse_formula (ExcelWorkbook const *ewb,
} else {
printf ("FIXME: Duff array item type %d @ %s%d\n",
opts, col_name(fn_col), fn_row+1);
ms_ole_dump (array_data+1, 8);
gsf_mem_dump (array_data+1, 8);
error = TRUE;
goto really_duff;
break;
......@@ -1428,7 +1428,7 @@ ms_excel_parse_formula (ExcelWorkbook const *ewb,
cell_coord_name (fn_col,fn_row),
(shared?" (shared)":""));
printf ("formula data : \n");
ms_ole_dump (mem, length);
gsf_mem_dump (mem, length);
parse_list_free (&stack);
return expr_tree_string (_(" Unknown formula"));
......
......@@ -24,9 +24,7 @@
#include <str.h>
#include <parse-util.h>
#include <fcntl.h>
#include <assert.h>
#include <stdio.h>
#include <gsf/gsf-utils.h>
#define FORMULA_DEBUG 0
/*#define DO_IT (ms_excel_formula_debug > 0)*/
......@@ -235,8 +233,8 @@ ms_formula_write_pre_data (BiffPut *bp, ExcelSheet *sheet,
if (DO_IT) {
ms_biff_put_var_next (bp, BIFF_EXTERNNAME);
MS_OLE_SET_GUINT32 (data + 0, 0x0);
MS_OLE_SET_GUINT16 (data + 4, 0x0);
GSF_LE_SET_GUINT32 (data + 0, 0x0);
GSF_LE_SET_GUINT16 (data + 4, 0x0);
ms_biff_put_var_write (bp, data, 6);
txt = g_strdup (fce->u.ename_v7.name);
g_strup (txt); /* scraping the barrel here */
......@@ -246,7 +244,7 @@ ms_formula_write_pre_data (BiffPut *bp, ExcelSheet *sheet,
TRUE, AS_PER_VER);
g_free (buf);
g_free (txt);
MS_OLE_SET_GUINT32 (data, 0x171c0002); /* Magic hey :-) */
GSF_LE_SET_GUINT32 (data, 0x171c0002); /* Magic hey :-) */