for (int i = 0; i < cellNames.length; i++) {
int thisRowIndex = TextTableCellNameHelper
.getRowIndex(cellNames[i]);
if (thisRowIndex != lastRowIndex) {
rangeName = rangeName + ":" + oldCellName;
TextTableCellRangeName textTableCellRangeName = new TextTableCellRangeName(
rangeName);
TextTableCellRange textTableCellRange = new TextTableCellRange(
textDocument, xCellRange.getCellRangeByName(rangeName),
textTableCellRangeName);
textTableRow[lastRowIndex] = new TextTableRow(
textTableCellRange);
rangeName = cellNames[i];
lastRowIndex = thisRowIndex;
}
oldCellName = cellNames[i];
}
rangeName = rangeName + ":" + oldCellName;
TextTableCellRangeName textTableCellRangeName = new TextTableCellRangeName(
rangeName);
TextTableCellRange textTableCellRange = new TextTableCellRange(
textDocument, xCellRange.getCellRangeByName(rangeName),
textTableCellRangeName);
textTableRow[lastRowIndex] = new TextTableRow(textTableCellRange);