Bug 55745: fix handling of tables in XSSF if there are comments as well, add testcase which was committed to the wrong tag

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1546458 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2013-11-28 21:19:34 +00:00
parent 6618473e64
commit 5511c6dbcc

View File

@ -1210,4 +1210,22 @@ public final class TestXSSFSheet extends BaseTestSheet {
assertNotNull(sh);
assertEquals(ROW_COUNT-1, sh.getLastRowNum());
}
public static void test55745() throws Exception {
XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("55745.xlsx");
XSSFSheet sheet = wb.getSheetAt(0);
List<XSSFTable> tables = sheet.getTables();
/*System.out.println(tables.size());
for(XSSFTable table : tables) {
System.out.println("XPath: " + table.getCommonXpath());
System.out.println("Name: " + table.getName());
System.out.println("Mapped Cols: " + table.getNumerOfMappedColumns());
System.out.println("Rowcount: " + table.getRowCount());
System.out.println("End Cell: " + table.getEndCellReference());
System.out.println("Start Cell: " + table.getStartCellReference());
}*/
assertEquals("Sheet should contain 8 tables", 8, tables.size());
assertNotNull("Sheet should contain a comments table", sheet.getCommentsTable(false));
}
}