https://bz.apache.org/bugzilla/show_bug.cgi?id=58787

--- Comment #31 from Mark Murphy <[email protected]> ---
(In reply to Javen O'Neal from comment #27)
> Mark,
> 
> When adding a border color, if a border line style is not set in the
> property template, the code sets it. Was there any reason for using
> drawTopBorder rather than directly adding the property?
> 
> >  private void drawTopBorderColor(CellRangeAddress range, short color) {
> >      int row = range.getFirstRow();
> >      int firstCol = range.getFirstColumn();
> >      int lastCol = range.getLastColumn();
> >      for (int i = firstCol; i <= lastCol; i++) {
> >          CellAddress cell = new CellAddress(row, i);
> >          // if BORDER_TOP is not set on BorderPropertyTemplate, make a thin 
> > border so that there's something to color
> >          if (borderIsNotSet(cell, CellUtil.BORDER_TOP)) {
> > -            drawTopBorder(new CellRangeAddress(row, row, i, i), 
> > BorderStyle.THIN);
> > +            addProperty(cell, CellUtil.BORDER_TOP, BorderStyle.THIN);
> >          }
> >          addProperty(cell, CellUtil.TOP_BORDER_COLOR, color);
> >      }
> >  }
> 
> Also, what should BorderPropertyTemplate do if the border line style is set
> to NONE and then drawTopBorderColor is called? Should it change the
> BorderStyle to THIN?
> >  private boolean borderIsNotSet(CellAddress cell, String borderDirection) {
> >      Object borderLineStyle = getTemplateProperty(cell, borderDirection);
> > -    return (borderLineStyle == null);
> > +    return (borderLineStyle == null) || (borderLineStyle == 
> > BorderStyle.NONE);
> >  }

Why use drawTopBorder? I don't have the code in front of me right now, but
probably to be consistent with the others. For interior borders there is an
issue with page breaks, if you do not have both the top border on one cell, and
the bottom border of the cell above it, either the line at the bottom of the
page or the line at the top of the next page will be missing from the printed
document. This would not apply to top borders, but I suspect that all the color
methods just use the draw method to ensure any special edge cases like that are
handled.

What to do about setting color for NONE border? I guess that the least
surprising option would be to add a THIN border.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to