olegt       2003/01/05 01:03:12

  Modified:    src/org/apache/fop/fo/pagination Region.java
                        RegionAfter.java RegionBA.java RegionBefore.java
                        RegionBody.java RegionEnd.java RegionSE.java
                        RegionStart.java SimplePageMaster.java
  Log:
  Made regions to be writing-modů aware, now it's ok for lr-tb, rl-tb and tb-rl.
  
  Revision  Changes    Path
  1.15      +15 -13    xml-fop/src/org/apache/fop/fo/pagination/Region.java
  
  Index: Region.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Region.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Region.java       22 Dec 2002 23:37:06 -0000      1.14
  +++ Region.java       5 Jan 2003 09:03:12 -0000       1.15
  @@ -7,11 +7,11 @@
   
   package org.apache.fop.fo.pagination;
   
  +// Java
   import java.awt.Rectangle;
   import java.awt.geom.Rectangle2D;
   
   // FOP
  -
   import org.apache.fop.datatypes.FODimension;
   import org.apache.fop.fo.FObj;
   import org.apache.fop.fo.FONode;
  @@ -23,24 +23,26 @@
   import org.apache.fop.area.RegionReference;
   import org.apache.fop.layoutmgr.AbstractLayoutManager;
   
  +// SAX
   import org.xml.sax.Attributes;
   
   /**
    * This is an abstract base class for pagination regions
    */
   public abstract class Region extends FObj {
  -    public static final String PROP_REGION_NAME = "region-name";
  +    private static final String PROP_REGION_NAME = "region-name";
   
  -    public static final String BEFORE = "before";
  -    public static final String START =  "start";
  -    public static final String END =    "end";
  -    public static final String AFTER =  "after";
  -    public static final String BODY =   "body";
  +    protected static final String BEFORE = "before";
  +    protected static final String START =  "start";
  +    protected static final String END =    "end";
  +    protected static final String AFTER =  "after";
  +    protected static final String BODY =   "body";
   
       private SimplePageMaster _layoutMaster;
       private String _regionName;
   
       protected int overflow;
  +    protected int wm;
   
       protected Region(FONode parent) {
           super(parent);
  @@ -60,8 +62,8 @@
               if (isReserved(getRegionName())
                       &&!getRegionName().equals(getDefaultRegionName())) {
                   throw new FOPException(PROP_REGION_NAME + " '" + _regionName
  -                                       + "' for " + this.name
  -                                       + " not permitted.");
  +                        + "' for " + this.name
  +                        + " not permitted.");
               }
           }
   
  @@ -69,9 +71,10 @@
               _layoutMaster = (SimplePageMaster)parent;
           } else {
               throw new FOPException(this.name + " must be child "
  -                                   + "of simple-page-master, not "
  -                                   + parent.getName());
  +                    + "of simple-page-master, not "
  +                    + parent.getName());
           }
  +        this.wm = this.properties.get("writing-mode").getEnum();
       }
   
       /**
  @@ -195,5 +198,4 @@
       int getExtent() {
           return 0;
       }
  -
   }
  
  
  
  1.16      +9 -7      xml-fop/src/org/apache/fop/fo/pagination/RegionAfter.java
  
  Index: RegionAfter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionAfter.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- RegionAfter.java  22 Dec 2002 23:37:06 -0000      1.15
  +++ RegionAfter.java  5 Jan 2003 09:03:12 -0000       1.16
  @@ -9,6 +9,7 @@
   
   // FOP
   import org.apache.fop.fo.*;
  +import org.apache.fop.fo.properties.WritingMode;
   import org.apache.fop.datatypes.FODimension;
   import org.apache.fop.area.RegionReference;
   
  @@ -22,12 +23,14 @@
       }
   
       protected Rectangle getViewportRectangle (FODimension reldims) {
  -        // Depends on extent and precedence
  -        Rectangle vpRect =
  -            new Rectangle(0, reldims.bpd - getExtent(),
  -        reldims.ipd, getExtent());
  +        // Depends on extent, precedence ans writing mode
  +        Rectangle vpRect;
  +        if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB)
  +            vpRect = new Rectangle(0, reldims.bpd - getExtent(), reldims.ipd, 
getExtent());
  +        else
  +            vpRect = new Rectangle(0, reldims.bpd - getExtent(), getExtent(), 
reldims.ipd);
           if (getPrecedence() == false) {
  -            adjustIPD(vpRect);
  +            adjustIPD(vpRect, this.wm);
           }
           return vpRect;
       }
  @@ -43,6 +46,5 @@
       public String getRegionClass() {
           return Region.AFTER;
       }
  -
   }
   
  
  
  
  1.5       +12 -8     xml-fop/src/org/apache/fop/fo/pagination/RegionBA.java
  
  Index: RegionBA.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionBA.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RegionBA.java     22 Dec 2002 23:37:06 -0000      1.4
  +++ RegionBA.java     5 Jan 2003 09:03:12 -0000       1.5
  @@ -10,6 +10,7 @@
   // FOP
   import org.apache.fop.fo.*;
   import org.apache.fop.fo.properties.Precedence;
  +import org.apache.fop.fo.properties.WritingMode;
   
   // Java
   import java.awt.Rectangle;
  @@ -39,19 +40,22 @@
        * inline-progression-dimension is limited by the extent of the start
        * and end regions if they are present.
        */
  -    protected void adjustIPD(Rectangle vpRect) {
  -        int xoff = 0;
  +    protected void adjustIPD(Rectangle vpRect, int wm) {
  +        int offset = 0;
           Region start = getSiblingRegion(Region.START);
           if (start != null) {
  -            xoff = start.getExtent();
  -            vpRect.translate(xoff, 0);
  +            offset = start.getExtent();
  +            vpRect.translate(offset, 0);
           }
           Region end =getSiblingRegion(Region.END);
           if (end != null) {
  -            xoff += end.getExtent();
  +            offset += end.getExtent();
           }
  -        if (xoff > 0) {
  -            vpRect.grow(-xoff,0);
  +        if (offset > 0) {
  +            if (wm == WritingMode.LR_TB || wm == WritingMode.RL_TB)
  +                vpRect.width-=offset;
  +            else
  +                vpRect.height-=offset;
           }
       }
   }
  
  
  
  1.17      +18 -18    xml-fop/src/org/apache/fop/fo/pagination/RegionBefore.java
  
  Index: RegionBefore.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionBefore.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- RegionBefore.java 22 Dec 2002 23:37:06 -0000      1.16
  +++ RegionBefore.java 5 Jan 2003 09:03:12 -0000       1.17
  @@ -9,7 +9,8 @@
   
   // FOP
   import org.apache.fop.datatypes.FODimension;
  -import org.apache.fop.fo.*;
  +import org.apache.fop.fo.properties.WritingMode;
  +import org.apache.fop.fo.FONode;
   import org.apache.fop.area.RegionReference;
   
   // Java
  @@ -21,10 +22,6 @@
           super(parent);
       }
   
  -//     public void handleAttrs(Attributes attlist) throws FOPException {
  -//         super.handleAttrs(attlist);
  -//     }
  -
       protected String getDefaultRegionName() {
           return "xsl-region-before";
       }
  @@ -38,18 +35,21 @@
       }
   
       protected Rectangle getViewportRectangle (FODimension reldims) {
  -      // Depends on extent and precedence
  -      // This should return rectangle in writing-mode coordinates relative
  -      // to the page-reference area rectangle
  -      // This means the origin is (start, before) and the dimensions are (ipd,bpd)
  -      // Before is always 0, start depends on extent
  -      // ipd depends on precedence, bpd=extent
  -      Rectangle vpRect = new Rectangle(0, 0, reldims.ipd, getExtent());
  -      if (getPrecedence() == false) {
  -          adjustIPD(vpRect);
  -      }
  -      return vpRect;
  +        // Depends on extent, precedence and writing mode
  +        // This should return rectangle in writing-mode coordinates relative
  +        // to the page-reference area rectangle
  +        // This means the origin is (start, before) and the dimensions are (ipd,bpd)
  +        // Before is always 0, start depends on extent
  +        // ipd depends on precedence, bpd=extent
  +        Rectangle vpRect;
  +        if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB)
  +            vpRect = new Rectangle(0, 0, reldims.ipd, getExtent());
  +        else
  +            vpRect = new Rectangle(0, 0, getExtent(), reldims.ipd);
  +        if (getPrecedence() == false) {
  +            adjustIPD(vpRect, this.wm);
  +        }
  +        return vpRect;
       }
  -
   }
   
  
  
  
  1.21      +42 -31    xml-fop/src/org/apache/fop/fo/pagination/RegionBody.java
  
  Index: RegionBody.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionBody.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- RegionBody.java   22 Dec 2002 23:37:06 -0000      1.20
  +++ RegionBody.java   5 Jan 2003 09:03:12 -0000       1.21
  @@ -17,6 +17,7 @@
   import org.apache.fop.fo.PropertyList;
   import org.apache.fop.fo.Property;
   import org.apache.fop.fo.properties.Overflow;
  +import org.apache.fop.fo.properties.WritingMode;
   import org.apache.fop.datatypes.ColorType;
   import org.apache.fop.datatypes.FODimension;
   import org.apache.fop.area.RegionReference;
  @@ -33,20 +34,30 @@
   
       protected Rectangle getViewportRectangle (FODimension reldims)
       {
  -    /*
  -     * Use space-before and space-after which will use corresponding
  -     * absolute margin properties if specified. For indents:
  -     * try to get corresponding absolute margin property using the
  -     * writing-mode on the page (not on the region-body!). If that's not
  -     * set but indent is explicitly set, it will return that.
  -     */
  +        /*
  +        * Use space-before and space-after which will use corresponding
  +        * absolute margin properties if specified. For indents:
  +        * try to get corresponding absolute margin property using the
  +        * writing-mode on the page (not on the region-body!). If that's not
  +        * set but indent is explicitly set, it will return that.
  +        */
           MarginProps mProps = propMgr.getMarginProps();
  -    int start = getRelMargin(PropertyList.START, "start-indent");
  -    return new Rectangle( start, mProps.spaceBefore,
  -                  reldims.ipd - start -
  -                  getRelMargin(PropertyList.END, "end-indent"),
  -                  reldims.bpd - mProps.spaceBefore -
  -                  mProps.spaceAfter);
  +        int start = getRelMargin(PropertyList.START, "start-indent");
  +        Rectangle vpRect;
  +        if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB)
  +            vpRect = new Rectangle( start, mProps.spaceBefore,
  +                    reldims.ipd - start -
  +                    getRelMargin(PropertyList.END, "end-indent"),
  +                    reldims.bpd - mProps.spaceBefore -
  +                    mProps.spaceAfter);
  +        else
  +            vpRect = new Rectangle( start, mProps.spaceBefore,
  +                    reldims.bpd - mProps.spaceBefore -
  +                    mProps.spaceAfter,
  +                    reldims.ipd - start -
  +                    getRelMargin(PropertyList.END, "end-indent")
  +            );
  +        return vpRect;
       }
   
       /**
  @@ -54,14 +65,14 @@
        * writing mode.
        */
       private int getRelMargin(int reldir, String sRelPropName) {
  -    FObj parent = (FObj) getParent();
  -    String sPropName = "margin-" +
  -        parent.properties.wmRelToAbs(reldir);
  -    Property prop = properties.getExplicitBaseProp(sPropName);
  -    if (prop == null) {
  -       prop = properties.getExplicitBaseProp(sRelPropName);
  -    }
  -    return ((prop != null)? prop.getLength().mvalue() : 0);
  +        FObj parent = (FObj) getParent();
  +        String sPropName = "margin-" +
  +                parent.properties.wmRelToAbs(reldir);
  +        Property prop = properties.getExplicitBaseProp(sPropName);
  +        if (prop == null) {
  +            prop = properties.getExplicitBaseProp(sRelPropName);
  +        }
  +        return ((prop != null)? prop.getLength().mvalue() : 0);
       }
   
       protected String getDefaultRegionName() {
  @@ -80,24 +91,24 @@
        * Override the inherited method.
        */
       public RegionReference makeRegionReferenceArea(Rectangle2D absRegVPRect) {
  -    // Should set some column stuff here I think, or put it elsewhere
  -    BodyRegion body = new BodyRegion();
  -    setRegionPosition(body, absRegVPRect);
  +        // Should set some column stuff here I think, or put it elsewhere
  +        BodyRegion body = new BodyRegion();
  +        setRegionPosition(body, absRegVPRect);
           int columnCount=
  -            this.properties.get("column-count").getNumber().intValue();
  +                this.properties.get("column-count").getNumber().intValue();
           if ((columnCount > 1) && (overflow == Overflow.SCROLL)) {
               // recover by setting 'column-count' to 1. This is allowed but
               // not required by the spec.
               getLogger().error("Setting 'column-count' to 1 because "
  -                                   + "'overflow' is set to 'scroll'");
  +                    + "'overflow' is set to 'scroll'");
               columnCount = 1;
           }
  -    body.setColumnCount(columnCount);
  +        body.setColumnCount(columnCount);
   
           int columnGap =
  -             this.properties.get("column-gap").getLength().mvalue();
  -    body.setColumnGap(columnGap);
  -    return body;
  +                this.properties.get("column-gap").getLength().mvalue();
  +        body.setColumnGap(columnGap);
  +        return body;
       }
   
   }
  
  
  
  1.10      +11 -7     xml-fop/src/org/apache/fop/fo/pagination/RegionEnd.java
  
  Index: RegionEnd.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionEnd.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- RegionEnd.java    22 Dec 2002 23:37:06 -0000      1.9
  +++ RegionEnd.java    5 Jan 2003 09:03:12 -0000       1.10
  @@ -12,6 +12,7 @@
   
   // FOP
   import org.apache.fop.fo.*;
  +import org.apache.fop.fo.properties.WritingMode;
   import org.apache.fop.datatypes.FODimension;
   import org.apache.fop.area.RegionReference;
   
  @@ -25,11 +26,15 @@
   
   
       protected Rectangle getViewportRectangle (FODimension reldims) {
  -        // Depends on extent and precedence
  -        Rectangle vpRect =
  -            new Rectangle(reldims.ipd - getExtent(), 0,
  -                          getExtent(), reldims.bpd);
  -        adjustIPD(vpRect);
  +        // Depends on extent, precedence and writing mode
  +        Rectangle vpRect;
  +        if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB)
  +            vpRect = new Rectangle(reldims.ipd - getExtent(), 0,
  +                    getExtent(), reldims.bpd);
  +        else
  +            vpRect = new Rectangle(reldims.ipd - getExtent(), 0,
  +                    reldims.bpd, getExtent());
  +        adjustIPD(vpRect, this.wm);
           return vpRect;
       }
   
  @@ -45,6 +50,5 @@
       public int getRegionAreaClass() {
           return RegionReference.END;
       }
  -
   }
   
  
  
  
  1.4       +12 -8     xml-fop/src/org/apache/fop/fo/pagination/RegionSE.java
  
  Index: RegionSE.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionSE.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RegionSE.java     22 Dec 2002 23:37:06 -0000      1.3
  +++ RegionSE.java     5 Jan 2003 09:03:12 -0000       1.4
  @@ -9,6 +9,7 @@
   
   // FOP
   import org.apache.fop.fo.*;
  +import org.apache.fop.fo.properties.WritingMode;
   
   // Java
   import java.awt.Rectangle;
  @@ -27,19 +28,22 @@
        * they extend in the BPD to the page reference rectangle
        * diminish by extend of start and end if present.
        */
  -    protected void adjustIPD(Rectangle refRect) {
  -        int yoff = 0;
  +    protected void adjustIPD(Rectangle refRect, int wm) {
  +        int offset = 0;
           Region before = getSiblingRegion(Region.BEFORE);
           if (before != null && before.getPrecedence()) {
  -            yoff = before.getExtent();
  -            refRect.translate(0, yoff);
  +            offset = before.getExtent();
  +            refRect.translate(0, offset);
           }
           Region after = getSiblingRegion(Region.AFTER);
           if (after != null && after.getPrecedence()) {
  -            yoff += after.getExtent();
  +            offset += after.getExtent();
           }
  -        if (yoff > 0) {
  -            refRect.grow(0,-yoff);
  +        if (offset > 0) {
  +            if (wm == WritingMode.LR_TB || wm == WritingMode.RL_TB)
  +                refRect.height-=offset;
  +            else
  +                refRect.width-=offset;
           }
       }
   }
  
  
  
  1.10      +9 -6      xml-fop/src/org/apache/fop/fo/pagination/RegionStart.java
  
  Index: RegionStart.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/RegionStart.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- RegionStart.java  22 Dec 2002 23:37:06 -0000      1.9
  +++ RegionStart.java  5 Jan 2003 09:03:12 -0000       1.10
  @@ -12,6 +12,7 @@
   
   // FOP
   import org.apache.fop.fo.*;
  +import org.apache.fop.fo.properties.WritingMode;
   import org.apache.fop.datatypes.FODimension;
   import org.apache.fop.area.RegionReference;
   
  @@ -24,12 +25,15 @@
   
   
       protected Rectangle getViewportRectangle (FODimension reldims) {
  -        // Depends on extent and precedence
  +        // Depends on extent, precedence an‚ writing mode
           // This is the rectangle relative to the page-reference area in
           // writing-mode relative coordinates
  -        Rectangle vpRect =
  -            new Rectangle(0, 0, getExtent(), reldims.bpd);
  -        adjustIPD(vpRect);
  +        Rectangle vpRect;
  +        if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB)
  +            vpRect = new Rectangle(0, 0, getExtent(), reldims.bpd);
  +        else
  +            vpRect = new Rectangle(0, 0, reldims.bpd, getExtent());
  +        adjustIPD(vpRect, this.wm);
           return vpRect;
       }
   
  @@ -44,6 +48,5 @@
       public int getRegionAreaClass() {
           return RegionReference.START;
       }
  -
   }
   
  
  
  
  1.28      +43 -42    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.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- SimplePageMaster.java     22 Dec 2002 23:37:06 -0000      1.27
  +++ SimplePageMaster.java     5 Jan 2003 09:03:12 -0000       1.28
  @@ -1,9 +1,9 @@
   /*
  - * $Id$
  - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  - * For details on use and redistribution please refer to the
  - * LICENSE file included with these sources.
  - */
  +* $Id$
  +* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
  +* For details on use and redistribution please refer to the
  +* LICENSE file included with these sources.
  +*/
   
   package org.apache.fop.fo.pagination;
   
  @@ -52,16 +52,17 @@
               masterName = this.properties.get("master-name").getString();
               if (masterName == null) {
                   getLogger().warn("simple-page-master does not have "
  -                                       + "a master-name and so is being ignored");
  +                        + "a master-name and so is being ignored");
               } else {
                   layoutMasterSet.addSimplePageMaster(this);
               }
           } else {
               throw new FOPException("fo:simple-page-master must be child "
  -                                   + "of fo:layout-master-set, not "
  -                                   + parent.getName());
  +                    + "of fo:layout-master-set, not "
  +                    + parent.getName());
           }
  -        _regions = new HashMap();
  +        //Well, there are only 5 regions so we can save a bit of memory here
  +        _regions = new HashMap(5);
       }
   
       /**
  @@ -70,57 +71,57 @@
        */
       protected void end() {
           int pageWidth =
  -            this.properties.get("page-width").getLength().mvalue();
  +                this.properties.get("page-width").getLength().mvalue();
           int pageHeight =
  -            this.properties.get("page-height").getLength().mvalue();
  +                this.properties.get("page-height").getLength().mvalue();
           // this.properties.get("reference-orientation");
           // this.properties.get("writing-mode");
   
           // Get absolute margin properties (top, left, bottom, right)
           MarginProps mProps = propMgr.getMarginProps();
   
  -    /* Create the page reference area rectangle in first quadrant coordinates
  -     * (ie, 0,0 is at bottom,left of the "page media" and y increases
  -     * when moving towards the top of the page.
  -     * The media rectangle itself is (0,0,pageWidth,pageHeight).
  -     */
  -    Rectangle pageRefRect =
  -        new Rectangle(mProps.marginLeft, mProps.marginTop,
  -              pageWidth - mProps.marginLeft - mProps.marginRight,
  -              pageHeight - mProps.marginTop - mProps.marginBottom);
  +        /* Create the page reference area rectangle (0,0 is at top left
  +        * of the "page media" and y increases
  +        * when moving towards the bottom of the page.
  +        * The media rectangle itself is (0,0,pageWidth,pageHeight).
  +        */
  +        Rectangle pageRefRect =
  +                new Rectangle(mProps.marginLeft, mProps.marginTop,
  +                        pageWidth - mProps.marginLeft - mProps.marginRight,
  +                        pageHeight - mProps.marginTop - mProps.marginBottom);
   
  -    // ??? KL shouldn't this take the viewport too???
  -    Page page = new Page();  // page reference area
  +        // ??? KL shouldn't this take the viewport too???
  +        Page page = new Page();  // page reference area
   
           // Set up the CTM on the page reference area based on writing-mode
           // and reference-orientation
  -    FODimension reldims=new FODimension(0,0);
  -    CTM pageCTM = propMgr.getCTMandRelDims(pageRefRect, reldims);
  +        FODimension reldims=new FODimension(0,0);
  +        CTM pageCTM = propMgr.getCTMandRelDims(pageRefRect, reldims);
   
  -    // Create a RegionViewport/ reference area pair for each page region
  +        // Create a RegionViewport/ reference area pair for each page region
   
  -    boolean bHasBody=false;
  +        boolean bHasBody=false;
   
           for (Iterator regenum = _regions.values().iterator();
  -                regenum.hasNext(); ) {
  +             regenum.hasNext(); ) {
               Region r = (Region)regenum.next();
  -        RegionViewport rvp = r.makeRegionViewport(reldims, pageCTM);
  -        rvp.setRegion(r.makeRegionReferenceArea(rvp.getViewArea()));
  -        page.setRegion(r.getRegionAreaClass(), rvp);
  -        if (r.getRegionAreaClass() == RegionReference.BODY) {
  -        bHasBody = true;
  -        }
  +            RegionViewport rvp = r.makeRegionViewport(reldims, pageCTM);
  +            rvp.setRegion(r.makeRegionReferenceArea(rvp.getViewArea()));
  +            page.setRegion(r.getRegionAreaClass(), rvp);
  +            if (r.getRegionAreaClass() == RegionReference.BODY) {
  +                bHasBody = true;
  +            }
           }
   
  -    if (!bHasBody) {
  +        if (!bHasBody) {
               getLogger().error("simple-page-master has no region-body");
           }
   
  -    this.pageMaster = new PageMaster(new PageViewport(page,
  -                       new Rectangle(0,0,
  -                             pageWidth,pageHeight)));
  +        this.pageMaster = new PageMaster(new PageViewport(page,
  +                new Rectangle(0,0,
  +                        pageWidth,pageHeight)));
   
  -    //  _regions = null; // PageSequence access SimplePageMaster....
  +        //  _regions = null; // PageSequence access SimplePageMaster....
           children = null;
           properties = null;
       }
  @@ -146,7 +147,7 @@
               addRegion((Region)child);
           } else {
               getLogger().error("SimplePageMaster cannot have child of type " +
  -                child.getName());
  +                    child.getName());
           }
       }
   
  @@ -154,8 +155,8 @@
           String key = region.getRegionClass();
           if (_regions.containsKey(key)) {
               getLogger().error("Only one region of class "
  -                              + key
  -                              + " allowed within a simple-page-master.");
  +                    + key
  +                    + " allowed within a simple-page-master.");
               // throw new FOPException("Only one region of class "
   //                                    + key
   //                                    + " allowed within a simple-page-master.");
  @@ -174,7 +175,7 @@
   
       protected boolean regionNameExists(String regionName) {
           for (Iterator regenum = _regions.values().iterator();
  -                regenum.hasNext(); ) {
  +             regenum.hasNext(); ) {
               Region r = (Region)regenum.next();
               if (r.getRegionName().equals(regionName)) {
                   return true;
  
  
  

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

Reply via email to