olegt       2002/11/23 23:23:51

  Modified:    src/org/apache/fop/fo/pagination Tag: fop-0_20_2-maintain
                        SimplePageMaster.java
               src/codegen Tag: fop-0_20_2-maintain foproperties.xml
  Log:
  Support for page-width and page-height "auto" values (fallback to 8 and 11in). Fixes 
infinite loop when page-height is "auto".
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.15.2.7  +9 -7      xml-fop/src/org/apache/fop/fo/pagination/SimplePageMaster.java
  
  Index: SimplePageMaster.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/SimplePageMaster.java,v
  retrieving revision 1.15.2.6
  retrieving revision 1.15.2.7
  diff -u -r1.15.2.6 -r1.15.2.7
  --- SimplePageMaster.java     19 Nov 2002 01:04:05 -0000      1.15.2.6
  +++ SimplePageMaster.java     24 Nov 2002 07:23:51 -0000      1.15.2.7
  @@ -9,12 +9,11 @@
   
   // FOP
   import org.apache.fop.fo.*;
  -import org.apache.fop.fo.properties.*;
   import org.apache.fop.layout.PageMaster;
  -import org.apache.fop.layout.RegionArea;
   import org.apache.fop.layout.BodyRegionArea;
   import org.apache.fop.layout.MarginProps;
   import org.apache.fop.apps.FOPException;
  +import org.apache.fop.datatypes.Length;
   
   import java.util.HashMap;
   import java.util.Iterator;
  @@ -27,6 +26,9 @@
    *     &para;6.4.12</a>
    */
   public class SimplePageMaster extends FObj {
  +    // Fallback values for "auto" page size: 8x11in
  +    private final static int FALLBACK_PAGE_HEIGHT = 792000;
  +    private final static int FALLBACK_PAGE_WIDTH = 576000;
   
       public static class Maker extends FObj.Maker {
           public FObj make(FObj parent,
  @@ -82,10 +84,10 @@
       }
   
       protected void end() {
  -        int pageWidth =
  -            this.properties.get("page-width").getLength().mvalue();
  -        int pageHeight =
  -            this.properties.get("page-height").getLength().mvalue();
  +        Length pageWidthLen = this.properties.get("page-width").getLength();
  +        int pageWidth = pageWidthLen.isAuto() ? FALLBACK_PAGE_WIDTH : 
pageWidthLen.mvalue();
  +        Length pageHeightLen = this.properties.get("page-height").getLength();
  +        int pageHeight = pageHeightLen.isAuto() ? FALLBACK_PAGE_HEIGHT : 
pageHeightLen.mvalue();
           // this.properties.get("reference-orientation");
           // this.properties.get("writing-mode");
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.25.2.6  +3 -3      xml-fop/src/codegen/foproperties.xml
  
  Index: foproperties.xml
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/codegen/foproperties.xml,v
  retrieving revision 1.25.2.5
  retrieving revision 1.25.2.6
  diff -u -r1.25.2.5 -r1.25.2.6
  --- foproperties.xml  28 Jul 2002 22:18:04 -0000      1.25.2.5
  +++ foproperties.xml  24 Nov 2002 07:23:51 -0000      1.25.2.6
  @@ -1592,7 +1592,7 @@
         <datatype>Length</datatype>
         <default>1.0pt</default>
       </property>
  -    
  +
       <!-- Properties for Dynamic Effects Formatting Objects -->
   
       <property>
  @@ -1849,7 +1849,7 @@
         <inherited>false</inherited>
         <datatype>Length</datatype>
         <auto-ok/>
  -      <default>11in</default>
  +      <default>auto</default>
       </property>
       <property>
         <name>page-position</name>
  @@ -1868,7 +1868,7 @@
         <inherited>false</inherited>
         <datatype>Length</datatype>
         <auto-ok/>
  -      <default>8in</default>
  +      <default>auto</default>
       </property>
       <property>
         <name>precedence</name>
  
  
  

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

Reply via email to