break;
}
final Set<Ref> toEval = new HashSet<Ref>();
final Set<Ref> affected = new HashSet<Ref>();
final List<MergeChange> mergeChanges = new ArrayList<MergeChange>();
final ChangeInfo changeInfo = new ChangeInfo(toEval, affected, mergeChanges);
final int rowCount = srcRef.getRowCount();
final int colCount = srcRef.getColumnCount();
final int srctRow = srcRef.getTopRow();
final int srcbRow = srcRef.getBottomRow();
final int srclCol = srcRef.getLeftCol();
final int srcrCol = srcRef.getRightCol();
final int dstbRow = dstRef.getBottomRow();
final StepChunk[] stepChunks = new StepChunk[colCount];
//prepare StepChunks
for(int c = srclCol, j = 0; c <= srcrCol; ++c) {
final StepChunk stepChunk = getRowStepChunk(sheet, fillType, c, srctRow, srcbRow, true, colCount);
stepChunks[j++] = stepChunk;
}
//handle special copy only case (two consecutive same type of row)
handleSpecialCopyStep(stepChunks, rowCount, colCount);
for(int c = srclCol, j = 0; c <= srcrCol; ++c) {
final StepChunk stepChunk = stepChunks[j++];
for(int srcIndex = 0, r = srcbRow + 1; r <= dstbRow; ++r, ++srcIndex) {
final int index = srcIndex % rowCount;
final int srcrow = srctRow + index;
final Cell srcCell = BookHelper.getCell(sheet, srcrow, c);
if (srcCell == null) {
final Set<Ref>[] refs = BookHelper.removeCell(sheet, r, c);
assignRefs(toEval, affected, refs);
} else {
final ChangeInfo changeInfo0 = BookHelper.copyCell(stepChunk.getStep(index).next(srcCell), srcCell, sheet, r, c, pasteType, BookHelper.PASTEOP_NONE, false);
assignChangeInfo(toEval, affected, mergeChanges, changeInfo0);
}
}
}
final RefSheet refSheet = BookHelper.getRefSheet((Book)sheet.getWorkbook(), sheet);