mirror of https://github.com/apache/poi.git
add R1C1 test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897654 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f5a0a843ac
commit
ba7cbf4b3c
|
@ -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.");
|
||||
|
|
|
@ -1178,6 +1178,22 @@ public final class TestHSSFWorkbook extends BaseTestWorkbook {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void checkExistingFileForR1C1Refs() throws IOException {
|
||||
try (
|
||||
UnsynchronizedByteArrayOutputStream bos = new UnsynchronizedByteArrayOutputStream();
|
||||
HSSFWorkbook wb = openSampleWorkbook("49423.xls")
|
||||
) {
|
||||
assertFalse(wb.usesR1C1CellReferences());
|
||||
wb.setUseR1C1CellReferences(true);
|
||||
assertTrue(wb.usesR1C1CellReferences());
|
||||
wb.write(bos);
|
||||
try (HSSFWorkbook wb2 = new HSSFWorkbook(bos.toInputStream())) {
|
||||
assertTrue(wb2.usesR1C1CellReferences());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Disabled
|
||||
void createDrawing() {
|
||||
// the dimensions for this image are different than for XSSF and SXSSF
|
||||
|
|
Loading…
Reference in New Issue