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

Ignore the data for Attr CHOOSE that specifies which element to select. We


2005-10-12  Jody Goldberg <jody@gnome.org>

	* ms-formula-read.c (excel_parse_formula) : Ignore the data for Attr
	  CHOOSE that specifies which element to select.  We do not need it.
	* ms-excel-read.c (excel_read_FORMULA) : Use val_offset consistently
parent 3f26145c
-*-outline-*-
Gnumeric Spread Sheet task list
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The bugs are listed in a separate file -> BUGS
Optimizations, Polish and Extensions
====================================
This section lists various optimizations/extensions that can be done
to features that already work.
* Component
+ Remove the hard-coded workbook hooks from the sheet.
Initialize the hooks on the workbook_new routine.
* Cell editing
+ Colouring a parsed formula for editing.
* Functions
+ Implement more functions :
- GETPIVOTDATA.
* Data Analysis Tools
- Exponential smoothing
+ Chart output
- Histogram
+ Chart output
- Moving Average:
+ Chart output
- Regression
+ Residuals
+ Standardized Residuals
+ Residual Plots
+ Line Fit Plots
* Printing
+ Preview
- Stroke support for zoom etc.
+ Print setup:
- Options buttons
- Improve layout
+ Add the missing options to the Print Dialog
+ Display printing status (pages to go).
+ Add column/row title printing
* Font dialog
+ Create a simplistic dialog (to map to font-bold yes/no).
* Cut&Paste
+ when cuting & pasting a cell that is inside a range on another cell grow
the range of the formula if the cell is pasted in a place where it grows
it boundaries.
* Number formatting
+ TODO :
- Too much parsing is taking place when formating. We should
have set all that up beforehand when the format was parsed.
A methodology similar to that used by the regexp compiler should
be used.
* Sheet
+ Column sizes
Columns should have an "auto-grow-up-to-this-point" feature. Beyond that
size, it would truncate as it does now.
* Auditing
+ Write the sheet auditing code.
* Editing
+ Object Clipboard
If sheet->mode is OBJECT_SELECTED cut/copy/paste should operate on
the object.
+ Objects
Load / save of Bonobo objects.
* File Load/Save
+ Support for popular formats.
Miguel has specs for the XS3 format. SC should be
trivial to support as well (from the guile sources)
+ Improve handling of unknown fonts and functions when importing.
* Workbooks:
+ Consider addition of a cursor warping operation to jump between
open workbooks.
+ Notebook
- Decrease flicker when paging between sheets.
- Enable capability to select multiple sheets.
* Office compatibility
+ Write an XML plugin to output 'Publish as Web' style XML for
Office 2000 and 'explorer' compatibility.
* Parser
+ fully support R[-1]C[3] type references.
* Calculation
+ Dependancies for - CELL functions.
1.3
==========
These section lists features that are for post 1.0 versions
and are mostly just ideas or things that can't be implemented
yet (on short term) for technical reasons. Feel free to step in
and try to implement them, but remember that the things listed
under "1.0" are more important.
* Page Borders
+ These are border that should be visible on the sheet and
indicate where new pages start when printing. Jody has been
doing work on this.
* Conditional Formatting
+ Conceptual progress being made, nothing concrete yet.
* Pivot Tables (!)
+ Needs to be adopted. Look at other implementations of this
feature to get an idea what needs to be done.
* Scripting (!)
+ Needs to be adopted.
* Function Documentation
+ There is some function documentation already, but
it's incomplete.
2005-10-12 Jody Goldberg <jody@gnome.org>
* ms-formula-read.c (excel_parse_formula) : Ignore the data for Attr
CHOOSE that specifies which element to select. We do not need it.
* ms-excel-read.c (excel_read_FORMULA) : Use val_offset consistently
2005-10-10 Jody Goldberg <jody@gnome.org>
* Release 1.6.0
......
......@@ -2373,7 +2373,8 @@ excel_read_FORMULA (BiffQuery *q, ExcelReadSheet *esheet)
guint16 const row = XL_GETROW (q);
guint16 const options = GSF_LE_GET_GUINT16 (q->data + 14);
guint16 expr_length;
guint offset, val_offset;
guint offset;
guint8 const *val_dat = q->data + 6;
GnmExpr const *expr;
GnmCell *cell;
GnmValue *val = NULL;
......@@ -2397,13 +2398,14 @@ excel_read_FORMULA (BiffQuery *q, ExcelReadSheet *esheet)
*/
if (esheet_ver (esheet) >= MS_BIFF_V5) {
expr_length = GSF_LE_GET_GUINT16 (q->data + 20);
offset = 22; val_offset = 6;
offset = 22;
} else if (esheet_ver (esheet) >= MS_BIFF_V3) {
expr_length = GSF_LE_GET_GUINT16 (q->data + 16);
offset = 18; val_offset = 6;
offset = 18;
} else {
expr_length = GSF_LE_GET_GUINT8 (q->data + 16);
offset = 17; val_offset = 7;
offset = 17;
val_dat++; /* compensate for the 3 byte style */
}
if (q->length < offset) {
......@@ -2421,50 +2423,21 @@ excel_read_FORMULA (BiffQuery *q, ExcelReadSheet *esheet)
return;
}
/*
* Get the current value so that we can format, do this BEFORE handling
/* Get the current value so that we can format, do this BEFORE handling
* shared/array formulas or strings in case we need to go to the next
* record
*/
if (GSF_LE_GET_GUINT16 (q->data + 12) != 0xffff) {
double const num = gsf_le_get_double (q->data + val_offset);
val = value_new_float (num);
* record */
if (GSF_LE_GET_GUINT16 (val_dat + 6) != 0xffff) {
val = value_new_float (gsf_le_get_double (val_dat));
} else {
guint8 const val_type = GSF_LE_GET_GUINT8 (q->data + val_offset);
guint8 const val_type = GSF_LE_GET_GUINT8 (val_dat);
switch (val_type) {
case 0: /* String */
is_string = TRUE;
case 0: is_string = TRUE; break;
case 1: val = value_new_bool (GSF_LE_GET_GUINT8 (val_dat + 2) != 0);
break;
case 1: { /* Boolean */
guint8 v = GSF_LE_GET_GUINT8 (q->data + val_offset + 2);
val = value_new_bool (v ? TRUE : FALSE);
case 2: val = biff_get_error (NULL, GSF_LE_GET_GUINT8 (val_dat + 2));
break;
}
case 2: { /* Error */
guint8 const v = GSF_LE_GET_GUINT8 (q->data + val_offset + 2);
val = biff_get_error (NULL, v);
case 3: val = value_new_empty (); /* Empty (Undocumented) */
break;
}
case 3: /* Empty */
/* TODO TODO TODO
* This is undocumented and a big guess, but it seems
* accurate.
*/
d (0, {
fprintf (stderr,"%s:%s: has type 3 contents. "
"Is it an empty cell?\n",
esheet->sheet->name_unquoted,
cell_name (cell));
if (ms_excel_read_debug > 5)
gsf_mem_dump (q->data + 6, 8);
});
val = value_new_empty ();
break;
default:
fprintf (stderr,"Unknown type (%x) for cell's (%s) current val\n",
val_type, cell_name (cell));
......
......@@ -1015,28 +1015,16 @@ excel_parse_formula (MSContainer const *container,
break;
case FORMULA_PTG_ATTR : { /* FIXME: not fully implemented */
guint8 grbit = GSF_LE_GET_GUINT8(cur);
guint8 grbit = GSF_LE_GET_GUINT8 (cur);
guint16 w;
if (ver >= MS_BIFF_V3) {
w = GSF_LE_GET_GUINT16(cur+1);
w = GSF_LE_GET_GUINT16 (cur+1);
ptg_length = 3;
} else {
w = GSF_LE_GET_GUINT8(cur+1);
w = GSF_LE_GET_GUINT8 (cur+1);
ptg_length = 2;
}
if (grbit == 0x00) {
static gboolean warned_a = FALSE;
static gboolean warned_3 = FALSE;
if (w == 0xa) {
if (warned_a)
break;
warned_a = TRUE;
} else if (w == 3) {
if (warned_3)
break;
warned_3 = TRUE;
} /* else always warn */
ms_excel_dump_cellname (container->importer, esheet, fn_col, fn_row);
fprintf (stderr, "Hmm, ptgAttr of type 0 ??\n"
"I've seen a case where an instance of this with flag A and another with flag 3\n"
......@@ -1062,34 +1050,9 @@ excel_parse_formula (MSContainer const *container,
: gnm_expr_new_constant (value_new_string (""));
parse_list_push (&stack, tr);
ptg_length += w;
} else if (grbit & 0x04) { /* AttrChoose 'optimised' my foot. */
guint16 len, lp;
guint32 offset=0;
guint8 const *data=cur+3;
GnmExpr const *tr;
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 1) {
fprintf (stderr, "'Optimised' choose\n");
gsf_mem_dump (mem,length);
}
#endif
for (lp=0;lp<w;lp++) { /* w = wCases */
offset= GSF_LE_GET_GUINT16(data);
len = GSF_LE_GET_GUINT16(data+2) - offset;
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 1) {
fprintf (stderr, "Get from %d len %d [ = 0x%x ]\n",
ptg_length+offset, len,
*(cur+ptg_length+offset));
}
#endif
tr = excel_parse_formula (container, esheet, fn_col, fn_row,
cur+ptg_length+offset, len, shared, NULL);
data += 2;
parse_list_push (&stack, tr);
}
ptg_length+=GSF_LE_GET_GUINT16(data);
} else if (grbit & 0x04) { /* Optimized CHOOSE function */
/* Ignore the optimzation to specificy which arg to use */
ptg_length = 2 + GSF_LE_GET_GUINT8 (cur+1) + 1;
} else if (grbit & 0x08) { /* AttrGoto */
#ifndef NO_DEBUG_EXCEL
if (ms_excel_formula_debug > 2) {
......
Supports Markdown
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