Bugfix for NPE on empty cells.
Skip adding helper areas for border painting when there are no borders to paint.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198455
13f79535-47bb-0310-9956-
ffa450edef68
return ((backgroundColor != null || getFopImage() != null));
}
+ /** @return true if border is non-zero. */
+ public boolean hasBorder() {
+ return ((getBorderBeforeWidth(false) + getBorderAfterWidth(false)
+ + getBorderStartWidth(false) + getBorderEndWidth(false)) > 0);
+ }
+
/** @return true if padding is non-zero. */
public boolean hasPadding() {
return ((getPaddingBefore(false) + getPaddingAfter(false)
int lastRowHeight = 0;
for (int x = 0; x < gridUnits.size(); x++) {
GridUnit gu = (GridUnit)gridUnits.get(x);
+ if (!gu.effBorders.hasBorder()) {
+ continue;
+ }
+
//Blocks for painting grid unit borders
Block block = new Block();
block.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE);
//Ending grid unit for current cell
GridUnit ending = null;
- pos += starting.layoutManager.getFObj().getNumberColumnsSpanned() - 1;
+ if (starting.layoutManager != null) {
+ pos += starting.layoutManager.getFObj().getNumberColumnsSpanned() - 1;
+ }
ending = (GridUnit)gridUnits.get(pos - 1);
//Neighbouring grid unit at end edge