Commit 8f9a9e61 authored by JodyGoldberg's avatar JodyGoldberg Committed by Jody Goldberg
Browse files

check for failure to start editing. (cb_insert_current_time) : ditto.


2002-06-18  Jody Goldberg <jody@gnome.org>

	* src/workbook-control-gui.c (cb_insert_current_date) : check for
	  failure to start editing.
	(cb_insert_current_time) : ditto.

2002-06-18  Jody Goldberg <jody@gnome.org>

	* src/gnumeric-graph.c (gnm_graph_vector_seq_scalar) : forward port a
	  patch for keelyn.

	* src/file.c (gnum_file_saver_save_to_stream_real) : forward port a
	  warning suppression.

	* src/clipboard.c (clipboard_paste_region) : restore the expr_relocate
	  code in preparation for supporting the XL style heuristic.

	* src/GNOME_Gnumeric.xml : forward port some fixes.
	* src/sheet-object-widget.c (cb_scrollbar_value_changed) : ditto.
	(sheet_widget_scrollbar_set_sheet) : ditto.

2002-06-17  Jody Goldberg <jody@gnome.org>

	* src/dependent.c (cb_name_invalidate) : renamed from
	  cb_name_invalidate_sheet.  Just set the expression to NULL.
	  no need to be polite.  It just confuses things during workbook
	  destruction when the name references another sheet which has already
	  been destroyed.
