Commit 8bee3b3b authored by Michael Meeks's avatar Michael Meeks

cleaned some warnings from excel loader,

Fixed serious inter-sheet dependency bug ( like they were all broken ),
Prettify the last upper case struct in my Excel code,
update TODOs,
Write 'Names' documentation.
parent daeece83
1999-07-09 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_value_deps): Add warning on default:
(add_cell_range_deps): Fixup for correct inter-sheet
dependencies; massive bug.
* TODO: Updated.
* doc/C/formulas.sgml: Wrote the 'name' documentation.
1999-07-08 Michael Meeks <michael@edenproject.org>
* src/func.c (function_iterate_do_value): Fix for NULL CellRef
......
1999-07-09 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_value_deps): Add warning on default:
(add_cell_range_deps): Fixup for correct inter-sheet
dependencies; massive bug.
* TODO: Updated.
* doc/C/formulas.sgml: Wrote the 'name' documentation.
1999-07-08 Michael Meeks <michael@edenproject.org>
* src/func.c (function_iterate_do_value): Fix for NULL CellRef
......
1999-07-09 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_value_deps): Add warning on default:
(add_cell_range_deps): Fixup for correct inter-sheet
dependencies; massive bug.
* TODO: Updated.
* doc/C/formulas.sgml: Wrote the 'name' documentation.
1999-07-08 Michael Meeks <michael@edenproject.org>
* src/func.c (function_iterate_do_value): Fix for NULL CellRef
......
1999-07-09 Michael Meeks <michael@edenproject.org>
* src/eval.c (add_value_deps): Add warning on default:
(add_cell_range_deps): Fixup for correct inter-sheet
dependencies; massive bug.
* TODO: Updated.
* doc/C/formulas.sgml: Wrote the 'name' documentation.
1999-07-08 Michael Meeks <michael@edenproject.org>
* src/func.c (function_iterate_do_value): Fix for NULL CellRef
......
......@@ -11,7 +11,7 @@ Gnumeric Spread Sheet task list
* Even More Functions
GROWTH, LINEST, LOGEST, PERCENTILE, MMULT, MDETERM,
GROWTH, LINEST, LOGEST, PERCENTILE, MDETERM,
QUARTILE, TREND.
(This is not a claim that these are all.)
......@@ -32,10 +32,6 @@ Gnumeric Spread Sheet task list
* Add column/row title printing
* Add color printing support.
* Cell range naming
Finish implementing.
* Cell dimension computation is broken on font change for multilines.
* Number formatting
......@@ -105,6 +101,11 @@ Gnumeric Spread Sheet task list
Right clicking gets:
insert
** Summary Information
Load this from the Excel stream.
Make a Bonobo component to update it.
Load/Save to XML.
* Sheets
When adding a sheet or renaming a sheet, should we reparse everything?
......@@ -122,4 +123,13 @@ at *all*.
* Styles
Rewrite all cell style support, for memory efficiency and speed.
Use hashing against unique pointer -> sub-style mapping
Rewrite background pixmap handling to take 2 colours: FG & BG.
* Names
Update xml-io to read/write name tables.
* Office compatibility
Write an XML plugin to output 'Publish as Web' style XML for
Office 2000 and 'explorer' compatibility.
......@@ -5,8 +5,7 @@
spreadsheets. A formula can take almost anything as its arguments
including single numbers, cell references, ranges of cells, arrays
of cells, etc. </para>
<sect2>
<title>Syntax</title>
......@@ -69,6 +68,40 @@
=MIN(A1,A2,B6)
</programlisting>
</example>
<para>Where a function takes multiple arguments such as the
SUM example, the number of arguments effectively unlimited.</para>
</sect2>
<sect2>
<title>Names</title>
<para>Names help to simplify complex formulae. A name is assinged to
a formula which will be evaluated when it is referred to in another
formula. Names are particularly useful for labeling cell ranges.</para>
<example id="namesyntax">
<title>Examples of name usage</title>
<para>If DataBase is defined as '$A$1:$B$500' and
E_Constant is defined as 2.71828182845 then we can have:</para>
<programlisting>
=VLOOKUP (C1, "gnu", DataBase, 2, 0)
=LN(E_Constant)
=SUM(DataBase, E_Constant)
</programlisting>
</example>
<para>Names are defined using the <guimenu>Insert</guimenu>
<guimenuitem>Name</guimenuitem> dialog. This allows manipulation of
all the names in the related workbook. A name is restrained from taking
that of a function, since this would cause confusion.</para>
<para>In addition to the names you define there are built in names:</para>
<itemizedlist>
<listitem>Sheet_Title: this returns the name of the current sheet</listitem>
</itemizedlist>
</sect2>
</sect1>
......
1999-07-09 Michael Meeks <michael@edenproject.org>
* ms-excel-read.c: Major warning cleaning offensive.
* boot.c (excel_load): ditto.
* TODO: updated.
* ms-formula-read.c: s/PARSE_LIST/ParseList/
Update a few stylistic bits...
1999-07-08 Michael Meeks <michael@edenproject.org>
* ms-excel-read.c (ms_excel_read_formula): Turn error into
......
Michael
* Change all structure names ToCapitalisedLikeThisNames
* In ms-formula-write.c
* Booleans
* test if IF and CHOOSE: need 'optimising'
......@@ -11,7 +10,6 @@ Michael
* New style support so we can do
* Colours
* Fonts etc.
* Convert ms-formula-read: PARSE_LIST to ParseStack.
* Sort out biff padding =>
* Sort out better versioning scheme & helper macros.
* Rationalise Missing Argument stuff ... a new value ?
......@@ -22,6 +20,7 @@ Michael
* Use the document summary information
* Use same XML as Office for elegance (?)
* Get font / layout sizes correct for new Print-stuff.
* Investigate VB streams, and their lengths.
Jody
*
......
......@@ -41,7 +41,7 @@ excel_load (const char *filename)
if (!f)
return NULL;
printf ("Opening '%s'\n", filename);
printf ("Opening '%s' ", filename);
wb = ms_excel_read_workbook (f);
if (wb) {
char *name = g_strconcat (filename, ".gnumeric", NULL);
......
......@@ -873,9 +873,7 @@ typedef struct _BiffXFData {
StyleFormat *style_format;
eBiff_hidden hidden;
eBiff_locked locked;
eBiff_xftype xftype; /*
* -- Very important field...
*/
eBiff_xftype xftype; /* -- Very important field... */
eBiff_format format;
guint16 parentstyle;
StyleHAlignFlags halign;
......@@ -883,12 +881,8 @@ typedef struct _BiffXFData {
gboolean wrap;
guint8 rotation;
eBiff_eastern eastern;
guint8 border_color[4]; /*
* Array [StyleSide]
*/
StyleBorderType border_type[4]; /*
* Array [StyleSide]
*/
guint8 border_color[4]; /* Array [StyleSide] */
StyleBorderType border_type[4]; /* Array [StyleSide] */
eBiff_border_orientation border_orientation;
StyleBorderType border_linestyle;
guint8 fill_pattern_idx;
......@@ -2460,7 +2454,7 @@ find_workbook (MsOle *ptr)
hit |= (g_strncasecmp (d->name, "workbook", 8) == 0);
if (hit) {
MsOleStream *stream;
printf ("Found Excel Stream : %s\n", d->name);
printf (" '%s' ", d->name);
stream = ms_ole_stream_open (d, 'r');
ms_ole_directory_destroy (d);
return stream;
......@@ -2748,9 +2742,14 @@ ms_excel_read_workbook (MsOle *file)
/* printf ("SupBook : %d First sheet %d, Last sheet %d\n", BIFF_GET_GUINT16(q->data + 2 + cnt*6 + 0),
BIFF_GET_GUINT16(q->data + 2 + cnt*6 + 2), BIFF_GET_GUINT16(q->data + 2 + cnt*6 + 4)); */
}
} else {
#ifdef NO_DEBUG_EXCEL
}
#else
} else if (ms_excel_read_debug > 0) {
printf ("ExternSheet : only BIFF8 supported so far...\n");
}
#endif
break;
}
case BIFF_FORMAT: /* S59D8E.HTM */
......@@ -2773,7 +2772,7 @@ ms_excel_read_workbook (MsOle *file)
}
case BIFF_EXTERNCOUNT: /* see S59D7D.HTM */
#ifndef NO_DEBUG_EXCEL
if (ms_excel_read_debug>0) {
if (ms_excel_read_debug > 0) {
printf ("%d external references\n",
BIFF_GET_GUINT16(q->data));
}
......
......@@ -528,13 +528,13 @@ getRefV8 (guint16 row, guint16 gbitcl, int curcol, int currow,
}
typedef ExprTree PARSE_DATA;
typedef GList PARSE_LIST;
typedef GList ParseList;
static void
parse_list_push (PARSE_LIST **list, ExprTree *pd)
parse_list_push (ParseList **list, ExprTree *pd)
{
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 5){
if (ms_excel_formula_debug > 5) {
printf ("Push 0x%x\n", (int)pd);
}
#endif
......@@ -543,13 +543,13 @@ parse_list_push (PARSE_LIST **list, ExprTree *pd)
*list = g_list_append (*list, pd) ;
}
static void
parse_list_push_raw (PARSE_LIST **list, Value *v)
parse_list_push_raw (ParseList **list, Value *v)
{
parse_list_push (list, expr_tree_new_constant (v));
}
static ExprTree *
parse_list_pop (PARSE_LIST **list)
parse_list_pop (ParseList **list)
{
GList *tmp ;
PARSE_DATA *ans ;
......@@ -562,7 +562,7 @@ parse_list_pop (PARSE_LIST **list)
*list = g_list_remove_link (*list, tmp) ;
ans = tmp->data ;
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 5){
if (ms_excel_formula_debug > 5) {
printf ("Pop 0x%x\n", (int)ans);
}
#endif
......@@ -574,7 +574,7 @@ parse_list_pop (PARSE_LIST **list)
* Returns a new list composed of the last n items pop'd off the list.
**/
static GList *
parse_list_last_n (PARSE_LIST **list, gint n)
parse_list_last_n (ParseList **list, gint n)
{
GList *l=0;
while (n-->0)
......@@ -584,7 +584,7 @@ parse_list_last_n (PARSE_LIST **list, gint n)
static void
parse_list_free (PARSE_LIST **list)
parse_list_free (ParseList **list)
{
while (*list)
expr_tree_unref (parse_list_pop(list));
......@@ -638,7 +638,7 @@ unknownFunctionHandler (FunctionEvalInfo *ei, GList *expr_node_list)
}
static gboolean
make_function (PARSE_LIST **stack, int fn_idx, int numargs)
make_function (ParseList **stack, int fn_idx, int numargs)
{
Symbol *name=NULL;
......@@ -758,7 +758,7 @@ ms_excel_parse_formula (ExcelWorkbook *wb, ExcelSheet *sheet, guint8 *mem,
guint8 *cur = mem + 1 ;
int len_left = length ;
guint8 *array_data = mem + 3 + length; /* Sad but true */
PARSE_LIST *stack = NULL;
ParseList *stack = NULL;
gboolean error = FALSE ;
if (array_element != NULL)
......@@ -1044,7 +1044,7 @@ ms_excel_parse_formula (ExcelWorkbook *wb, ExcelSheet *sheet, guint8 *mem,
if (sf == NULL)
{
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 3){
if (ms_excel_formula_debug > 3) {
printf("Unknown shared formula "
"@ %s:%s\n",
(sheet->gnum_sheet
......@@ -1066,7 +1066,7 @@ ms_excel_parse_formula (ExcelWorkbook *wb, ExcelSheet *sheet, guint8 *mem,
}
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 0){
if (ms_excel_formula_debug > 0) {
printf ("Parse shared formula\n");
}
#endif
......
......@@ -166,7 +166,12 @@ add_cell_range_deps (Cell *cell, const CellRef *a, const CellRef *b)
cell_get_abs_col_row (b, col, row, &range.range.end_col, &range.range.end_row);
range.ref_count = 0;
range.sheet = cell->sheet;
if (a->sheet != b->sheet)
g_warning ("FIXME: 3D references need work");
if (a->sheet)
range.sheet = a->sheet;
else
cell->sheet;
add_cell_range_dep (cell, &range);
}
......@@ -200,6 +205,9 @@ add_value_deps (Cell *cell, const Value *value)
&value->v.cell_range.cell_a,
&value->v.cell_range.cell_b);
break;
default:
g_warning ("Unknown Value type, dependencies lost");
break;
}
}
......@@ -261,6 +269,9 @@ add_tree_deps (Cell *cell, ExprTree *tree)
/* Corner cell depends on the contents of the expr */
add_tree_deps (cell, tree->u.array.corner.func.expr);
return;
default:
g_warning ("Unknown Operation type, dependencies lost");
break;
} /* switch */
}
......
......@@ -166,7 +166,12 @@ add_cell_range_deps (Cell *cell, const CellRef *a, const CellRef *b)
cell_get_abs_col_row (b, col, row, &range.range.end_col, &range.range.end_row);
range.ref_count = 0;
range.sheet = cell->sheet;
if (a->sheet != b->sheet)
g_warning ("FIXME: 3D references need work");
if (a->sheet)
range.sheet = a->sheet;
else
cell->sheet;
add_cell_range_dep (cell, &range);
}
......@@ -200,6 +205,9 @@ add_value_deps (Cell *cell, const Value *value)
&value->v.cell_range.cell_a,
&value->v.cell_range.cell_b);
break;
default:
g_warning ("Unknown Value type, dependencies lost");
break;
}
}
......@@ -261,6 +269,9 @@ add_tree_deps (Cell *cell, ExprTree *tree)
/* Corner cell depends on the contents of the expr */
add_tree_deps (cell, tree->u.array.corner.func.expr);
return;
default:
g_warning ("Unknown Operation type, dependencies lost");
break;
} /* switch */
}
......
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