aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2010-06-10 11:56:56 +0000
committerNick Burch <nick@apache.org>2010-06-10 11:56:56 +0000
commit5696c265f492dbe441dcfb7f86f62055f2ddd14a (patch)
tree33a5982442b6f815ee86bb2ccc62ee9bddf6a5b7 /src/testcases
parent6718bc0d2da72cd020f5ea40289f35f9fa5f3b1c (diff)
downloadpoi-5696c265f492dbe441dcfb7f86f62055f2ddd14a.tar.gz
poi-5696c265f492dbe441dcfb7f86f62055f2ddd14a.zip
Add more to test for bug #46664, including the last bit which is disabled pending a fuller fix
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@953290 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r--src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
index e7e503adcb..5901f53124 100644
--- a/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
+++ b/src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java
@@ -39,6 +39,7 @@ import org.apache.poi.hssf.record.Record;
import org.apache.poi.hssf.record.TabIdRecord;
import org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate;
import org.apache.poi.hssf.record.common.UnicodeString;
+import org.apache.poi.hssf.record.formula.Area3DPtg;
import org.apache.poi.hssf.record.formula.DeletedArea3DPtg;
import org.apache.poi.hssf.record.formula.Ptg;
import org.apache.poi.ss.usermodel.*;
@@ -1594,7 +1595,9 @@ public final class TestBugs extends BaseTestBugzillaIssues {
/**
* Newly created sheets need to get a
* proper TabID, otherwise print setup
- * gets confused on them.
+ * gets confused on them.
+ * Also ensure that print setup refs are
+ * by reference not value
*/
public void test46664() throws Exception {
HSSFWorkbook wb = new HSSFWorkbook();
@@ -1631,6 +1634,22 @@ public final class TestBugs extends BaseTestBugzillaIssues {
// Ensure the print setup
assertEquals("new_sheet!$A$1:$C$1", wb.getPrintArea(0));
+ assertEquals("new_sheet!$A$1:$C$1", wb.getName("Print_Area").getRefersToFormula());
+
+ // Needs reference not value
+ NameRecord nr = wb.getWorkbook().getNameRecord(
+ wb.getNameIndex("Print_Area")
+ );
+ assertEquals("Print_Area", nr.getNameText());
+ assertEquals(1, nr.getNameDefinition().length);
+ assertEquals(
+ "new_sheet!$A$1:$C$1",
+ ((Area3DPtg)nr.getNameDefinition()[0]).toFormulaString(HSSFEvaluationWorkbook.create(wb))
+ );
+ // TODO - fix me to be Reference not Value!
+if(1==2) {
+ assertEquals('R', nr.getNameDefinition()[0].getRVAType());
+}
}
/**