chrisg      2002/11/28 07:23:23

  Modified:    .        Tag: fop-0_20_2-maintain CHANGES
               src/org/apache/fop/fo/flow Tag: fop-0_20_2-maintain
                        Block.java
  Log:
  Added infinite loop detection (just halts processing, see bug #8878)
  Submitted by: Rhett Aultman ([EMAIL PROTECTED])
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.10.2.33 +2 -1      xml-fop/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/xml-fop/CHANGES,v
  retrieving revision 1.10.2.32
  retrieving revision 1.10.2.33
  diff -u -r1.10.2.32 -r1.10.2.33
  --- CHANGES   26 Nov 2002 18:15:18 -0000      1.10.2.32
  +++ CHANGES   28 Nov 2002 15:23:22 -0000      1.10.2.33
  @@ -1,6 +1,7 @@
   ==============================================================================
   Done since 0.20.4 release
  -
  +- Added infinite loop detection (just halts processing, see bug #8878)
  +  Submitted by: Rhett Aultman ([EMAIL PROTECTED])
   - Added autoselecting  portrait/landscape on PCL Renderer (see bug #6638)
     Submitted by: [EMAIL PROTECTED] (Vicente Salvador)
   - Improved AWT Font-measuring/rendering (see bug #14657)
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.41.2.12 +13 -2     xml-fop/src/org/apache/fop/fo/flow/Block.java
  
  Index: Block.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Block.java,v
  retrieving revision 1.41.2.11
  retrieving revision 1.41.2.12
  diff -u -r1.41.2.11 -r1.41.2.12
  --- Block.java        22 Nov 2002 15:10:46 -0000      1.41.2.11
  +++ Block.java        28 Nov 2002 15:23:23 -0000      1.41.2.12
  @@ -56,12 +56,15 @@
   
       int areaHeight = 0;
       int contentWidth = 0;
  +    int infLoopThreshhold = 50;
   
       String id;
       int span;
   
       // this may be helpful on other FOs too
       boolean anythingLaidOut = false;
  +    //Added to see how long it's been since nothing was laid out.
  +    int noLayoutCount = 0;
   
       public Block(FObj parent, PropertyList propertyList)
           throws FOPException {
  @@ -77,8 +80,16 @@
       public int layout(Area area) throws FOPException {
           BlockArea blockArea;
   
  -        // log.error(" b:LAY[" + marker + "] ");
  +        if (!anythingLaidOut) {
  +            noLayoutCount++;
  +        }
  +        if (noLayoutCount > infLoopThreshhold) {
  +            throw new FOPException(
  +                "No meaningful layout in block after many attempts.  "+
  +                "Infinite loop is assumed.  Processing halted.");
  +        }
   
  +        // log.error(" b:LAY[" + marker + "] ");
   
           if (this.marker == BREAK_AFTER) {
               return Status.OK;
  
  
  

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

Reply via email to