Commit e383ef00 authored by Michael Meeks's avatar Michael Meeks

excel README, begginings of embedded Objects, various comments added.

parent 0d613baf
1999-04-12 Michael Meeks <michael@imaginator.com>
* TODO: Removed basic functions section, most are done.
1999-04-11 Michael Meeks <michael@imaginator.com>
* src/dialog-function-select.c (function_select_row):
......
1999-04-12 Michael Meeks <michael@imaginator.com>
* TODO: Removed basic functions section, most are done.
1999-04-11 Michael Meeks <michael@imaginator.com>
* src/dialog-function-select.c (function_select_row):
......
1999-04-12 Michael Meeks <michael@imaginator.com>
* TODO: Removed basic functions section, most are done.
1999-04-11 Michael Meeks <michael@imaginator.com>
* src/dialog-function-select.c (function_select_row):
......
1999-04-12 Michael Meeks <michael@imaginator.com>
* TODO: Removed basic functions section, most are done.
1999-04-11 Michael Meeks <michael@imaginator.com>
* src/dialog-function-select.c (function_select_row):
......
......@@ -86,10 +86,6 @@ GNOME Spread Sheet task list
It does not shrink.
* Basic functions
V/H LOOKUP, UPPER, LOWER
* Excel importing
BIFF_NOTE ( comments ) importing.
......
1999-04-12 Michael Meeks <michael@imaginator.com>
* ms-obj.c: Created to deal with the horrors of embedded graphic
objects !
* ms-obj.h: Include for the same
* ms-excel.c: Include ms-obj.h
(ms_excel_read_sheet): Add call to ms_obj_read_graphic.
* biff-types.h: Update comments.
* Makefile.am: Add new files.
* ole.c: Nice header.
1999-04-12 Michael Meeks <michael@imaginator.com>
* biff-types.h: Fleshed out.
......
......@@ -16,6 +16,8 @@ libexcel_a_SOURCES = \
ms-excel.h \
ms-formula.c \
ms-formula.h \
ms-obj.c \
ms-obj.h \
ms-ole.c \
ms-ole.h
......
The Excel code is not actually a plugin, despite its position in the
plugins directory. This is for ease of debugging at least initialy.
Simply select an excel file and watch those bits go flying.
For information on the Excel file format simply see:
http://www.microsoft.com/msdn
OR mail me, ( you don't want to use that 'J++' applet ).
The 'ole' helper program is designed to let you inspect the contents of
OLE2 files. It has a complicated syntax, as described in the help you get
when you just run it.
Try for starters:
./ole somefile.xls biff workbook
You _must_ be in the plugins/excel directory for it to find the biff_types.h
which it uses to annotate the biff records nicely; patches welcome.
1999-04-12 Michael Meeks <michael@imaginator.com>
/**
* biff-types.h: A long and dull list of BIFF types.
*
* Author:
* Michael Meeks (michael@imaginator.com)
**/
/**
* See S59D52.HTM for the spec.
* As you add low numbers, check you don't glup an odd-ball
......@@ -41,6 +47,7 @@
#define BIFF_XF 0xe0
#define BIFF_MS_O_DRAWING_GROUP 0xeb
#define BIFF_MS_O_DRAWING 0xec
#define BIFF_MS_O_DRAWING_SELECTION 0xed
#define BIFF_SST 0xfc
#define BIFF_LABELSST 0xfd
#define BIFF_EXTSST 0xff
......
......@@ -30,6 +30,7 @@
#include "ms-formula.h"
#include "ms-excel.h"
#include "ms-excel-biff.h"
#include "ms-obj.h"
#define EXCEL_DEBUG 0
......@@ -1855,6 +1856,9 @@ ms_excel_read_sheet (MS_EXCEL_SHEET *sheet, BIFF_QUERY * q, MS_EXCEL_WORKBOOK *
}
return;
break;
case BIFF_OBJ: /* See: ms-obj.c and S59DAD.HTM */
ms_obj_read_graphic (sheet, q);
break;
case BIFF_SELECTION: /* S59DE2.HTM */
{
int pane_number ;
......
......@@ -30,6 +30,7 @@
#include "ms-formula.h"
#include "ms-excel.h"
#include "ms-excel-biff.h"
#include "ms-obj.h"
#define EXCEL_DEBUG 0
......@@ -1855,6 +1856,9 @@ ms_excel_read_sheet (MS_EXCEL_SHEET *sheet, BIFF_QUERY * q, MS_EXCEL_WORKBOOK *
}
return;
break;
case BIFF_OBJ: /* See: ms-obj.c and S59DAD.HTM */
ms_obj_read_graphic (sheet, q);
break;
case BIFF_SELECTION: /* S59DE2.HTM */
{
int pane_number ;
......
/**
* ms-obj.c: MS Excel Object support for Gnumeric
*
* Author:
* Michael Meeks (michael@imaginator.com)
**/
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <assert.h>
#include <config.h>
#include <stdio.h>
#include <ctype.h>
#include <gnome.h>
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "gnome-xml/tree.h"
#include "gnome-xml/parser.h"
#include "gnumeric-sheet.h"
#include "format.h"
#include "color.h"
#include "sheet-object.h"
#include "style.h"
#include "ms-ole.h"
#include "ms-biff.h"
#include "ms-excel.h"
#include "ms-excel-biff.h"
#include "ms-obj.h"
/* Confusingly this micro-biff will use the offsets
as specified in the docs */
#define GR_BIFF_LENGTH(p) (BIFF_GETWORD(p+2))
#define GR_BIFF_OPCODE(p) (BIFF_GETWORD(p))
#define GR_END 0x00
#define GR_MACRO 0x04
#define GR_CLIPBOARD_FORMAT 0x07
#define GR_PICTURE_OPTIONS 0x08
#define GR_PICTURE_FORMULA 0x09
#define GR_COMMON_OBJ_DATA 0x15
static char *
object_type_names[] =
{
"Group", /* 0x00 */
"Line",
"Rectangle",
"Oval",
"Arc",
"Chart",
"Text",
"Button",
"Picture",
"Polygon",
NULL,
"Check",
"Option",
"Edit",
"Label",
"Dialog",
"Spinner",
"Scroll",
"List",
"Group",
"Combo",
NULL,
NULL,
NULL,
NULL,
"Comment",
NULL,
NULL,
NULL,
NULL,
"MS Drawing"
};
void
ms_obj_read_graphic (MS_EXCEL_SHEET *sheet, BIFF_QUERY *q)
{
guint8 *data;
gint32 data_len_left;
int hit_end;
g_return_if_fail (q);
g_return_if_fail (sheet);
g_return_if_fail (q->ls_op==BIFF_OBJ);
/* printf ("Graphic object\n");
dump (q->data, q->length); */
data = q->data;
data_len_left = q->length;
/* Scan through the pseudo BIFF substream */
for(hit_end=0;data_len_left > 0 && !hit_end;) {
switch (GR_BIFF_OPCODE(data)) {
case GR_END:
hit_end=1;
break;
case GR_CLIPBOARD_FORMAT:
break;
case GR_PICTURE_OPTIONS:
break;
case GR_PICTURE_FORMULA:
break;
case GR_COMMON_OBJ_DATA:
{
guint16 len=BIFF_GETWORD(data+2);
guint16 obj_type=BIFF_GETWORD(data+4);
guint16 obj_id =BIFF_GETWORD(data+6);
guint16 options =BIFF_GETWORD(data+8);
char *type;
enum { Locked=0x1, Printable=0x2,
AutoFill=0x4, AutoLine=0x8 } flags;
printf ("Common object data len 0x%x "
"Type 0x%x id 0x%x options 0x%x\n",
len, obj_type, obj_id, options);
flags=0;
if (options&0x0001)
flags|=Locked;
if (options&0x0010)
flags|=Printable;
if (options&0x2000)
flags|=AutoFill;
if (options&0x4000)
flags|=AutoLine;
if (options&0x9fee)
printf ("FIXME: Error in common object flags\n");
if (obj_type<sizeof(object_type_names)/sizeof(char*))
type =object_type_names[obj_type];
if (type)
printf ("Object '%s'\n", type);
else
printf ("Unknown object type\n");
break;
}
default:
printf ("Unknown GR subop 0x%x len 0x%x dll %d\n",
GR_BIFF_OPCODE(data),
GR_BIFF_LENGTH(data), data_len_left);
break;
}
data +=GR_BIFF_LENGTH(data)+4;
data_len_left-=GR_BIFF_LENGTH(data)+4;
}
}
/**
* ms-obj.h: MS Excel Graphic Object support for Gnumeric
*
* Author:
* Michael Meeks (michael@imaginator.com)
**/
#ifndef GNUMERIC_MS_OBJ_H
#define GNUMERIC_MS_OBJ_H
void ms_obj_read_graphic (MS_EXCEL_SHEET *sheet, BIFF_QUERY *q);
#endif
/**
* ole.c: OLE2 file format helper program,
* good for dumping OLE streams, and
* corresponding biff records, and hopefuly
* some more ...
*
* Author:
* Michael Meeks (michael@imaginator.com)
**/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
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