Commit cf78e212 authored by Michael Meeks's avatar Michael Meeks

Ameliorated overoptimistic CHANGES entry, and banged on with magic numbers.

parent 45855baa
......@@ -21,7 +21,8 @@ Miguel
Michael
* Re-wrote the OLE block layer again...
* Tentative alpha Excel sheet writing
- Only Excel 95 tested
- StarOffice is only tested importer
- Only Excel 95 likely to work
- only basic numbers and text are stored.
* Fix writing code to preserve sheet order.
......
1999-06-01 Michael Meeks <michael@edenproject.org>
* ms-excel-write.c (write_sheet_bools): Added yet more
magic numbers.
* boot.c (excel_init): Put Excel 95 on by default.
* ms-excel-write.c (write_bits): Added WINDOW1 bit.
......
1999-06-01 Michael Meeks <michael@edenproject.org>
* ms-ole.c (pps_decode_tree): Added debug in case of
currupted directory.
(read_pps): Added check to make duff files fail on
probe.
(write_bb): Embarassing bug with block directories fixed.
1999-05-26 Michael Meeks <michael@imaginator.com>
* ms-ole.c (ms_ole_create): Set parent corectly.
......
......@@ -415,8 +415,9 @@ write_bb (MS_OLE *f)
g_return_val_if_fail (f->mem, 0);
g_return_val_if_fail (f->bb, 0);
numbbd = (f->bb->len + (BB_BLOCK_SIZE*BB_BLOCK_SIZE/4) - 1) /
((BB_BLOCK_SIZE*BB_BLOCK_SIZE/4) - 1); /* Think carefully ! */
numbbd = f->bb->len/(BB_BLOCK_SIZE/4);
if (f->bb->len%(BB_BLOCK_SIZE/4))
numbbd++;
SET_NUM_BBD_BLOCKS (f, numbbd);
for (lp=0;lp<numbbd;lp++) {
......@@ -433,7 +434,9 @@ write_bb (MS_OLE *f)
lpblk++;
}
while (lpblk%(BB_BLOCK_SIZE/4) != 0) { /* Undescribed blocks */
guint8 *mem = BBPTR(f, GET_BBD_LIST(f, lpblk/(BB_BLOCK_SIZE/4)));
guint8 *mem;
g_assert (lpblk/(BB_BLOCK_SIZE/4) < numbbd);
mem = BBPTR(f, GET_BBD_LIST(f, lpblk/(BB_BLOCK_SIZE/4)));
SET_GUINT32 (mem + (lpblk%(BB_BLOCK_SIZE/4))*4,
UNUSED_BLOCK);
lpblk++;
......@@ -524,6 +527,11 @@ pps_decode_tree (MS_OLE *f, PPS_IDX p, PPS *parent)
pps = g_new (PPS, 1);
mem = get_pps_ptr (f, p);
if (!mem) {
printf ("Serious directory error %d\n", p);
f->pps = NULL;
return;
}
pps->name = pps_get_text (mem, PPS_GET_NAME_LEN(mem));
pps->type = PPS_GET_TYPE (mem);
pps->size = PPS_GET_SIZE (mem);
......@@ -580,7 +588,7 @@ read_pps (MS_OLE *f)
f->num_pps = 0;
pps_decode_tree (f, PPS_ROOT_INDEX, NULL);
if (g_list_length (f->pps) < 1 ||
if (!f->pps || g_list_length (f->pps) < 1 ||
g_list_length (f->pps) > 1) {
printf ("Invalid root chain\n");
return 0;
......
......@@ -764,6 +764,69 @@ write_sheet_bools (BIFF_PUT *bp, eBiff_version ver)
BIFF_SET_GUINT32 (data, 0x0);
BIFF_SET_GUINT32 (data+4, 0x0);
ms_biff_put_commit (bp);
/* See: S59D72.HTM */
data = ms_biff_put_len_next (bp, BIFF_DEFAULTROWHEIGHT, 4);
BIFF_SET_GUINT32 (data, 0x00ff0000);
ms_biff_put_commit (bp);
/* See: S59D6B.HTM */
data = ms_biff_put_len_next (bp, BIFF_COUNTRY, 4);
BIFF_SET_GUINT32 (data, 0x00010001); /* Made in the USA */
ms_biff_put_commit (bp);
/* See: S59E1C.HTM */
data = ms_biff_put_len_next (bp, BIFF_WSBOOL, 2);
BIFF_SET_GUINT16 (data, 0x04c1);
ms_biff_put_commit (bp);
/* See: S59D94.HTM */
ms_biff_put_var_next (bp, BIFF_HEADER);
biff_put_text (bp, "&A", eBiffV7, TRUE);
ms_biff_put_commit (bp);
/* See: S59D8D.HTM */
ms_biff_put_var_next (bp, BIFF_FOOTER);
biff_put_text (bp, "&P", eBiffV7, TRUE);
ms_biff_put_commit (bp);
/* See: S59D93.HTM */
data = ms_biff_put_len_next (bp, BIFF_HCENTER, 2);
BIFF_SET_GUINT16 (data, 0x0000);
ms_biff_put_commit (bp);
/* See: S59E15.HTM */
data = ms_biff_put_len_next (bp, BIFF_VCENTER, 2);
BIFF_SET_GUINT16 (data, 0x0000);
ms_biff_put_commit (bp);
/* See: S59DE3.HTM */
data = ms_biff_put_len_next (bp, BIFF_SETUP, 34);
BIFF_SET_GUINT32 (data + 0, 0x00310000);
BIFF_SET_GUINT32 (data + 4, 0x00010001);
BIFF_SET_GUINT32 (data + 8, 0x00440001);
BIFF_SET_GUINT32 (data + 12, 0x676e7572);
BIFF_SET_GUINT32 (data + 16, 0x82b08dc1);
BIFF_SET_GUINT32 (data + 20, 0x3fe060c1);
BIFF_SET_GUINT32 (data + 24, 0x82b08dc1);
BIFF_SET_GUINT32 (data + 28, 0x3fe060c1);
BIFF_SET_GUINT16 (data + 32, 0x00f0);
ms_biff_put_commit (bp);
/* To Do */
/*
DEFCOLWIDTH
COLINFO
DIMENSIONS
ROW
Then the cells
WINDOW2
SELECTION
*/
}
static void
......
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