parent d61d3c2a
2002-06-18 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c (cb_insert_current_date) : check for
failure to start editing.
(cb_insert_current_time) : ditto.
2002-06-18 Jody Goldberg <jody@gnome.org>
* src/gnumeric-graph.c (gnm_graph_vector_seq_scalar) : forward port a
patch for keelyn.
* src/file.c (gnum_file_saver_save_to_stream_real) : forward port a
warning suppression.
* src/clipboard.c (clipboard_paste_region) : restore the expr_relocate
code in preparation for supporting the XL style heuristic.
* src/GNOME_Gnumeric.xml : forward port some fixes.
* src/sheet-object-widget.c (cb_scrollbar_value_changed) : ditto.
(sheet_widget_scrollbar_set_sheet) : ditto.
2002-06-17 Jody Goldberg <jody@gnome.org>
* src/dependent.c (cb_name_invalidate) : renamed from
cb_name_invalidate_sheet. Just set the expression to NULL.
no need to be polite. It just confuses things during workbook
destruction when the name references another sheet which has already
been destroyed.
2002-06-17 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/commands.c (cmd_cell_range_is_locked_effective) : use
......
2002-06-18 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c (cb_insert_current_date) : check for
failure to start editing.
(cb_insert_current_time) : ditto.
2002-06-18 Jody Goldberg <jody@gnome.org>
* src/gnumeric-graph.c (gnm_graph_vector_seq_scalar) : forward port a
patch for keelyn.
* src/file.c (gnum_file_saver_save_to_stream_real) : forward port a
warning suppression.
* src/clipboard.c (clipboard_paste_region) : restore the expr_relocate
code in preparation for supporting the XL style heuristic.
* src/GNOME_Gnumeric.xml : forward port some fixes.
* src/sheet-object-widget.c (cb_scrollbar_value_changed) : ditto.
(sheet_widget_scrollbar_set_sheet) : ditto.
2002-06-17 Jody Goldberg <jody@gnome.org>
* src/dependent.c (cb_name_invalidate) : renamed from
cb_name_invalidate_sheet. Just set the expression to NULL.
no need to be polite. It just confuses things during workbook
destruction when the name references another sheet which has already
been destroyed.
2002-06-17 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/commands.c (cmd_cell_range_is_locked_effective) : use
......
2002-06-18 Jody Goldberg <jody@gnome.org>
* src/workbook-control-gui.c (cb_insert_current_date) : check for
failure to start editing.
(cb_insert_current_time) : ditto.
2002-06-18 Jody Goldberg <jody@gnome.org>
* src/gnumeric-graph.c (gnm_graph_vector_seq_scalar) : forward port a
patch for keelyn.
* src/file.c (gnum_file_saver_save_to_stream_real) : forward port a
warning suppression.
* src/clipboard.c (clipboard_paste_region) : restore the expr_relocate
code in preparation for supporting the XL style heuristic.
* src/GNOME_Gnumeric.xml : forward port some fixes.
* src/sheet-object-widget.c (cb_scrollbar_value_changed) : ditto.
(sheet_widget_scrollbar_set_sheet) : ditto.
2002-06-17 Jody Goldberg <jody@gnome.org>
* src/dependent.c (cb_name_invalidate) : renamed from
cb_name_invalidate_sheet. Just set the expression to NULL.
no need to be polite. It just confuses things during workbook
destruction when the name references another sheet which has already
been destroyed.
2002-06-17 Andreas J. Guelzow <aguelzow@taliesin.ca>
* src/commands.c (cmd_cell_range_is_locked_effective) : use
......
......@@ -12,14 +12,13 @@
#include <gnumeric-config.h>
#include <gnumeric.h>
#include <glib.h>
#include <libole2/ms-ole.h>
#include <gsf/gsf-input.h>
#include "ms-biff.h"
#include "biff-types.h"
#include <stdio.h>
#include <libole2/ms-ole.h>
#include <gsf/gsf-input.h>
#include <gsf/gsf-utils.h>
#define BIFF_DEBUG 0
......@@ -36,7 +35,7 @@
void
dump_biff (BiffQuery *q)
{
printf ("Opcode 0x%x length %d malloced? %d\nData:\n", q->opcode, q->length, q->data_malloced);
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); */
......@@ -268,7 +267,7 @@ ms_biff_query_peek_next (BiffQuery *q, guint16 *opcode)
data = gsf_input_read (q->input, 2, NULL);
if (data == NULL)
return FALSE;
*opcode = MS_OLE_GET_GUINT16 (data);
*opcode = GSF_LE_GET_GUINT16 (data);
gsf_input_seek (q->input, -2, GSF_SEEK_CUR);
......@@ -304,8 +303,8 @@ ms_biff_query_next (BiffQuery *q)
data = gsf_input_read (q->input, 4, NULL);
if (data == NULL)
return FALSE;
q->opcode = MS_OLE_GET_GUINT16 (data);
q->length = MS_OLE_GET_GUINT16 (data + 2);
q->opcode = GSF_LE_GET_GUINT16 (data);
q->length = GSF_LE_GET_GUINT16 (data + 2);
q->ms_op = (q->opcode>>8);
q->ls_op = (q->opcode&0xff);
......
This diff is collapsed.
......@@ -34,6 +34,7 @@
#include "ms-excel-read.h"
#include "ms-obj.h"
#include <gsf/gsf-utils.h>
#include <zlib.h>
#undef G_LOG_DOMAIN
......@@ -273,10 +274,10 @@ ms_escher_read_SplitMenuColors (MSEscherState * state, MSEscherHeader * h)
if ((data = ms_escher_get_data (state, h->offset + COMMON_HEADER_LEN,
16, &needs_free))) {
guint32 const top_level_fill = MS_OLE_GET_GUINT32(data + 0);
guint32 const line = MS_OLE_GET_GUINT32(data + 4);
guint32 const shadow = MS_OLE_GET_GUINT32(data + 8);
guint32 const threeD = MS_OLE_GET_GUINT32(data + 12);
guint32 const top_level_fill = GSF_LE_GET_GUINT32(data + 0);
guint32 const line = GSF_LE_GET_GUINT32(data + 4);
guint32 const shadow = GSF_LE_GET_GUINT32(data + 8);
guint32 const threeD = GSF_LE_GET_GUINT32(data + 12);
d (0, printf ("top_level_fill = 0x%x;\nline = 0x%x;\nshadow = 0x%x;\nthreeD = 0x%x;\n",
top_level_fill, line, shadow, threeD););
......@@ -312,19 +313,19 @@ ms_escher_read_BSE (MSEscherState * state, MSEscherHeader * h)
gboolean needs_free;
guint8 const * data = ms_escher_get_data (state,
h->offset + COMMON_HEADER_LEN, 36, &needs_free);
guint8 const win_type = MS_OLE_GET_GUINT8 (data + 0);
guint8 const mac_type = MS_OLE_GET_GUINT8 (data + 1);
/*guint16 const tag = MS_OLE_GET_GUINT16 (data + 18);*/
guint32 const size = MS_OLE_GET_GUINT32 (data + 20);
guint32 const ref_count = MS_OLE_GET_GUINT32 (data + 24);
gint32 const del_offset = MS_OLE_GET_GUINT32 (data + 28);
guint8 const is_texture = MS_OLE_GET_GUINT8 (data + 32);
guint8 const name_len = MS_OLE_GET_GUINT8 (data + 33);
guint8 const win_type = GSF_LE_GET_GUINT8 (data + 0);
guint8 const mac_type = GSF_LE_GET_GUINT8 (data + 1);
/*guint16 const tag = GSF_LE_GET_GUINT16 (data + 18);*/
guint32 const size = GSF_LE_GET_GUINT32 (data + 20);
guint32 const ref_count = GSF_LE_GET_GUINT32 (data + 24);
gint32 const del_offset = GSF_LE_GET_GUINT32 (data + 28);
guint8 const is_texture = GSF_LE_GET_GUINT8 (data + 32);
guint8 const name_len = GSF_LE_GET_GUINT8 (data + 33);
guint8 checksum[16]; /* RSA Data Security, Inc. MD4 Message-Digest Algorithm */
const char *name = "unknown";
int i;
for (i = 16; i-- > 0;)
checksum[i] = MS_OLE_GET_GUINT8 (data + 2 + i);
checksum[i] = GSF_LE_GET_GUINT8 (data + 2 + i);
d (0 , {
printf ("Win type = %s;\n", bliptype_name (win_type));
......@@ -394,8 +395,8 @@ ms_escher_read_Blip (MSEscherState * state, MSEscherHeader * h)
if (inst == 0x216 || inst == 0x3d4 || inst == 0x542) {
guint8 const *tmp = ms_escher_get_data (state, h->offset + offset,
META_FILE_HEADER_LEN, &needs_free);
guint32 uncompressed_len = MS_OLE_GET_GUINT32 (tmp+0);
guint32 compressed_len = MS_OLE_GET_GUINT32 (tmp+28);
guint32 uncompressed_len = GSF_LE_GET_GUINT32 (tmp+0);
guint32 compressed_len = GSF_LE_GET_GUINT32 (tmp+28);
guint8 compress = tmp[32];
guint8 filter = tmp[33];
......@@ -636,8 +637,8 @@ ms_escher_read_Sp (MSEscherState * state, MSEscherHeader * h)
h->offset + COMMON_HEADER_LEN, 8, &needs_free);
if (data != NULL) {
guint32 const spid = MS_OLE_GET_GUINT32 (data+0);
guint32 const flags = MS_OLE_GET_GUINT32 (data+4);
guint32 const spid = GSF_LE_GET_GUINT32 (data+0);
guint32 const flags = GSF_LE_GET_GUINT32 (data+4);
d (0, printf ("SPID %d, Type %d,%s%s%s%s%s%s%s%s%s%s%s;\n",
spid, h->instance,
(flags&0x01) ? " Group": "",
......@@ -766,9 +767,9 @@ ms_escher_read_Dg (MSEscherState *state, MSEscherHeader *h)
{
#if 0
guint8 const *data = h->data + COMMON_HEADER_LEN;
guint32 num_shapes = MS_OLE_GET_GUINT32(data);
guint32 num_shapes = GSF_LE_GET_GUINT32(data);
/* spid_cur = last SPID given to an SP in this DG :-) */
guint32 spid_cur = MS_OLE_GET_GUINT32(data+4);
guint32 spid_cur = GSF_LE_GET_GUINT32(data+4);
guint32 drawing_id = h->instance;
/* This drawing has these num_shapes shapes, with a pointer to the last
......@@ -797,10 +798,10 @@ ms_escher_read_Dgg (MSEscherState *state, MSEscherHeader *h)
guint32 lp;
guint8 const *data = h->data + COMMON_HEADER_LEN;
fd.id_clusts = g_array_new (1, 1, sizeof(ID_CLUST));
fd.max_spid = MS_OLE_GET_GUINT32(data+ 0);
fd.num_id_clust = MS_OLE_GET_GUINT32(data+ 4);
fd.num_shapes_saved = MS_OLE_GET_GUINT32(data+ 8);
fd.num_drawings_saved = MS_OLE_GET_GUINT32(data+12);
fd.max_spid = GSF_LE_GET_GUINT32(data+ 0);
fd.num_id_clust = GSF_LE_GET_GUINT32(data+ 4);
fd.num_shapes_saved = GSF_LE_GET_GUINT32(data+ 8);
fd.num_drawings_saved = GSF_LE_GET_GUINT32(data+12);
printf ("maxspid 0x%x clusts 0x%x shapes 0x%x drawings x%x\n",
fd.max_spid, fd.num_id_clust, fd.num_shapes_saved,
......@@ -809,8 +810,8 @@ ms_escher_read_Dgg (MSEscherState *state, MSEscherHeader *h)
data+=16;
for (lp = 0; lp < fd.num_id_clust; lp++) {
ID_CLUST cl;
cl.DG_owning_spids = MS_OLE_GET_GUINT32(data+0);
cl.spids_used_so_far = MS_OLE_GET_GUINT32(data+4);
cl.DG_owning_spids = GSF_LE_GET_GUINT32(data+0);
cl.spids_used_so_far = GSF_LE_GET_GUINT32(data+4);
g_array_append_val (fd.id_clusts, cl);
}
#endif
......@@ -1078,11 +1079,11 @@ ms_escher_read_OPT (MSEscherState *state, MSEscherHeader *h)
g_return_val_if_fail (6*num_properties + COMMON_HEADER_LEN <= h->len, TRUE);
for (i = 0; i < num_properties; ++i, fopte += 6) {
guint16 const tmp = MS_OLE_GET_GUINT32(fopte);
guint16 const tmp = GSF_LE_GET_GUINT32(fopte);
guint const pid = tmp & 0x3fff;
gboolean const is_blip = (tmp & 0x4000) != 0;
gboolean const is_complex = (tmp & 0x8000) != 0;
guint32 const val = MS_OLE_GET_GUINT32(fopte+2);
guint32 const val = GSF_LE_GET_GUINT32(fopte+2);
MSObjAttrID id = MS_OBJ_ATTR_NONE;
/* container is sorted by pid. Use this as sanity test */
......@@ -1830,11 +1831,11 @@ ms_escher_read_container (MSEscherState *state, MSEscherHeader *container,
return TRUE;
}
tmp = MS_OLE_GET_GUINT16 (data + 0);
h.fbt = MS_OLE_GET_GUINT16 (data + 2);
tmp = GSF_LE_GET_GUINT16 (data + 0);
h.fbt = GSF_LE_GET_GUINT16 (data + 2);
/* Include the length of this header in the record size */
h.len = MS_OLE_GET_GUINT32 (data + 4) + COMMON_HEADER_LEN;
h.len = GSF_LE_GET_GUINT32 (data + 4) + COMMON_HEADER_LEN;
h.ver = tmp & 0x0f;
h.instance = (tmp >> 4) & 0xfff;
......
This diff is collapsed.
......@@ -369,13 +369,13 @@ lookup_font_base_char_width_new (char const * const name, double size_pts,
#ifdef HAVE_ICONV
static char *
static char const *
get_locale_charset_name (void)
{
const char *ccharset;
static char* charset = NULL;
static char const * charset = NULL;
if (charset)
if (charset != NULL)
return charset;
#ifdef _NL_CTYPE_CODESET_NAME
......@@ -384,16 +384,15 @@ get_locale_charset_name (void)
ccharset = nl_langinfo (CODESET);
#else
{
const char *locale = setlocale (LC_CTYPE, NULL);
const char *tmp = strchr (locale, '.');
if (tmp)
ccharset = tmp + 1;
char const *locale = setlocale (LC_CTYPE, NULL);
if (locale != NULL) {
const char *tmp = strchr (locale, '.');
if (tmp != NULL)
ccharset = tmp + 1;
}
}
#endif
if (!ccharset)
ccharset = "ISO-8859-1";
charset = g_strdup (ccharset);
return charset;
return (charset = (charset != NULL) ? g_strdup (charset) : "ISO-8859-1");
}
#endif
......@@ -406,12 +405,40 @@ typedef struct
/* here is a list of languages for which cp1251 is used on Windows*/
static char const * const cyr_locales[] =
{
"russian", "ru", "be", "uk", "ukrainian", NULL
"be", "be_BY", "bulgarian", "bg", "bg_BG", "mk", "mk_MK",
"russian", "ru", "ru_RU", "ru_UA", "sp", "sp_YU", "sr", "sr_YU",
"ukrainian", "uk", "uk_UA", NULL
};
/* here is a list of languages for which cp for cjk is used on Windows*/
static char const * const jp_locales[] =
{
"japan", "japanese", "ja", "ja_JP", NULL
};
static char const * const zhs_locales[] =
{
"chinese-s", "zh", "zh_CN", NULL
};
static char const * const kr_locales[] =
{
"korean", "ko", "ko_KR", NULL
};
static char const * const zht_locales[] =
{
"chinese-t", "zh_HK", "zh_TW", NULL
};
static s_hash_entry const win_codepages[]=
{
{ cyr_locales , 1251 },
{ jp_locales , 932 },
{ zhs_locales , 936 },
{ kr_locales , 949 },
{ zht_locales , 950 },
{ NULL } /*terminator*/
};
......@@ -425,11 +452,13 @@ excel_iconv_win_codepage (void)
if ((lang = getenv("WINDOWS_LANGUAGE")) == NULL) {
char const *locale = setlocale (LC_CTYPE, NULL);
char const *lang_sep = strchr (locale, '_');
if (lang_sep)
lang = g_strndup (locale, lang_sep - locale);
else
lang = g_strdup (locale); /* simplifies exit */
if (locale != NULL) {
char const *lang_sep = strchr (locale, '.');
if (lang_sep)
lang = g_strndup (locale, lang_sep - locale);
else
lang = g_strdup (locale); /* simplifies exit */
}
}
if (lang != NULL) {
......
......@@ -77,29 +77,77 @@ static excel_iconv_t current_workbook_iconv = NULL;
static guint style_color_to_rgb888 (const StyleColor *c);
static gint palette_get_index (ExcelWorkbook *wb, guint c);
/**
* This function converts simple strings...
**/
int
biff_convert_text (char **buf, const char *txt, MsBiffVersion ver)
{
guint32 lp, len;
g_return_val_if_fail (txt, 0);
len = strlen (txt);
if (len == 0)
*buf = g_strdup ("");
else if (ver >= MS_BIFF_V8) { /* unicode */
wchar_t* wcbuf;
guint16 *outbuf;
len = mbstowcs(NULL, txt, 0);
g_return_val_if_fail (len > 0, 0);
wcbuf = g_new(wchar_t, len + 1);
mbstowcs(wcbuf,txt,len + 1);
outbuf = g_new(guint16, len);
*buf = (char *)outbuf;
for (lp = 0; lp < len; lp++) {
outbuf[lp] = wcbuf[lp];
}
g_free(wcbuf);
len = lp * 2;
} else {
size_t inbufleft = len, outbufleft = len*8;
char *outbufptr;
char const * inbufptr = txt;
*buf = g_new(char, outbufleft);
outbufptr = *buf;
excel_iconv (current_workbook_iconv, &inbufptr, &inbufleft,
&outbufptr, &outbufleft);
len = outbufptr - *buf;
};
return len;
}
/**
* This function writes simple strings...
* FIXME: see S59D47.HTM for full description
* it returns the length of the string.
**/
int
biff_put_text (BiffPut *bp, const char *txt, MsBiffVersion ver,
biff_put_text (BiffPut *bp, const char *txt, int len, MsBiffVersion ver,
gboolean write_len, PutType how)
{
#define BLK_LEN 16
guint8 data[BLK_LEN];
guint32 lp, len, ans;
guint32 ans;
int lp;
gboolean sixteen_bit_len;
gboolean unicode;
guint32 off;
g_return_val_if_fail (bp, 0);
if (txt == NULL) {
g_warning ("writing NULL string as \"\"");
txt = "";
}
g_return_val_if_fail (txt, 0);
ans = 0;
len = strlen (txt);
/* printf ("Write '%s' len = %d\n", txt, len); */
if ((how == AS_PER_VER &&
......@@ -115,49 +163,46 @@ biff_put_text (BiffPut *bp, const char *txt, MsBiffVersion ver,
unicode = FALSE;
off = 0;
if (write_len) {
if (sixteen_bit_len) {
MS_OLE_SET_GUINT16 (data, len);
off = 2;
} else {
g_return_val_if_fail (len<256, 0);
MS_OLE_SET_GUINT8 (data, len);
off = 1;
}
}
if (unicode) {
guint16 *buf = (guint16 *)txt;
if (write_len) {
if (sixteen_bit_len) {
MS_OLE_SET_GUINT16 (data, len/2);
off = 2;
} else {
g_return_val_if_fail (len/2<256, 0);
MS_OLE_SET_GUINT8 (data, len/2);
off = 1;
}
}
MS_OLE_SET_GUINT8 (data + off, 0x0);
off++;
}
ms_biff_put_var_write (bp, data, off);
ms_biff_put_var_write (bp, data, off);
if (unicode) {
wchar_t* wcbuf = g_new(wchar_t,len);
len = mbstowcs(wcbuf,txt,len);
for (lp = 0; lp < len; lp++) {
MS_OLE_SET_GUINT16 (data, wcbuf[lp]);
for (lp = 0; lp < len/2; lp++) {
MS_OLE_SET_GUINT16 (data, buf[lp]);
ms_biff_put_var_write (bp, data, 2);
}
g_free(wcbuf);
lp *= 2;
} else {
size_t inbufleft = len, outbufleft = len*8;
char* mbbuf = g_new(char, outbufleft);
char *outbufptr = mbbuf;
char const * inbufptr = txt;
guint32 retlen;
if (write_len) {
if (sixteen_bit_len) {
MS_OLE_SET_GUINT16 (data, len);
off = 2;
} else {
g_return_val_if_fail (len<256, 0);
MS_OLE_SET_GUINT8 (data, len);
off = 1;
}
ms_biff_put_var_write (bp, data, off);
}
excel_iconv (current_workbook_iconv, &inbufptr, &inbufleft,
&outbufptr, &outbufleft);
retlen = outbufptr - mbbuf;
for (lp = 0; lp < retlen; lp++) {
MS_OLE_SET_GUINT8 (data, mbbuf[lp]);
for (lp = 0; lp < len; lp++) {
MS_OLE_SET_GUINT8 (data, txt[lp]);
ms_biff_put_var_write (bp, data, 1);
}
g_free(mbbuf);
};
return off + lp;
return off + len;
/* An attempt at efficiency */
/* chunks = len/BLK_LEN;
pos = 0;
......@@ -359,17 +404,19 @@ write_externsheets (BiffPut *bp, ExcelWorkbook *wb, ExcelSheet *ignore)
for (lp = 0; lp < num_sheets; lp++) {
ExcelSheet *esheet = g_ptr_array_index (wb->sheets, lp);
gint len = strlen (esheet->gnum_sheet->name_quoted);
gint len;
char *buf;
guint8 data[8];
if (esheet == ignore) continue;
len = biff_convert_text (&buf, esheet->gnum_sheet->name_quoted, wb->ver);
ms_biff_put_var_next (bp, BIFF_EXTERNSHEET);
MS_OLE_SET_GUINT8(data, len);
MS_OLE_SET_GUINT8(data + 1, 3); /* Magic */
ms_biff_put_var_write (bp, data, 2);
biff_put_text (bp, esheet->gnum_sheet->name_unquoted,
wb->ver, FALSE, AS_PER_VER);
biff_put_text (bp, buf, len, wb->ver, FALSE, AS_PER_VER);
g_free(buf);
ms_biff_put_commit (bp);
}
}
......@@ -578,7 +625,8 @@ write_names (BiffPut *bp, ExcelWorkbook *wb)
/* This code will only work for MS_BIFF_V7. */
ms_biff_put_var_write (bp, data0, 14);
biff_put_text (bp, text, wb->ver, FALSE, AS_PER_VER);
biff_put_text (bp, text, name_len, wb->ver, FALSE, AS_PER_VER);
g_free(text);
ms_biff_put_var_seekto (bp, 14 + name_len);
len = ms_excel_write_formula (bp, esheet,
expr_name->t.expr_tree, 0, 0, 0);
......@@ -599,14 +647,18 @@ write_bits (BiffPut *bp, ExcelWorkbook *wb, MsBiffVersion ver)
{
guint8 *data;
char const *team = "The Gnumeric Development Team";
gint len;
char *buf;
guint8 pad [WRITEACCESS_LEN];
/* See: S59E1A.HTM */
g_assert (strlen (team) < WRITEACCESS_LEN);
len = biff_convert_text (&buf, team, ver);
g_assert (len < WRITEACCESS_LEN);
memset (pad, ' ', sizeof pad);
ms_biff_put_var_next (bp, BIFF_WRITEACCESS);
biff_put_text (bp, team, ver, TRUE, AS_PER_VER);
ms_biff_put_var_write (bp, pad, WRITEACCESS_LEN - strlen (team) - 1);
biff_put_text (bp, buf, len, ver, TRUE, AS_PER_VER);
g_free(buf);
ms_biff_put_var_write (bp, pad, WRITEACCESS_LEN - len - 1);
ms_biff_put_commit (bp);
/* See: S59D66.HTM */
......@@ -705,7 +757,7 @@ ms_excel_write_get_sheet_idx (ExcelWorkbook *wb, Sheet *gnum_sheet)
if (esheet->gnum_sheet == gnum_sheet)
return lp;
}