mirror of https://github.com/apache/poi.git
[github-164] Fix Bug in XSSFTable.setCellReferences when table is single cell. Thanks to Travis Russell. This closes #164
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1871184 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6602cb2cfb
commit
f12a414662
|
@ -637,7 +637,7 @@ public class XSSFTable extends POIXMLDocumentPart implements Table {
|
|||
if (ref != null) {
|
||||
String[] boundaries = ref.split(":", 2);
|
||||
String from = boundaries[0];
|
||||
String to = boundaries[1];
|
||||
String to = boundaries.length == 2 ? boundaries[1] : boundaries[0];
|
||||
startCellReference = new CellReference(from);
|
||||
endCellReference = new CellReference(to);
|
||||
}
|
||||
|
|
|
@ -215,6 +215,14 @@ public final class TestXSSFTable {
|
|||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getEndCellReferenceFromSingleCellTable() throws IOException {
|
||||
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("SingleCellTable.xlsx")) {
|
||||
XSSFTable table = wb.getTable("Table3");
|
||||
assertEquals(new CellReference("A2"), table.getEndCellReference());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getNumberOfMappedColumns() throws IOException {
|
||||
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
|
||||
|
|
Loading…
Reference in New Issue