]> source.dussan.org Git - poi.git/commit
#62834 FormulaEvaluator.evaluateInCell() throws Exception
authorGreg Woolsey <gwoolsey@apache.org>
Fri, 19 Oct 2018 01:11:47 +0000 (01:11 +0000)
committerGreg Woolsey <gwoolsey@apache.org>
Fri, 19 Oct 2018 01:11:47 +0000 (01:11 +0000)
commitd24b4492f00532b467416d57b1d11fc5013f7714
treeee4770e7dfed4778cf67704be9097d6acf3d38a0
parentc7111f562c8df49005cf209ee03f695fcbb9111d
#62834 FormulaEvaluator.evaluateInCell() throws Exception

added cell type = formula check when looping through the shared formula range, to ignore any non-formula cells.

Also refactored a bit to enable passing in the evaluation context, as getCellFormula() uses it behind the scenes when evaluating a shared formula cell (has to shift the formula references based on the master cell).  Review of these changes is welcome, as always.

Checked all other code referencing the "SHARED" enum, and didn't see anything else that dealt with formula cell values and thus would need to notice non-formula cells.

Added unit test based on the failing file from Bugzilla.  Test failed until the fixed code was in place.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1844295 13f79535-47bb-0310-9956-ffa450edef68
src/java/org/apache/poi/ss/formula/BaseFormulaEvaluator.java
src/java/org/apache/poi/ss/usermodel/Sheet.java
src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCell.java
src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
test-data/spreadsheet/62834.xlsx [new file with mode: 0644]