while (yi <= coords.y2) {
xi = coords.x1;
while (xi <= coords.x2) {
cell = sheet.getCell(yi, xi, false);
if (cell == defaultCell) {
IStyle newStyle = null;
// update edge cell of an element
if (xi != coords.x1) {
if (newStyle == null) {
newStyle = StyleImpl.create(style);
}
// set directly for optimization
newStyle.setProperty(StyleConstants.STYLE_BORDER_LEFT_STYLE,
CSSValueConstants.NONE_VALUE);
}
if (xi != coords.x2) {
if (newStyle == null) {
newStyle = StyleImpl.create(style);
}
newStyle.setProperty(StyleConstants.STYLE_BORDER_RIGHT_STYLE,
CSSValueConstants.NONE_VALUE);
}
if (yi != coords.y1) {
if (newStyle == null) {
newStyle = StyleImpl.create(style);
}
newStyle.setProperty(StyleConstants.STYLE_BORDER_TOP_STYLE,
CSSValueConstants.NONE_VALUE);
}
if (yi != coords.y2) {
if (newStyle == null) {
newStyle = StyleImpl.create(style);
}
newStyle.setProperty(StyleConstants.STYLE_BORDER_BOTTOM_STYLE,
CSSValueConstants.NONE_VALUE);
}
sheet.setCell(yi, xi, null, newStyle != null ? newStyle
: style);