--- psiconv/trunk/lib/psiconv/parse_sheet.c 2001/01/22 20:36:50 97 +++ psiconv/trunk/lib/psiconv/parse_sheet.c 2001/01/29 21:57:05 98 @@ -239,8 +239,8 @@ len += 4; psiconv_progress(lev+2,off+len,"Going to read the formulas list"); - if ((res = psiconv_parse_sheet_formula_list(buf,lev+2,formulas_off,NULL, - &(*result)->formulas))) + if ((res = psiconv_parse_sheet_formula_table(buf,lev+2,formulas_off,NULL, + &(*result)->formulas))) goto ERROR2; @@ -263,52 +263,19 @@ return res; } -int psiconv_parse_sheet_formula(const psiconv_buffer buf, int lev, - psiconv_u32 off, int *length, - psiconv_sheet_formula *result) -{ - int res=0; - int len=0; - // int leng; - - psiconv_progress(lev+1,off,"Going to read a sheet formula"); - if (!(*result = malloc(sizeof(**result)))) - goto ERROR1; - - psiconv_progress(lev+2,off+len,"COP OUT: DOING NOTHING..."); - - if (length) - *length = len; - - psiconv_progress(lev,off+len-1, - "End of the sheet formula (total length: %08x)", len); - return 0; - -// ERROR2: - free(*result); -ERROR1: - psiconv_warn(lev+1,off,"Reading of Sheet Formula failed"); - if (length) - *length = 0; - if (!res) - return -PSICONV_E_NOMEM; - else - return res; -} - -int psiconv_parse_sheet_formula_list(const psiconv_buffer buf, int lev, - psiconv_u32 off, int *length, - psiconv_sheet_formula_list *result) +int psiconv_parse_sheet_formula_table(const psiconv_buffer buf, int lev, + psiconv_u32 off, int *length, + psiconv_formula_list *result) { int res=0; int len=0; psiconv_u32 temp; - psiconv_sheet_formula formula; + psiconv_formula formula; psiconv_u32 listlen,i; int leng; psiconv_progress(lev+1,off,"Going to read the sheet formula table"); - if (!(*result = psiconv_list_new(sizeof(struct psiconv_sheet_formula_s)))) + if (!(*result = psiconv_list_new(sizeof(struct psiconv_formula_s)))) goto ERROR1; psiconv_progress(lev+2,off+len, @@ -334,7 +301,7 @@ psiconv_progress(lev+2,off+len,"Going to read all formulas"); for (i = 0; i < listlen; i++) { psiconv_progress(lev+3,off+len,"Going to read formula %d",i); - if ((res = psiconv_parse_sheet_formula(buf,lev+3,off+len,&leng,&formula))) + if ((res = psiconv_parse_formula(buf,lev+3,off+len,&leng,&formula))) goto ERROR2; if ((res = psiconv_list_add(*result,formula))) goto ERROR3; @@ -349,7 +316,7 @@ return 0; ERROR3: - psiconv_free_sheet_formula(formula); + psiconv_free_formula(formula); ERROR2: psiconv_list_free(*result); ERROR1: