From 5630df07a4370f13233971d964185b77f154cc79 Mon Sep 17 00:00:00 2001 From: Josh Micich Date: Sun, 15 Nov 2009 09:12:30 +0000 Subject: [PATCH] Updated diagnostic code in HSSFEvaluationWorkbook - regarding changed status of IntersectionPtg git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@836344 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hssf/usermodel/HSSFEvaluationWorkbook.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationWorkbook.java index 0184d1639..824fa46d8 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationWorkbook.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationWorkbook.java @@ -127,7 +127,14 @@ public final class HSSFEvaluationWorkbook implements FormulaRenderingWorkbook, E // 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. - return HSSFFormulaParser.parse(cell.getCellFormula(), _uBook, FormulaType.CELL, _uBook.getSheetIndex(cell.getSheet())); + try { + return HSSFFormulaParser.parse(cell.getCellFormula(), _uBook, FormulaType.CELL, _uBook.getSheetIndex(cell.getSheet())); + } catch (RuntimeException 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();