jeremias    2005/02/22 07:32:45

  Modified:    src/java/org/apache/fop/fo/properties
                        CommonBorderPaddingBackground.java
               src/java/org/apache/fop/layoutmgr/table Row.java Cell.java
  Log:
  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.
  
  Revision  Changes    Path
  1.13      +7 -1      
xml-fop/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
  
  Index: CommonBorderPaddingBackground.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CommonBorderPaddingBackground.java        21 Feb 2005 21:52:14 -0000      
1.12
  +++ CommonBorderPaddingBackground.java        22 Feb 2005 15:32:45 -0000      
1.13
  @@ -339,6 +339,12 @@
           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) 
  
  
  
  1.25      +3 -1      xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java
  
  Index: Row.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Row.java  22 Feb 2005 09:52:03 -0000      1.24
  +++ Row.java  22 Feb 2005 15:32:45 -0000      1.25
  @@ -220,7 +220,9 @@
                   
                   //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 
  
  
  
  1.25      +4 -0      xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java
  
  Index: Cell.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Cell.java 22 Feb 2005 09:52:03 -0000      1.24
  +++ Cell.java 22 Feb 2005 15:32:45 -0000      1.25
  @@ -324,6 +324,10 @@
                       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);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to