From ce5eccd8f5d59a7e249d3f8d5836988827fa6074 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Fri, 10 Jun 2016 16:36:59 +0000 Subject: [PATCH] bug 57721: add unit test for evaluating all formulas in a workbook containing structured reference formulas; patch from gruber.chri@gmx.at git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1747740 13f79535-47bb-0310-9956-ffa450edef68 --- .../usermodel/TestXSSFFormulaEvaluation.java | 10 ++++++++++ ...formula_with_structured_table_references.xlsx | Bin 0 -> 9198 bytes 2 files changed, 10 insertions(+) create mode 100644 test-data/spreadsheet/evaluate_formula_with_structured_table_references.xlsx diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java index 42f93af4f..a6d5bdb96 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java @@ -606,6 +606,16 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator { wb.close(); } + // bug 57721 + @Test + public void structuredReferences() throws IOException { + XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("evaluate_formula_with_structured_table_references.xlsx"); + + XSSFFormulaEvaluator.evaluateAllFormulaCells(wb); + + wb.close(); + } + /** * @param row 0-based * @param column 0-based diff --git a/test-data/spreadsheet/evaluate_formula_with_structured_table_references.xlsx b/test-data/spreadsheet/evaluate_formula_with_structured_table_references.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..a4f9caad348cb111eb258c43b5f52a482a234624 GIT binary patch literal 9198 zcmeHtg*!3pjbT!Op1{U+Jnn_V{F z_Yd6L&r{RWQ+>`~>013YTf5(6E3KT2J$hET~HBuare0)2S90ny~JdXku z&Kh(CRoS7LlP7`sPXFfO^K<|jJ!sgaXrj~O;A`pP`+AT}t)J)2w0GDs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