diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-02-22 15:32:45 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-02-22 15:32:45 +0000 |
commit | 982cb1e1b2b29bd3ac3853c7bff2acb2f55dcf15 (patch) | |
tree | 9947f49d05d32cf7d24b6e477a319d97e1d96d33 /src/java | |
parent | 6f9fe4eb34d277f673f6313acaec1a3c4a4ad671 (diff) | |
download | xmlgraphics-fop-982cb1e1b2b29bd3ac3853c7bff2acb2f55dcf15.tar.gz xmlgraphics-fop-982cb1e1b2b29bd3ac3853c7bff2acb2f55dcf15.zip |
Should run my own tests.... :-(
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
Diffstat (limited to 'src/java')
3 files changed, 13 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java index fcaa0e217..f60b37bca 100755 --- a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java +++ b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java @@ -339,6 +339,12 @@ public class CommonBorderPaddingBackground implements Cloneable { 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) diff --git a/src/java/org/apache/fop/layoutmgr/table/Cell.java b/src/java/org/apache/fop/layoutmgr/table/Cell.java index cd2c9a7ba..2c66f6d39 100644 --- a/src/java/org/apache/fop/layoutmgr/table/Cell.java +++ b/src/java/org/apache/fop/layoutmgr/table/Cell.java @@ -324,6 +324,10 @@ public class Cell extends BlockStackingLayoutManager { 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); diff --git a/src/java/org/apache/fop/layoutmgr/table/Row.java b/src/java/org/apache/fop/layoutmgr/table/Row.java index 29d1ce281..bd03c5e3b 100644 --- a/src/java/org/apache/fop/layoutmgr/table/Row.java +++ b/src/java/org/apache/fop/layoutmgr/table/Row.java @@ -220,7 +220,9 @@ public class Row extends BlockStackingLayoutManager { //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 |