* @author Markus Kr�ger
*/
private void addRowsProperty(int count,
ITextTableCellRange textTableCellRangeClone) throws TextException {
try {
ITextTable textTableLast = textTableManagement.getLastTextTable();
int singleTableRowCount = textTableLast.getRowCount();
if ((singleTableRowCount + count) * columnCount <= ITextTable.MAX_CELLS_IN_TABLE) {
textTableLast.addRow(count);
} else {
ITextTableCellRange textTableCellRangeHeaderClone = textTableLast
.getCellRange(0, 0, columnCount - 1, 0);
int helpRows = maxRowsInTable - singleTableRowCount;
if (helpRows > 0) {
textTableLast.addRow(helpRows);
}
int helpCount = count - helpRows;
while (helpCount > 0) {
int insert = helpCount;
TextTablePropertyStore tablePropertyStore = new TextTablePropertyStore(
textTableManagement.getFirstTextTable());
if (tablePropertyStore.repeatHeadline()) {
insert = insert + 1;
}
if (helpCount * columnCount > ITextTable.MAX_CELLS_IN_TABLE) {
insert = maxRowsInTable;
}
ITextTable textTable = textDocument.getTextTableService()
.constructTextTable(1, columnCount);
ITextTableProperties properties = textTable.getProperties();
properties.setRepeatHeadline(tablePropertyStore
.repeatHeadline());
textDocument.getTextService().getTextContentService()
.insertTextContentAfter(textTable, textTableLast);
properties.setTableColumnSeparators(tablePropertyStore
.getTableColumnSeparators());
IDestinationPosition destinationPosition = new DestinationPosition(
textTable.getCell("A1"));
if (tablePropertyStore.repeatHeadline()) {
textTableCellRangeHeaderClone.getCloneService()
.cloneToPositionNoReturn(destinationPosition,
null);
destinationPosition = new DestinationPosition(textTable
.getCell("A2"));
textTableCellRangeClone.getCloneService()
.cloneToPositionNoReturn(destinationPosition,
false, null);
} else {
textTableCellRangeClone.getCloneService()
.cloneToPositionNoReturn(destinationPosition,
false, null);
}
textTable.addRow(insert - 1);
textTableManagement.addTextTable(textTable);
helpCount = helpCount - insert;
}
}
} catch (Exception exception) {