@Override public Ptg[] getFormulaTokens(EvaluationCell evalCell) { HSSFCell cell = ((HSSFEvaluationCell)evalCell).getHSSFCell(); // re-parsing the formula text also works, but is a waste of time // return HSSFFormulaParser.parse(cell.getCellFormula(), _uBook, FormulaType.CELL, _uBook.getSheetIndex(cell.getSheet())); // It is useful within the tests to make sure that all formulas POI can evaluate can also be parsed. // see HSSFFileHandler.handleFile instead FormulaRecordAggregate fra = (FormulaRecordAggregate) cell.getCellValueRecord(); return fra.getFormulaTokens(); }
@Override public Ptg[] getFormulaTokens(EvaluationCell evalCell) { HSSFCell cell = ((HSSFEvaluationCell)evalCell).getHSSFCell(); // re-parsing the formula text also works, but is a waste of time // return HSSFFormulaParser.parse(cell.getCellFormula(), _uBook, FormulaType.CELL, _uBook.getSheetIndex(cell.getSheet())); // It is useful within the tests to make sure that all formulas POI can evaluate can also be parsed. // see HSSFFileHandler.handleFile instead FormulaRecordAggregate fra = (FormulaRecordAggregate) cell.getCellValueRecord(); return fra.getFormulaTokens(); }
public Ptg[] getFormulaTokens(EvaluationCell evalCell) { HSSFCell cell = ((HSSFEvaluationCell)evalCell).getHSSFCell(); if (false) { // re-parsing the formula text also works, but is a waste of time // It is useful from time to time to run all unit tests with this code // to make sure that all formulas POI can evaluate can also be parsed. try { return HSSFFormulaParser.parse(cell.getCellFormula(), _uBook, FormulaType.CELL, _uBook.getSheetIndex(cell.getSheet())); } catch (FormulaParseException e) { // Note - as of Bugzilla 48036 (svn r828244, r828247) POI is capable of evaluating // IntesectionPtg. However it is still not capable of parsing it. // So FormulaEvalTestData.xls now contains a few formulas that produce errors here. logger.log( POILogger.ERROR, e.getMessage()); } } FormulaRecordAggregate fra = (FormulaRecordAggregate) cell.getCellValueRecord(); return fra.getFormulaTokens(); } public UDFFinder getUDFFinder(){
public Ptg[] getFormulaTokens(EvaluationCell evalCell) { HSSFCell cell = ((HSSFEvaluationCell)evalCell).getHSSFCell(); if (false) { // re-parsing the formula text also works, but is a waste of time // It is useful from time to time to run all unit tests with this code // to make sure that all formulas POI can evaluate can also be parsed. try { return HSSFFormulaParser.parse(cell.getCellFormula(), _uBook, FormulaType.CELL, _uBook.getSheetIndex(cell.getSheet())); } catch (FormulaParseException e) { // Note - as of Bugzilla 48036 (svn r828244, r828247) POI is capable of evaluating // IntesectionPtg. However it is still not capable of parsing it. // So FormulaEvalTestData.xls now contains a few formulas that produce errors here. System.err.println(e.getMessage()); } } FormulaRecordAggregate fra = (FormulaRecordAggregate) cell.getCellValueRecord(); return fra.getFormulaTokens(); } public UDFFinder getUDFFinder(){