--- psiconv/trunk/lib/psiconv/parse_formula.c 2001/03/04 22:10:45 110 +++ psiconv/trunk/lib/psiconv/parse_formula.c 2001/07/24 20:32:51 129 @@ -390,7 +390,7 @@ int len=0; int leng; int eof = 0; - psiconv_u8 marker,submarker; + psiconv_u8 marker,submarker,submarker2; psiconv_formula_list formula_stack; psiconv_formula formula,subformula,subformula1,subformula2, subformula3,subformula4; @@ -501,11 +501,16 @@ goto ERROR8; formula->type = psiconv_formula_unknown; } else if ((formula_elements[marker].formula_type == - psiconv_formula_dat_var) || - (formula_elements[marker].formula_type == - psiconv_formula_dat_vcellblock)) { - psiconv_warn(lev+3,off+len,"Not yet supported formula mark!"); - goto ERROR8; + psiconv_formula_dat_var)) { + psiconv_progress(lev+3,off+len,"Next item: a variable reference"); + formula->data.dat_variable = psiconv_read_u32(buf,lev+2,off+len,&res); + if (res) + goto ERROR8; + formula->type = formula_elements[marker].formula_type; + len += 4; + if ((res = psiconv_list_add(formula_stack,formula))) + goto ERROR8; + formula->type = psiconv_formula_unknown; } else if (formula_elements[marker].number_of_args == -1) { psiconv_progress(lev+3,off+len,"Going to parse a vararg function"); if (!(formula->data.fun_operands = @@ -531,8 +536,20 @@ len ++; if (res) goto ERROR8; - } while (formula_elements[submarker].formula_type - == psiconv_formula_mark_opsep); + submarker2 = psiconv_read_u8(buf,lev+4,off+len,&res); + if (res) + goto ERROR8; + } while ((formula_elements[submarker].formula_type + == psiconv_formula_mark_opsep) && + (formula_elements[submarker2].formula_type + != psiconv_formula_mark_opend)); + if ((formula_elements[submarker].formula_type == + psiconv_formula_mark_opsep) && + (formula_elements[submarker2].formula_type == + psiconv_formula_mark_opend)) { + submarker=submarker2; + len++; + } if (formula_elements[submarker].formula_type != psiconv_formula_mark_opend) { psiconv_warn(lev+3,off+len,"Formula corrupted!");