}
Range getRangeIfMerged(Cell cell,
Range[] mergedRanges) {
for ( int i = 0; i < mergedRanges.length; i++ ) {
Range r = mergedRanges[i];
Cell topLeft = r.getTopLeft();
Cell bottomRight = r.getBottomRight();
if ( cell.getRow() >= topLeft.getRow() && cell.getRow() <= bottomRight.getRow() && cell.getColumn() >= topLeft.getColumn() && cell.getColumn() <= bottomRight.getColumn() ) {
return r;
}
}
return null;