return c;
}
public MergeBlock addMergeBlock(int startRow, int startColumn, int endRow,
int endColumn) {
MergeBlock merge = MergeBlockImpl.createEmpty();
if (startRow == endRow && startColumn == endColumn) {
// This is a single cell.
return merge;
}
ArrayList<MergeBlock> removes = new ArrayList<MergeBlock>();
MergeBlock mbNew = MergeBlockImpl.create(startRow,
startColumn,
endRow,
endColumn);
Iterator<MergeBlock> itr = merges.iterator();
while (itr.hasNext()) {
merge = itr.next();
if (mbNew.cross(merge)) {
if (mbNew.equals(merge)) {
// if already a same merge block exists.
return merge;
} else if (mbNew.include(merge)) {
// if already an overlapped merge block exists, we
// should remove it.
removes.add(merge);
itr.remove();
} else {