}
@Test
public void testMergeExpandCellRange() {
try {
OdfSpreadsheetDocument ods = OdfSpreadsheetDocument
.newSpreadsheetDocument();
// the doc contain the table which only have one column and one row
// element
OdfTable table = ods.getTableByName("Sheet1");
int nCols = table.getColumnCount();
int nRows = table.getRowCount();
Assert.assertTrue(nCols == 1);
Assert.assertTrue(nRows == 1);
OdfTableCellRange cellRange = table.getCellRangeByPosition("A1","E1");
OdfTableCell cell = table.getCellByPosition("A1");
cell.setStringValue("Merge A1:E1");
cellRange.merge();
OdfTable table2 = OdfTable.newTable(ods, 1, 1);
table2.setTableName("Sheet2");
OdfTableCellRange cellRange2 = table2.getCellRangeByPosition("A1","F3");
OdfTableCell cell2 = table2.getCellByPosition("A1");
cell2.setStringValue("Merge A1:F3");
cellRange2.merge();
ods.save(ResourceUtilities.newTestOutputFile(filename + "MergeExpandCell.ods"));
table = ods.getTableByName("Sheet1");
Assert.assertTrue(table.getColumnCount() == 5);
Assert.assertTrue(table.getRowCount() == 1);
table = ods.getTableByName("Sheet2");
Assert.assertTrue(table.getColumnCount() == 6);
Assert.assertTrue(table.getRowCount() == 3);
OdfTextDocument odt = OdfTextDocument.newTextDocument();
OdfTable swTable = OdfTable.newTable(odt, 1, 5);
OdfTableCellRange swCellRange = swTable.getCellRangeByPosition("A1", "E2");