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 ke...@locus.apache.org on 2000/11/28 08:09:31 UTC

cvs commit: xml-fop/src/org/apache/fop/fo/flow Table.java TableBody.java TableRow.java

keiron      00/11/27 23:09:30

  Modified:    src/org/apache/fop/layout Area.java
               src/org/apache/fop/fo/flow Table.java TableBody.java
                        TableRow.java
  Log:
  this handles the situation where the first row of a table
  cannot fit on the current page, so the table must begin from
  the next page.
  This makes sure that no part of the table remains on the page
  and also no border will show up
  
  Code changes sponsored by Dresdner Bank, Germany
  
  Revision  Changes    Path
  1.13      +7 -1      xml-fop/src/org/apache/fop/layout/Area.java
  
  Index: Area.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/Area.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Area.java	2000/07/19 17:18:01	1.12
  +++ Area.java	2000/11/28 07:09:26	1.13
  @@ -1,4 +1,4 @@
  -/*-- $Id: Area.java,v 1.12 2000/07/19 17:18:01 jordan Exp $ -- 
  +/*-- $Id: Area.java,v 1.13 2000/11/28 07:09:26 keiron Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -226,6 +226,12 @@
   	this.children.removeElement(area);
       }
   	
  +    public void removeChild(DisplaySpace spacer) {
  +	this.currentHeight -= spacer.getSize();
  +        this.absoluteHeight -= spacer.getSize();
  +	this.children.removeElement(spacer);
  +    }
  +
       public void remove() {
   	this.parent.removeChild(this);
       }
  
  
  
  1.17      +6 -4      xml-fop/src/org/apache/fop/fo/flow/Table.java
  
  Index: Table.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Table.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Table.java	2000/11/10 22:55:17	1.16
  +++ Table.java	2000/11/28 07:09:28	1.17
  @@ -1,4 +1,4 @@
  -/*-- $Id: Table.java,v 1.16 2000/11/10 22:55:17 klease Exp $ -- 
  +/*-- $Id: Table.java,v 1.17 2000/11/28 07:09:28 keiron Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -218,9 +218,11 @@
   			status = new Status(Status.AREA_FULL_SOME);
   		    }
   		    //areaContainer.end();
  -		    area.addChild(areaContainer);
  -		    area.increaseHeight(areaContainer.getHeight());
  -                    area.setAbsoluteHeight(areaContainer.getAbsoluteHeight()); 
  +    		if(!(/*(i == 0) && */(areaContainer.getContentHeight() <= 0))) {
  +	    	    area.addChild(areaContainer);
  +		        area.increaseHeight(areaContainer.getHeight());
  +                    area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
  +            }
   		    return status;
   		}
   	    }
  
  
  
  1.14      +4 -2      xml-fop/src/org/apache/fop/fo/flow/TableBody.java
  
  Index: TableBody.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableBody.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TableBody.java	2000/06/29 22:24:00	1.13
  +++ TableBody.java	2000/11/28 07:09:28	1.14
  @@ -1,4 +1,4 @@
  -/*-- $Id: TableBody.java,v 1.13 2000/06/29 22:24:00 jordan Exp $ -- 
  +/*-- $Id: TableBody.java,v 1.14 2000/11/28 07:09:28 keiron Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -164,11 +164,13 @@
   		if ((i != 0) && (status.getCode() == Status.AREA_FULL_NONE)) {
   		    status = new Status(Status.AREA_FULL_SOME);
   		}
  +		if(!((i == 0) && (areaContainer.getContentHeight() <= 0))) {
       	        area.addChild(areaContainer);
   		//areaContainer.end();
   
  -		area.increaseHeight(areaContainer.getHeight());
  +		        area.increaseHeight(areaContainer.getHeight());
                   area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
  +            }
   		return status;
   	    }
   	}
  
  
  
  1.21      +8 -2      xml-fop/src/org/apache/fop/fo/flow/TableRow.java
  
  Index: TableRow.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/TableRow.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TableRow.java	2000/11/08 22:07:27	1.20
  +++ TableRow.java	2000/11/28 07:09:29	1.21
  @@ -1,4 +1,4 @@
  -/*-- $Id: TableRow.java,v 1.20 2000/11/08 22:07:27 gears Exp $ -- 
  +/*-- $Id: TableRow.java,v 1.21 2000/11/28 07:09:29 keiron Exp $ -- 
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -104,6 +104,7 @@
       Vector columns;
   
       AreaContainer areaContainer;
  +    DisplaySpace spacer = null;
   
       public TableRow(FObj parent, PropertyList propertyList) {
   	super(parent, propertyList);
  @@ -211,7 +212,8 @@
   	}
   
   	if ((spaceBefore != 0) && (this.marker ==0)) {
  -	    area.addDisplaySpace(spaceBefore);
  +	    spacer = new DisplaySpace(spaceBefore);
  +	    area.increaseHeight(spaceBefore);
   	}
   
           if ( marker==0 ) {
  @@ -267,6 +269,8 @@
   		    status = new Status(Status.AREA_FULL_SOME);
   		}
       	        
  +    	        if(spacer != null)
  +        	        area.removeChild(spacer);
       	        area.removeChild(areaContainer);
                   this.resetMarker();                
                   this.removeID(area.getIDReferences());
  @@ -284,6 +288,8 @@
               cell.setHeight(largestCellHeight);
   	}
   
  +    if(spacer != null)
  +        area.addChild(spacer);
   	area.addChild(areaContainer);
   	areaContainer.end();
           area.addDisplaySpace(largestCellHeight