Set toadd = new HashSet();
Set torem = new HashSet();
mmhelper.addMergeRange(left, top, right, bottom, toadd, torem);
for (Iterator iter = torem.iterator(); iter.hasNext();) {
MergedRect rect = (MergedRect) iter.next();
log.debug("(A)remove merge:" + rect);
updateMergeCell0(sheet, rect, "remove");
}
for (Iterator iter = toadd.iterator(); iter.hasNext();) {
MergedRect rect = (MergedRect) iter.next();
log.debug("add merge:" + rect);
updateMergeCell0(sheet, rect, "add");
}
// updateCell(sheet, left > 0 ? left - 1 : 0, top > 1 ? top - 1 : 0, right + 1, bottom + 1);
updateCell(sheet, left, top, right, bottom);