Commit fd4f134a authored by Michael Meeks's avatar Michael Meeks
Browse files

Produces excel files that seem to work in StarOffice,

Excel doesn't like them though 8)
parent 256affb8
1999-05-26 Michael Meeks <michael@imaginator.com>
* ms-excel-write.c (ms_excel_write_workbook): Force Big
Block file.
(write_value): Set vesion on biff_put_text for RSTRING to V7.
1999-05-24 Michael Meeks <michael@imaginator.com>
* ole.c (main): Added 'debug' option to dump allocation.
......
1999-05-26 Michael Meeks <michael@imaginator.com>
* ms-ole.c (ms_ole_create): Set parent corectly.
(ms_ole_directory_create): Set children correctly.
1999-05-25 Michael Meeks <michael@imaginator.com>
* ms-ole.c: Really large overhaul of directory stuff, now
......
......@@ -620,6 +620,11 @@ pps_encode_tree_initial (MS_OLE *f, GList *list, PPS_IDX *p)
g_return_if_fail (list->data);
pps = list->data;
#if OLE_DEBUG > 0
printf ("encoding '%s' as %d\n", pps->name, pps->idx);
#endif
pps->idx = *p;
(*p)++;
mem = get_pps_ptr (f, pps->idx);
......@@ -654,10 +659,6 @@ pps_encode_tree_initial (MS_OLE *f, GList *list, PPS_IDX *p)
PPS_SET_PREV (mem, PPS_END_OF_CHAIN);
PPS_SET_DIR (mem, PPS_END_OF_CHAIN);
#if OLE_DEBUG > 0
printf ("encoding '%s' as %d\n", pps->name, pps->idx);
#endif
if (pps->children)
pps_encode_tree_initial (f, pps->children, p);
if (g_list_next (list))
......@@ -1131,7 +1132,8 @@ ms_ole_create (const char *name)
p->start = END_OF_CHAIN;
p->type = MS_OLE_PPS_ROOT;
p->size = 0;
p->children = 0;
p->children = NULL;
p->parent = NULL;
f->pps = g_list_append (0, p);
f->num_pps = 1;
}
......@@ -1973,10 +1975,12 @@ ms_ole_directory_create (MS_OLE_DIRECTORY *d, char *name, PPS_TYPE type)
dp = d->pps->data;
p = g_new (PPS, 1);
p->name = g_strdup (name);
p->type = type;
p->size = 0;
p->start = END_OF_CHAIN;
p->name = g_strdup (name);
p->type = type;
p->size = 0;
p->start = END_OF_CHAIN;
p->children = NULL;
p->parent = dp;
dp->children = g_list_insert_sorted (dp->children, p,
(GCompareFunc)pps_compare_func);
......@@ -1992,3 +1996,4 @@ ms_ole_directory_destroy (MS_OLE_DIRECTORY *d)
g_free (d);
}
......@@ -280,7 +280,8 @@ write_value (BIFF_PUT *bp, Value *v, eBiff_version ver, guint32 col, guint32 row
char data[16];
g_return_if_fail (v->v.str->str);
if (ver == eBiffV8); /* Use SST stuff in fulness of time */
if (ver >= eBiffV8); /* Use SST stuff in fulness of time */
/* See: S59DDC.HTM */
ms_biff_put_var_next (bp, BIFF_RSTRING);
EX_SETXF (data, xf);
......@@ -288,7 +289,7 @@ write_value (BIFF_PUT *bp, Value *v, eBiff_version ver, guint32 col, guint32 row
EX_SETROW(data, row);
EX_SETSTRLEN (data, strlen(v->v.str->str));
ms_biff_put_var_write (bp, data, 8);
biff_put_text (bp, v->v.str->str, ver, FALSE);
biff_put_text (bp, v->v.str->str, eBiffV7, FALSE);
ms_biff_put_var_commit (bp);
break;
}
......@@ -435,8 +436,14 @@ ms_excel_write_workbook (MS_OLE *file, Workbook *wb,
}
bp = ms_biff_put_new (str);
write_workbook (bp, wb, ver);
ms_biff_put_destroy (bp);
/* Kludge to make sure the file is a Big Block file */
ms_biff_put_len_next (bp, 0,0x1000);
ms_biff_put_len_commit (bp);
ms_biff_put_destroy (bp);
ms_ole_stream_close (str);
ms_ole_directory_destroy (dir);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment