// the destination row
if (wholeRow) {
for(Iterator<Cell> cells = row.cellIterator(); cells.hasNext(); ) {
HSSFCell cell = (HSSFCell)cells.next();
row.removeCell( cell );
CellValueRecordInterface cellRecord = new HSSFCellHelper(cell).getCellValueRecord();
cellRecord.setRow( rowNum + n );
new HSSFRowHelper(row2Replace).createCellFromRecord( cellRecord );
_helper.getInternalSheet().addValueRecord( rowNum + n, cellRecord );
}
// Now zap all the cells in the source row
new HSSFRowHelper(row).removeAllCells();
} else {
final int startCol = Math.max(row.getFirstCellNum(), lCol);
final int endCol = Math.min(row.getLastCellNum(), rCol);
for(int col = startCol; col <= endCol; ++col) {
HSSFCell cell = (HSSFCell)row.getCell(col);
if (cell == null) {
continue;
}
row.removeCell( cell );
CellValueRecordInterface cellRecord = new HSSFCellHelper(cell).getCellValueRecord();
cellRecord.setRow( rowNum + n );
new HSSFRowHelper(row2Replace).createCellFromRecord( cellRecord );
_helper.getInternalSheet().addValueRecord( rowNum + n, cellRecord );
}
// Now zap the cells in the source row