//Workbook.currentBook=book;
if (formula==null) {
setCellType(CELL_TYPE_BLANK,false);
} else {
setCellType(CELL_TYPE_FORMULA,false);
FormulaRecordAggregate rec = (FormulaRecordAggregate) record;
rec.getFormulaRecord().setOptions(( short ) 2);
rec.getFormulaRecord().setValue(0);
//only set to default if there is no extended format index already set
if (rec.getXFIndex() == (short)0) rec.setXFIndex(( short ) 0x0f);
FormulaParser fp = new FormulaParser(formula+";",book);
fp.parse();
Ptg[] ptg = fp.getRPNPtg();
int size = 0;
//System.out.println("got Ptgs " + ptg.length);
for (int k = 0; k < ptg.length; k++) {
size += ptg[ k ].getSize();
rec.getFormulaRecord().pushExpressionToken(ptg[ k ]);
}
rec.getFormulaRecord().setExpressionLength(( short ) size);
//Workbook.currentBook = null;
}
}