diff options
author | Dominik Stadler <centic@apache.org> | 2017-09-19 19:02:22 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2017-09-19 19:02:22 +0000 |
commit | 46fd75b1e70c0b8e36a9193cfd68c7f21ee5e76e (patch) | |
tree | d88abe7d1300855edf0d0c8247790c893a7413c9 /src/ooxml/java/org | |
parent | f3b10d5703bbb7c22b64673dcf3179279272cd57 (diff) | |
download | poi-46fd75b1e70c0b8e36a9193cfd68c7f21ee5e76e.tar.gz poi-46fd75b1e70c0b8e36a9193cfd68c7f21ee5e76e.zip |
Bug 61148: Fix calculating formula value, unfortunately we currently need to set the value twice
Also rework related tests to run more of the tests for HSSF, XSSF and SXSSF
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1808929 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org')
3 files changed, 21 insertions, 13 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java index 85980817e2..088694054b 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFFormulaEvaluator.java @@ -58,7 +58,17 @@ public final class SXSSFFormulaEvaluator extends BaseXSSFFormulaEvaluator { public static SXSSFFormulaEvaluator create(SXSSFWorkbook workbook, IStabilityClassifier stabilityClassifier, UDFFinder udfFinder) { return new SXSSFFormulaEvaluator(workbook, stabilityClassifier, udfFinder); } - + public void notifySetFormula(Cell cell) { + _bookEvaluator.notifyUpdateCell(new SXSSFEvaluationCell((SXSSFCell)cell)); + } + public void notifyDeleteCell(Cell cell) { + _bookEvaluator.notifyDeleteCell(new SXSSFEvaluationCell((SXSSFCell)cell)); + } + public void notifyUpdateCell(Cell cell) { + _bookEvaluator.notifyUpdateCell(new SXSSFEvaluationCell((SXSSFCell)cell)); + } + + /** * Turns a SXSSFCell into a SXSSFEvaluationCell */ diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java index 81b61c625e..adb951d77a 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/BaseXSSFFormulaEvaluator.java @@ -41,16 +41,6 @@ public abstract class BaseXSSFFormulaEvaluator extends BaseFormulaEvaluator { return new XSSFRichTextString(str); } - public void notifySetFormula(Cell cell) { - _bookEvaluator.notifyUpdateCell(new XSSFEvaluationCell((XSSFCell)cell)); - } - public void notifyDeleteCell(Cell cell) { - _bookEvaluator.notifyDeleteCell(new XSSFEvaluationCell((XSSFCell)cell)); - } - public void notifyUpdateCell(Cell cell) { - _bookEvaluator.notifyUpdateCell(new XSSFEvaluationCell((XSSFCell)cell)); - } - /** * Turns a XSSFCell / SXSSFCell into a XSSFEvaluationCell */ diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java index e135b61e65..017056debb 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java @@ -23,8 +23,6 @@ import org.apache.poi.ss.formula.IStabilityClassifier; import org.apache.poi.ss.formula.WorkbookEvaluator; import org.apache.poi.ss.formula.udf.UDFFinder; import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.CellType; -import org.apache.poi.ss.usermodel.CellValue; /** * Evaluates formula cells.<p> @@ -57,6 +55,16 @@ public final class XSSFFormulaEvaluator extends BaseXSSFFormulaEvaluator { return new XSSFFormulaEvaluator(workbook, stabilityClassifier, udfFinder); } + public void notifySetFormula(Cell cell) { + _bookEvaluator.notifyUpdateCell(new XSSFEvaluationCell((XSSFCell)cell)); + } + public void notifyDeleteCell(Cell cell) { + _bookEvaluator.notifyDeleteCell(new XSSFEvaluationCell((XSSFCell)cell)); + } + public void notifyUpdateCell(Cell cell) { + _bookEvaluator.notifyUpdateCell(new XSSFEvaluationCell((XSSFCell)cell)); + } + /** * Loops over all cells in all sheets of the supplied * workbook. |