boolean hitBottom = false;
if (_cell != null) {
Format format = _cell.getFormat();
if (format != null){
BorderStyle bb = format.getBorderBottom();
if (bb != null) {
hitBottom = appendBorderStyle(sb, "bottom", bb);
}
}
}
Cell next = null;
if (!hitBottom) {
next = _sheet.getCell(_row + 1, _col);
/*if(next == null){ // don't search into merge ranges
//check is _row+1,_col in merge range
MergedRect rect = _mmHelper.getMergeRange(_row+1, _col);
if(rect !=null){
next = _sheet.getCell(rect.getTop(),rect.getLeft());
}
}*/
if (next != null) {
Format format = next.getFormat();
if (format != null){
BorderStyle bb = format.getBorderTop();// get top border of
if (bb != null) {
// set next row top border as cell's bottom border;
hitBottom = appendBorderStyle(sb, "bottom", bb);
}
}
}
}
//border depends on next cell's background color
if(!hitBottom && next !=null){
Format format = next.getFormat();
if (format != null){
String bgColor = format.getFillColor();
if (AUTO_COLOR.equals(bgColor)) {
bgColor = null;
}
if (bgColor != null && !bgColor.toUpperCase().endsWith("FFFFFF")) {
BorderStyle bb = new BorderStyleImpl(bgColor,BorderLineStyle.THIN);
hitBottom = appendBorderStyle(sb, "bottom", bb);
}
}
}
//border depends on current cell's background color
if(!hitBottom && _cell !=null){
Format format = _cell.getFormat();
if (format != null){
String bgColor = format.getFillColor();
if (AUTO_COLOR.equals(bgColor)) {
bgColor = null;
}
if (bgColor != null && !bgColor.toUpperCase().endsWith("FFFFFF")) {
BorderStyle bb = new BorderStyleImpl(bgColor,BorderLineStyle.THIN);
hitBottom = appendBorderStyle(sb, "bottom", bb);
}
}
}