aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/layoutmgr/table
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-06-20 13:24:21 +0000
committerJeremias Maerki <jeremias@apache.org>2005-06-20 13:24:21 +0000
commit00be416963eb3b4f2bfa6b3779fecd2a5b3bd6a9 (patch)
treecf5f2219af31de031ce889b1fc51faacf4431795 /src/java/org/apache/fop/layoutmgr/table
parentb7f42663b677b7076329a0e22d17525c842a0034 (diff)
downloadxmlgraphics-fop-00be416963eb3b4f2bfa6b3779fecd2a5b3bd6a9.tar.gz
xmlgraphics-fop-00be416963eb3b4f2bfa6b3779fecd2a5b3bd6a9.zip
Fixes NPEs when a table is using collapsing border model in conjunction with empty cells.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198755 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/table')
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java5
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/GridUnit.java3
2 files changed, 6 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java
index 98d7fd5bc..d63ba8d48 100644
--- a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java
+++ b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java
@@ -96,10 +96,11 @@ public class CollapsingBorderModelEyeCatching extends CollapsingBorderModel {
//row
other[1] = otherRow.getCommonBorderPaddingBackground().getBorderInfo(otherSide);
}
- if ((side == BEFORE && currentGridUnit.getFlag(GridUnit.FIRST_IN_BODY))
+ if (currentBody != null
+ && ((side == BEFORE && currentGridUnit.getFlag(GridUnit.FIRST_IN_BODY))
|| (side == AFTER && currentGridUnit.getFlag(GridUnit.LAST_IN_BODY))
|| (currentGridUnit.getFlag(GridUnit.IN_FIRST_COLUMN) && side == START)
- || (currentGridUnit.getFlag(GridUnit.IN_LAST_COLUMN) && side == END)) {
+ || (currentGridUnit.getFlag(GridUnit.IN_LAST_COLUMN) && side == END))) {
//row group (=body, table-header or table-footer)
current[2] = currentBody.getCommonBorderPaddingBackground().getBorderInfo(side);
}
diff --git a/src/java/org/apache/fop/layoutmgr/table/GridUnit.java b/src/java/org/apache/fop/layoutmgr/table/GridUnit.java
index fce749863..db381bf87 100644
--- a/src/java/org/apache/fop/layoutmgr/table/GridUnit.java
+++ b/src/java/org/apache/fop/layoutmgr/table/GridUnit.java
@@ -125,6 +125,9 @@ public class GridUnit {
while (node != null && !(node instanceof Table)) {
node = node.getParent();
}
+ if (node == null && getColumn() != null) {
+ node = getColumn().getParent();
+ }
return (Table)node;
}