private boolean processBottomBorder(StringBuffer sb) {
boolean hitBottom = false;
if (_cell != null) {
CellStyle style = _cell.getCellStyle();
if (style != null){
int bb = style.getBorderBottom();
//String color = BookHelper.indexToRGB(_book, style.getBottomBorderColor());
String color = BookHelper.colorToHTML(_book, style.getBottomBorderColorColor());
hitBottom = appendBorderStyle(sb, "bottom", bb, color);
}
}
Cell next = null;
if (!hitBottom) {
next = Utils.getCell(_sheet, _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) {
CellStyle style = next.getCellStyle();
if (style != null){
int bb = style.getBorderTop();// get top border of
//String color = BookHelper.indexToRGB(_book, style.getTopBorderColor());
String color = BookHelper.colorToHTML(_book, style.getTopBorderColorColor());
// set next row top border as cell's bottom border;
hitBottom = appendBorderStyle(sb, "bottom", bb, color);
}
}
}
//border depends on next cell's background color
if(!hitBottom && next !=null){
CellStyle style = next.getCellStyle();
if (style != null){
//String bgColor = BookHelper.indexToRGB(_book, style.getFillForegroundColor());
//ZSS-34 cell background color does not show in excel
String bgColor = style.getFillPattern() != CellStyle.NO_FILL ?
BookHelper.colorToHTML(_book, style.getFillForegroundColorColor()) : null;
if (BookHelper.AUTO_COLOR.equals(bgColor)) {
bgColor = null;
}
if (bgColor != null) {
hitBottom = appendBorderStyle(sb, "bottom", CellStyle.BORDER_THIN, bgColor);
}
}
}
//border depends on current cell's background color
if(!hitBottom && _cell !=null){
CellStyle style = _cell.getCellStyle();
if (style != null){
//String bgColor = BookHelper.indexToRGB(_book, style.getFillForegroundColor());
//ZSS-34 cell background color does not show in excel
String bgColor = style.getFillPattern() != CellStyle.NO_FILL ?
BookHelper.colorToHTML(_book, style.getFillForegroundColorColor()) : null;
if (BookHelper.AUTO_COLOR.equals(bgColor)) {
bgColor = null;
}
if (bgColor != null) {
hitBottom = appendBorderStyle(sb, "bottom", CellStyle.BORDER_THIN, bgColor);