]> 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)
commit6b433ae8b34b8c32a0457d74fe3b023222fe7945
treeee4770e7dfed4778cf67704be9097d6acf3d38a0
parent8bf556e856f4e77dee51af448e159b0df44fbc5a
#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]