diff options
author | Nick Burch <nick@apache.org> | 2014-07-25 13:59:07 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2014-07-25 13:59:07 +0000 |
commit | f19982e2455b58556e362f6c96696600b672cbe0 (patch) | |
tree | d3739c8a224a2e025b063424b75a874bc4b22b85 /src/testcases/org/apache/poi/hssf/model | |
parent | 846a1f84a2ee08a731f35f66086e04aebfaf56bf (diff) | |
download | poi-f19982e2455b58556e362f6c96696600b672cbe0.tar.gz poi-f19982e2455b58556e362f6c96696600b672cbe0.zip |
Areas can have multi-sheet references too, so add FormulaParser support to these as well
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1613437 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/hssf/model')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java index 4546de31ad..fc5dd837ab 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java +++ b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java @@ -465,6 +465,9 @@ public final class TestFormulaParser extends TestCase { HSSFCell cell = row.createCell(0); String formula = null; + + // References to a single cell: + // One sheet cell.setCellFormula("Cash_Flow!A1"); formula = cell.getCellFormula(); @@ -479,6 +482,24 @@ public final class TestFormulaParser extends TestCase { cell.setCellFormula("Cash_Flow:\'Test Sheet\'!A1"); formula = cell.getCellFormula(); assertEquals("Cash_Flow:\'Test Sheet\'!A1", formula); + + + // References to a range (area) of cells: + + // One sheet + cell.setCellFormula("Cash_Flow!A1:B2"); + formula = cell.getCellFormula(); + assertEquals("Cash_Flow!A1:B2", formula); + + // Then the other + cell.setCellFormula("\'Test Sheet\'!A1:B2"); + formula = cell.getCellFormula(); + assertEquals("\'Test Sheet\'!A1:B2", formula); + + // Now both + cell.setCellFormula("Cash_Flow:\'Test Sheet\'!A1:B2"); + formula = cell.getCellFormula(); + assertEquals("Cash_Flow:\'Test Sheet\'!A1:B2", formula); } /** |