//top line
if ((borderIndex & tb) != 0) {
for (int col = lCol; col <= rCol; ++col) {
Styles.setBorder(sheet, tRow, col, bsColor, bsLineStyle, tb);
}
all.add(new AreaRefImpl(tRow, lCol, tRow, rCol, refSheet));
final int tRow0 = tRow - 1;
if (tRow0 >= 0) {
for (int col = lCol; col <= rCol; ++col) {
Styles.setBorder(sheet, tRow0, col, bsColor, bsLineStyle, bb);
}
all.add(new AreaRefImpl(tRow0, lCol, tRow0, rCol, refSheet));
}
}
//bottom row
if ((borderIndex & bb) != 0) {
for (int col = lCol; col <= rCol; ++col) {
Styles.setBorder(sheet, bRow, col, bsColor, bsLineStyle, bb);
}
all.add(new AreaRefImpl(bRow, lCol, bRow, rCol, refSheet));
final int bRow0 = bRow + 1;
if (bRow0 <= maxrow) {
for (int col = lCol; col <= rCol; ++col) {
Styles.setBorder(sheet, bRow0, col, bsColor, bsLineStyle, tb);
}
all.add(new AreaRefImpl(bRow0, lCol, bRow0, rCol, refSheet));
}
}
//left column
if ((borderIndex & lb) != 0) {
for (int row = tRow; row <= bRow; row++) {
Styles.setBorder(sheet, row, lCol, bsColor, bsLineStyle, lb);
}
all.add(new AreaRefImpl(tRow, lCol, bRow, lCol, refSheet));
final int lCol0 = lCol - 1;
if (lCol0 >= 0) {
for (int row = tRow; row <= bRow; row++) {
Styles.setBorder(sheet, row, lCol0, bsColor, bsLineStyle, rb);
}
all.add(new AreaRefImpl(tRow, lCol0, bRow, lCol0, refSheet));
}
}
//right column
if ((borderIndex & rb) != 0) {
for (int row = tRow; row <= bRow; row++) {
Styles.setBorder(sheet, row, rCol, bsColor, bsLineStyle, rb);
}
all.add(new AreaRefImpl(tRow, rCol, bRow, rCol, refSheet));
final int rCol0 = rCol + 1;
if (rCol0 <= maxcol) {
for (int row = tRow; row <= bRow; row++) {
Styles.setBorder(sheet, row, rCol0, bsColor, bsLineStyle, lb);
}
all.add(new AreaRefImpl(tRow, rCol0, bRow, rCol0, refSheet));
}
}
return all;
}