aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
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.");