You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2005/06/20 15:24:21 UTC

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr/table CollapsingBorderModelEyeCatching.java GridUnit.java

jeremias    2005/06/20 06:24:21

  Modified:    src/java/org/apache/fop/layoutmgr/table
                        CollapsingBorderModelEyeCatching.java GridUnit.java
  Log:
  Fixes NPEs when a table is using collapsing border model in conjunction with empty cells.
  
  Revision  Changes    Path
  1.3       +4 -3      xml-fop/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java
  
  Index: CollapsingBorderModelEyeCatching.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CollapsingBorderModelEyeCatching.java	13 May 2005 19:16:54 -0000	1.2
  +++ CollapsingBorderModelEyeCatching.java	20 Jun 2005 13:24:21 -0000	1.3
  @@ -96,10 +96,11 @@
               //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);
           }
  
  
  
  1.5       +4 -1      xml-fop/src/java/org/apache/fop/layoutmgr/table/GridUnit.java
  
  Index: GridUnit.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/GridUnit.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GridUnit.java	30 May 2005 09:11:10 -0000	1.4
  +++ GridUnit.java	20 Jun 2005 13:24:21 -0000	1.5
  @@ -125,6 +125,9 @@
           while (node != null && !(node instanceof Table)) {
               node = node.getParent();
           }
  +        if (node == null && getColumn() != null) {
  +            node = getColumn().getParent();
  +        }
           return (Table)node;
       }
       
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org