aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2022-02-01 12:15:16 +0000
committerPJ Fanning <fanningpj@apache.org>2022-02-01 12:15:16 +0000
commitba7cbf4b3c0c80753aea8b5909d5166c742e9ef1 (patch)
treea46e675678ca5664dce96445ee71bd7ddfbd82e8 /poi-ooxml
parentf5a0a843ac965a23bd8407ba9c97209a8e933cae (diff)
downloadpoi-ba7cbf4b3c0c80753aea8b5909d5166c742e9ef1.tar.gz
poi-ba7cbf4b3c0c80753aea8b5909d5166c742e9ef1.zip
add R1C1 test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897654 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
index 0846f9499a..1087a4327e 100644
--- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
+++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
@@ -1341,6 +1341,22 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
}
+ @Test
+ void checkExistingFileForR1C1Refs() throws IOException {
+ try (
+ UnsynchronizedByteArrayOutputStream bos = new UnsynchronizedByteArrayOutputStream();
+ XSSFWorkbook wb = openSampleWorkbook("WithTable.xlsx")
+ ) {
+ assertFalse(wb.usesR1C1CellReferences());
+ wb.setUseR1C1CellReferences(true);
+ assertTrue(wb.usesR1C1CellReferences());
+ wb.write(bos);
+ try (XSSFWorkbook wb2 = new XSSFWorkbook(bos.toInputStream())) {
+ assertTrue(wb2.usesR1C1CellReferences());
+ }
+ }
+ }
+
private static void expectFormattedContent(Cell cell, String value) {
assertEquals(value, new DataFormatter().formatCellValue(cell),
"Cell " + ref(cell) + " has wrong formatted content.");