]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixes NPEs when a table is using collapsing border model in conjunction with empty...
authorJeremias Maerki <jeremias@apache.org>
Mon, 20 Jun 2005 13:24:21 +0000 (13:24 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 20 Jun 2005 13:24:21 +0000 (13:24 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198755 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java
src/java/org/apache/fop/layoutmgr/table/GridUnit.java

index 98d7fd5bccca989ec621c9b986a48cfbb8db1f47..d63ba8d48769e29d73f2470300163f63d2783cbb 100644 (file)
@@ -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);
         }
index fce7498631353dd31f383c08e8996cb8751283fb..db381bf87304f8b6a945a4cccd8e9f169ebee396 100644 (file)
@@ -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;
     }