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 bc...@apache.org on 2005/08/31 22:30:49 UTC

svn commit: r265577 [1/5] - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/area/ src/java/org/apache/fop/datatypes/ src/java/org/apache/fop/fo/ src/java/org/apache/fop/fo/expr/ src/java/org/apache/fop/fo/flow/ src/java/org/apache/fop/fo/pagination/...

Author: bckfnn
Date: Wed Aug 31 13:29:33 2005
New Revision: 265577

URL: http://svn.apache.org/viewcvs?rev=265577&view=rev
Log:
Bugzilla #36379:
Revised percentage resolution system.
Submitted by: Manuel Mall <mm.at.arcus.com.au>

Slightly modified to avoid early evaluation of getValue().



Added:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBaseContext.java   (with props)
    xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java   (with props)
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/font-stretch.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/leader-alignment.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/leader-use-content.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/line-height.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/margin-block1.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/margin-block2.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/margin-region1.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/margin-region2.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/margin-region3.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/padding-block-container1.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/padding-block1.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/padding-list1.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/padding-list2.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/padding-table1.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/padding-table2.xml   (with props)
    xmlgraphics/fop/trunk/test/layoutengine/testcases/table3.xml   (with props)
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Page.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/Length.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/LengthBase.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/Numeric.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBase.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/Constants.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/InlineCharIterator.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/NumericOp.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/NumericProperty.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/PropertyInfo.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/PropertyParser.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/RGBColorFunction.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/Table.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/TableCell.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/Region.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionAfter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBA.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBefore.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionBody.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionEnd.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionSE.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/pagination/RegionStart.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/CommonFont.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/EnumLength.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FixedLength.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/NumberProperty.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/PercentLength.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/PropertyMaker.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/SpaceProperty.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/properties/TableColLength.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/LayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/TraitSetter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/BidiLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ContentLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ExternalGraphicLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/GridUnit.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/PrimaryGridUnit.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/SpaceVal.java
    xmlgraphics/fop/trunk/test/java/org/apache/fop/layoutengine/LayoutEngineTestSuite.java
    xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.txt
    xmlgraphics/fop/trunk/test/layoutengine/testcases/background-image-list1.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/background-image-list2.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/background-image-table1.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/background-image-table2.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/background-image-table3.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/background-image-table4.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/background-image-table5.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/background-image2.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/background-image3.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/background-image5.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/background-image7.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/external-graphic1.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/external-graphic2.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/external-graphic4.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/leader-dots.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/leader-rule.xml
    xmlgraphics/fop/trunk/test/layoutengine/testcases/leader-space.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Page.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Page.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Page.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Page.java Wed Aug 31 13:29:33 2005
@@ -25,7 +25,9 @@
 import java.util.Iterator;
 
 import org.apache.fop.datatypes.FODimension;
-import org.apache.fop.datatypes.PercentBase;
+import org.apache.fop.datatypes.LengthBase;
+import org.apache.fop.datatypes.PercentBaseContext;
+import org.apache.fop.datatypes.SimplePercentBaseContext;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.pagination.Region;
 import org.apache.fop.fo.pagination.RegionBody;
@@ -70,22 +72,35 @@
      *            page-reference-area
      */
     public Page(SimplePageMaster spm) {
-        int pageWidth = spm.getPageWidth().getValue();
-        int pageHeight = spm.getPageHeight().getValue();
+        // Width and Height of the page view port
+        FODimension pageViewPortDims = new FODimension(spm.getPageWidth().getValue()
+                            ,  spm.getPageHeight().getValue());
 
         // Get absolute margin properties (top, left, bottom, right)
         CommonMarginBlock mProps = spm.getCommonMarginBlock();
-
+        
         /*
          * 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).
          */
+        /* Special rules apply to resolving margins in the page context.
+         * Contrary to normal margins in this case top and bottom margin
+         * are resolved relative to the height. In the property subsystem
+         * all margin properties are configured to using BLOCK_WIDTH.
+         * That's why we 'cheat' here and setup a context for the height but
+         * use the LengthBase.BLOCK_WIDTH.
+         */
+        SimplePercentBaseContext pageWidthContext 
+            = new SimplePercentBaseContext(null, LengthBase.CONTAINING_BLOCK_WIDTH, pageViewPortDims.ipd);
+        SimplePercentBaseContext pageHeightContext
+            = new SimplePercentBaseContext(null, LengthBase.CONTAINING_BLOCK_WIDTH, pageViewPortDims.bpd);
+
         Rectangle pageRefRect =
-            new Rectangle(mProps.marginLeft.getValue(), mProps.marginTop.getValue(),
-            pageWidth - mProps.marginLeft.getValue() - mProps.marginRight.getValue(),
-            pageHeight - mProps.marginTop.getValue() - mProps.marginBottom.getValue());
+            new Rectangle(mProps.marginLeft.getValue(pageWidthContext), mProps.marginTop.getValue(pageHeightContext),
+            pageViewPortDims.ipd - mProps.marginLeft.getValue(pageWidthContext) - mProps.marginRight.getValue(pageWidthContext),
+            pageViewPortDims.bpd - mProps.marginTop.getValue(pageHeightContext) - mProps.marginBottom.getValue(pageHeightContext));
 
         // Set up the CTM on the page reference area based on writing-mode
         // and reference-orientation
@@ -98,9 +113,7 @@
         for (Iterator regenum = spm.getRegions().values().iterator();
             regenum.hasNext();) {
             Region r = (Region)regenum.next();
-            RegionViewport rvp = makeRegionViewport(r, reldims, pageCTM);
-            r.setLayoutDimension(PercentBase.BLOCK_IPD, rvp.getIPD());
-            r.setLayoutDimension(PercentBase.BLOCK_BPD, rvp.getBPD());
+            RegionViewport rvp = makeRegionViewport(r, reldims, pageCTM, pageViewPortDims);
             if (r.getNameId() == Constants.FO_REGION_BODY) {
                 rr = new BodyRegion((RegionBody) r, rvp);
             } else {
@@ -125,15 +138,16 @@
      * @param pageCTM page coordinate transformation matrix
      * @return the new region viewport
      */
-    private RegionViewport makeRegionViewport(Region r, FODimension reldims, CTM pageCTM) {
-        Rectangle2D relRegionRect = r.getViewportRectangle(reldims);
+    private RegionViewport makeRegionViewport(Region r, FODimension reldims, CTM pageCTM,
+        FODimension pageViewPortDims) {
+        Rectangle2D relRegionRect = r.getViewportRectangle(reldims, pageViewPortDims);
         Rectangle2D absRegionRect = pageCTM.transform(relRegionRect);
         // Get the region viewport rectangle in absolute coords by
         // transforming it using the page CTM
         RegionViewport rv = new RegionViewport(absRegionRect);
         rv.setBPD((int)relRegionRect.getHeight());
         rv.setIPD((int)relRegionRect.getWidth());
-        TraitSetter.addBackground(rv, r.getCommonBorderPaddingBackground());
+        TraitSetter.addBackground(rv, r.getCommonBorderPaddingBackground(), null);
         rv.setClip(r.getOverflow() == Constants.EN_HIDDEN 
                 || r.getOverflow() == Constants.EN_ERROR_IF_OVERFLOW);
         return rv;
@@ -263,5 +277,6 @@
     public HashMap getUnresolvedReferences() {
         return unresolved;
     }
+
 }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/Length.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/Length.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/Length.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/Length.java Wed Aug 31 13:29:33 2005
@@ -27,4 +27,12 @@
      * @return the length in millipoints
      */
     public int getValue();
+    
+    /**
+     * Returns the length in 1/1000ths of a point (millipoints)
+     * @param context The context for the length calculation (for percentage based lengths)
+     * @return the length in millipoints
+     */
+    public int getValue(PercentBaseContext context);
+
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/LengthBase.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/LengthBase.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/LengthBase.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/LengthBase.java Wed Aug 31 13:29:33 2005
@@ -36,67 +36,59 @@
     /** constant for an inh font-size percent-based length */
     public static final int INH_FONTSIZE = 2;
     /** constant for a containing box percent-based length */
-    public static final int CONTAINING_BOX = 3;
+    public static final int PARENT_AREA_WIDTH = 3;
     /** constant for a containing refarea percent-based length */
-    public static final int CONTAINING_REFAREA = 4;
+    public static final int CONTAINING_REFAREA_WIDTH = 4;
     /** constant for a containing block percent-based length */
-    public static final int BLOCK_WIDTH = 5;
+    public static final int CONTAINING_BLOCK_WIDTH = 5;
     /** constant for a containing block percent-based length */
-    public static final int BLOCK_HEIGHT = 6;
+    public static final int CONTAINING_BLOCK_HEIGHT = 6;
     /** constant for a image intrinsic percent-based length */
     public static final int IMAGE_INTRINSIC_WIDTH = 7;
     /** constant for a image intrinsic percent-based length */
     public static final int IMAGE_INTRINSIC_HEIGHT = 8;
+    /** constant for a image background position horizontal percent-based length */
+    public static final int IMAGE_BACKGROUND_POSITION_HORIZONTAL = 9;
+    /** constant for a image background position vertical percent-based length */
+    public static final int IMAGE_BACKGROUND_POSITION_VERTICAL = 10;
 
     /** array of valid percent-based length types */
     public static final int[] PERCENT_BASED_LENGTH_TYPES
-            = {CUSTOM_BASE, FONTSIZE, INH_FONTSIZE, CONTAINING_BOX,
-               CONTAINING_REFAREA, 
-               IMAGE_INTRINSIC_WIDTH, IMAGE_INTRINSIC_HEIGHT};
+            = {CUSTOM_BASE, FONTSIZE, INH_FONTSIZE, PARENT_AREA_WIDTH,
+               CONTAINING_REFAREA_WIDTH, 
+               IMAGE_INTRINSIC_WIDTH, IMAGE_INTRINSIC_HEIGHT,
+               IMAGE_BACKGROUND_POSITION_HORIZONTAL, IMAGE_BACKGROUND_POSITION_VERTICAL
+            };
 
     /**
-     * FO parent of the FO for which this property is to be calculated.
+     * The FO for which this property is to be calculated.
      */
-    protected /* final */ FObj parentFO;
-
-    /**
-     * PropertyList for the FO where this property is calculated.
-     */
-    private /* final */ PropertyList propertyList;
+    protected /* final */ FObj fobj;
 
     /**
      * One of the defined types of LengthBase
      */
     private /* final */ int iBaseType;
 
+    private Length fontSize;
+    
     /**
      * Constructor
      * @param parentFO parent FO for this
      * @param plist property list for this
      * @param iBaseType a member of {@link #PERCENT_BASED_LENGTH_TYPES}
      */
-    public LengthBase(FObj parentFO, PropertyList plist, int iBaseType) {
-        this.parentFO = parentFO;
-        this.propertyList = plist;
+    public LengthBase(FObj parentFO, PropertyList plist, int iBaseType) throws PropertyException {
+        this.fobj = plist.getFObj();
         this.iBaseType = iBaseType;
-    }
-
-    /**
-     * Accessor for parentFO object from subclasses which define
-     * custom kinds of LengthBase calculations.
-     * @return this object's parent FO
-     */
-    protected FObj getParentFO() {
-        return parentFO;
-    }
-
-    /**
-     * Accessor for propertyList object from subclasses which define
-     * custom kinds of LengthBase calculations.
-     * @return this object's PropertyList
-     */
-    protected PropertyList getPropertyList() {
-        return propertyList;
+        switch (iBaseType) {
+        case FONTSIZE:
+            this.fontSize = plist.get(Constants.PR_FONT_SIZE).getLength();
+            break;
+        case INH_FONTSIZE:
+            this.fontSize = plist.getInherited(Constants.PR_FONT_SIZE).getLength();
+            break;
+        }
     }
 
     /**
@@ -114,42 +106,17 @@
     }
 
     /** @see org.apache.fop.datatypes.PercentBase#getBaseLength() */
-    public int getBaseLength() throws PropertyException {
-        //TODO Don't use propertyList here
-        //See http://nagoya.apache.org/eyebrowse/ReadMsg?listName=fop-dev@xml.apache.org&msgNo=10342
-        switch (iBaseType) {
-        case FONTSIZE:
-            return propertyList.get(Constants.PR_FONT_SIZE).getLength().getValue();
-        case INH_FONTSIZE:
-            return propertyList.getInherited(Constants.PR_FONT_SIZE).getLength().getValue();
-        case BLOCK_WIDTH:
-            return parentFO.getLayoutDimension(PercentBase.BLOCK_IPD).intValue();
-        case BLOCK_HEIGHT:
-            return parentFO.getLayoutDimension(PercentBase.BLOCK_BPD).intValue();
-        case CONTAINING_REFAREA:    // example: start-indent, end-indent
-            FObj fo;
-            fo = parentFO;
-            while (fo != null && !fo.generatesReferenceAreas()) {
-                fo = fo.findNearestAncestorFObj();
-            }
-            if (fo != null && fo instanceof FObj) {
-                return fo.getLayoutDimension(PercentBase.BLOCK_IPD).intValue();
-            } else {
-                return 0;
+    public int getBaseLength(PercentBaseContext context) throws PropertyException {
+        int baseLength = 0;
+        if (context != null) {
+            if (iBaseType == FONTSIZE || iBaseType == INH_FONTSIZE) {
+                return fontSize.getValue(context);
             }
-        case IMAGE_INTRINSIC_WIDTH:
-            return propertyList.getFObj()
-                .getLayoutDimension(PercentBase.IMAGE_INTRINSIC_WIDTH).intValue();
-        case IMAGE_INTRINSIC_HEIGHT:
-            return propertyList.getFObj()
-                .getLayoutDimension(PercentBase.IMAGE_INTRINSIC_HEIGHT).intValue();
-        case CUSTOM_BASE:
-            //log.debug("!!! LengthBase.getBaseLength() called on CUSTOM_BASE type !!!");
-            return 0;
-        default:
-            parentFO.getLogger().error("Unknown base type for LengthBase.");
-            return 0;
+            baseLength =  context.getBaseLength(iBaseType,  fobj);
+        } else {
+            fobj.getLogger().error("getBaseLength called without context");
         }
+        return baseLength;
     }
 
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/Numeric.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/Numeric.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/Numeric.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/Numeric.java Wed Aug 31 13:29:33 2005
@@ -41,6 +41,14 @@
     double getNumericValue() throws PropertyException;
     
     /**
+     * Return the value of this Numeric
+     * @param context The context for the length calculation (for percentage based lengths)
+     * @return the computed value.
+     * @throws PropertyException
+     */
+    double getNumericValue(PercentBaseContext context) throws PropertyException;
+
+    /**
      * Return the dimension of this numeric. Plain numbers has a dimension of
      * 0 and length has a dimension of 1. Other dimension can occur as a result
      * of multiplications and divisions.
@@ -60,6 +68,13 @@
      * @return the value as an integer.
      */
     public int getValue();
+
+    /**
+     * Returns the value of this numeric as an int.
+     * @param conext The context for the length calculation (for percentage based lengths)
+     * @return the value as an integer.
+     */
+    public int getValue(PercentBaseContext context);
 
     /**
      * Return the resolved value. This method will becalled during evaluation 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBase.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBase.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBase.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBase.java Wed Aug 31 13:29:33 2005
@@ -30,18 +30,6 @@
     
     /** table units */
     LayoutDimension TABLE_UNITS = new LayoutDimension("table-units");
-    /** Block IPD */
-    LayoutDimension BLOCK_IPD = new LayoutDimension("block-ipd");
-    /** Block BPD */
-    LayoutDimension BLOCK_BPD = new LayoutDimension("block-bpd");
-    /** Reference Area IPD */
-    LayoutDimension REFERENCE_AREA_IPD = new LayoutDimension("reference-area-ipd");
-    /** Reference Area BPD */
-    LayoutDimension REFERENCE_AREA_BPD = new LayoutDimension("reference-area-bpd");
-    /** Intrinsic width of an image or foreign-object */ 
-    LayoutDimension IMAGE_INTRINSIC_WIDTH = new LayoutDimension("image-intrinsic-width");
-    /** Intrinsic height of an image or foreign-object */ 
-    LayoutDimension IMAGE_INTRINSIC_HEIGHT = new LayoutDimension("image-intrinsic-heigth");
     
     /**
      * Determines whether a numeric property is created or one with a percentage
@@ -53,13 +41,14 @@
     double getBaseValue();
 
     /**
+     * @param context The context for percentage evaluation
      * @return the integer size in millipoints of the object (this will be used 
      * as the base to which a percentage will be applied to compute the length 
      * of the referencing item)
      * @throws PropertyException if a problem occurs during evaluation of this
      *     value.
      */
-    int getBaseLength() throws PropertyException;
+    int getBaseLength(PercentBaseContext context) throws PropertyException;
     
     /** Enum class for dimension types. */
     public class LayoutDimension {

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBaseContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBaseContext.java?rev=265577&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBaseContext.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBaseContext.java Wed Aug 31 13:29:33 2005
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id $ */
+ 
+package org.apache.fop.datatypes;
+
+import org.apache.fop.fo.FObj;
+
+/**
+ * This interface is used by the layout managers to provide relevant information
+ * back to the property percentage resolution logic, that is
+ * the percentages based property getValue() functions expect an object implementing
+ * this interface as an argument.
+ */
+public interface PercentBaseContext {
+
+    /**
+     * Returns the base length for the given length base.
+     * Length base should be one of the constants defined in {@link LengthBase}.
+     * @param lengthBase Indicates which type of the base length value is to be returned
+     * @param fobj The FO object against which the percentage should be evaluated
+     * @return The base length value of the given kind
+     */
+    public int getBaseLength(int lengthBase, FObj fobj);
+    
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBaseContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/PercentBaseContext.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java?rev=265577&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java (added)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java Wed Aug 31 13:29:33 2005
@@ -0,0 +1,51 @@
+/*
+ * SimplePercentBaseContext.java
+ *
+ * Created on 29 August 2005, 17:02
+ *
+ * To change this template, choose Tools | Options and locate the template under
+ * the Source Creation and Management node. Right-click the template and choose
+ * Open. You can then make changes to the template in the Source Editor.
+ */
+
+package org.apache.fop.datatypes;
+
+import org.apache.fop.fo.FObj;
+
+/**
+ * Class to implement a simple lookup context for a single percent base value.
+ */
+public class SimplePercentBaseContext implements PercentBaseContext {
+    
+    private PercentBaseContext parentContext;
+    private int lengthBase;
+    private int lengthBaseValue;
+
+    /**
+     * @param parentContext the context to be used for all percentages other than lengthBase
+     * @param lengthBase the particular percentage length base for which this context provides a value
+     * @param lengthBaseValue the value to be returned for requests to the given lengthBase
+     */
+    public SimplePercentBaseContext(PercentBaseContext parentContext,
+                             int lengthBase,
+                             int lengthBaseValue) {
+        this.parentContext = parentContext;
+        this.lengthBase = lengthBase;
+        this.lengthBaseValue = lengthBaseValue;
+    }
+
+    /**
+     * Returns the value for the given lengthBase.
+     * @see org.apache.fop.datatypes.PercentBaseContext#getBaseLength(int, fobj)
+     */
+    public int getBaseLength(int lengthBase, FObj fobj) {
+        // if its for us return our value otherwise delegate to parent context
+        if (lengthBase == this.lengthBase) {
+            return lengthBaseValue;
+        } else if (parentContext != null) {
+            return parentContext.getBaseLength(lengthBase, fobj);
+        }
+        return -1;
+    }
+
+}

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/Constants.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/Constants.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/Constants.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/Constants.java Wed Aug 31 13:29:33 2005
@@ -16,9 +16,18 @@
 
 /* $Id$ */
 
-
 package org.apache.fop.fo;
 
+/**
+ * Definition of constants used throughout FOP.
+ * There are sets of constants describing:
+ * <ul>
+ * <li>Input and output formats</li>
+ * <li>Formatting objects</li>
+ * <li>Formatting properties</li>
+ * <li>Enumerated values used in formatting properties</li>
+ * </ul>
+ */
 public interface Constants {
 
     /* These constants are used by apps.CommandLineOptions and
@@ -27,6 +36,7 @@
        
     /** render constants for bounds checking */
     int RENDER_MIN_CONST = 1;
+    /** render constants for bounds checking */
     int RENDER_MAX_CONST = 12;
     /** input / output not set */
     int NOT_SET = 0;
@@ -60,505 +70,1006 @@
     int RENDER_PNG = 12;
 
     // element constants
-    int FO_UNKNOWN_NODE = 0;  // FObj base class
+    /** FObj base class */
+    int FO_UNKNOWN_NODE = 0;
+    /** FO element constant */
     int FO_BASIC_LINK = 1;
+    /** FO element constant */
     int FO_BIDI_OVERRIDE = 2;
+    /** FO element constant */
     int FO_BLOCK = 3;
+    /** FO element constant */
     int FO_BLOCK_CONTAINER = 4;
+    /** FO element constant */
     int FO_CHARACTER = 5;
+    /** FO element constant */
     int FO_COLOR_PROFILE = 6;
+    /** FO element constant */
     int FO_CONDITIONAL_PAGE_MASTER_REFERENCE = 7;
+    /** FO element constant */
     int FO_DECLARATIONS = 8;
+    /** FO element constant */
     int FO_EXTERNAL_GRAPHIC = 9;
+    /** FO element constant */
     int FO_FLOAT = 10;
+    /** FO element constant */
     int FO_FLOW = 11;
+    /** FO element constant */
     int FO_FOOTNOTE = 12;
+    /** FO element constant */
     int FO_FOOTNOTE_BODY = 13;
+    /** FO element constant */
     int FO_INITIAL_PROPERTY_SET = 14;
+    /** FO element constant */
     int FO_INLINE = 15;
+    /** FO element constant */
     int FO_INLINE_CONTAINER = 16;
+    /** FO element constant */
     int FO_INSTREAM_FOREIGN_OBJECT = 17;
+    /** FO element constant */
     int FO_LAYOUT_MASTER_SET = 18;
+    /** FO element constant */
     int FO_LEADER = 19;
+    /** FO element constant */
     int FO_LIST_BLOCK = 20;
+    /** FO element constant */
     int FO_LIST_ITEM = 21;
+    /** FO element constant */
     int FO_LIST_ITEM_BODY = 22;
+    /** FO element constant */
     int FO_LIST_ITEM_LABEL = 23;
+    /** FO element constant */
     int FO_MARKER = 24;
+    /** FO element constant */
     int FO_MULTI_CASE = 25;
+    /** FO element constant */
     int FO_MULTI_PROPERTIES = 26;
+    /** FO element constant */
     int FO_MULTI_PROPERTY_SET = 27;
+    /** FO element constant */
     int FO_MULTI_SWITCH = 28;
+    /** FO element constant */
     int FO_MULTI_TOGGLE = 29;
+    /** FO element constant */
     int FO_PAGE_NUMBER = 30;
+    /** FO element constant */
     int FO_PAGE_NUMBER_CITATION = 31;
+    /** FO element constant */
     int FO_PAGE_SEQUENCE = 32;
+    /** FO element constant */
     int FO_PAGE_SEQUENCE_MASTER = 33;
+    /** FO element constant */
     int FO_REGION_AFTER = 34;
+    /** FO element constant */
     int FO_REGION_BEFORE = 35;
+    /** FO element constant */
     int FO_REGION_BODY = 36;
+    /** FO element constant */
     int FO_REGION_END = 37;
+    /** FO element constant */
     int FO_REGION_START = 38;
+    /** FO element constant */
     int FO_REPEATABLE_PAGE_MASTER_ALTERNATIVES = 39;
+    /** FO element constant */
     int FO_REPEATABLE_PAGE_MASTER_REFERENCE = 40;
+    /** FO element constant */
     int FO_RETRIEVE_MARKER = 41;
+    /** FO element constant */
     int FO_ROOT = 42;
+    /** FO element constant */
     int FO_SIMPLE_PAGE_MASTER = 43;
+    /** FO element constant */
     int FO_SINGLE_PAGE_MASTER_REFERENCE = 44;
+    /** FO element constant */
     int FO_STATIC_CONTENT = 45;
+    /** FO element constant */
     int FO_TABLE = 46;
+    /** FO element constant */
     int FO_TABLE_AND_CAPTION = 47;
+    /** FO element constant */
     int FO_TABLE_BODY = 48;
+    /** FO element constant */
     int FO_TABLE_CAPTION = 49;
+    /** FO element constant */
     int FO_TABLE_CELL = 50;
+    /** FO element constant */
     int FO_TABLE_COLUMN = 51;
+    /** FO element constant */
     int FO_TABLE_FOOTER = 52;
+    /** FO element constant */
     int FO_TABLE_HEADER = 53;
+    /** FO element constant */
     int FO_TABLE_ROW = 54;
+    /** FO element constant */
     int FO_TITLE = 55;
+    /** FO element constant */
     int FO_WRAPPER = 56;
-    int FO_BOOKMARK_TREE = 57;          // XSL 1.1
-    int FO_BOOKMARK = 58;               // XSL 1.1
-    int FO_BOOKMARK_TITLE = 59;         // XSL 1.1
-    int FO_PAGE_SEQUENCE_WRAPPER = 60;  // XSL 1.1
+    /** FO element constant - XSL 1.1 */
+    int FO_BOOKMARK_TREE = 57;
+    /** FO element constant - XSL 1.1 */
+    int FO_BOOKMARK = 58;
+    /** FO element constant - XSL 1.1 */
+    int FO_BOOKMARK_TITLE = 59;
+    /** FO element constant - XSL 1.1 */
+    int FO_PAGE_SEQUENCE_WRAPPER = 60;
+    /** Number of FO element constants defined */
     int FRM_OBJ_COUNT = 60;
     
     // Masks
+    /** 
+     * For compound properties the property constant value is shifted by this amount.
+     * The low order bits hold the constant for the component property.
+     */
     int COMPOUND_SHIFT = 9;
-    int PROPERTY_MASK = (1 << COMPOUND_SHIFT)-1;
+    /** 
+     * Mask that when applied to a compound property returns the constant of
+     * the component property.
+     */
+    int PROPERTY_MASK = (1 << COMPOUND_SHIFT) - 1;
+    /** 
+     * Mask that when applied to a compound property returns the constant of
+     * the compound property.
+     */
     int COMPOUND_MASK = ~PROPERTY_MASK;
+    /** Number of compund properties defined */
     int COMPOUND_COUNT = 11;
     
     // property constants
+    /** Property constant */
     int PR_ABSOLUTE_POSITION = 1;
+    /** Property constant */
     int PR_ACTIVE_STATE = 2;
+    /** Property constant */
     int PR_ALIGNMENT_ADJUST = 3;
+    /** Property constant */
     int PR_ALIGNMENT_BASELINE = 4;
+    /** Property constant */
     int PR_AUTO_RESTORE = 5;
+    /** Property constant */
     int PR_AZIMUTH = 6;
+    /** Property constant */
     int PR_BACKGROUND = 7;
+    /** Property constant */
     int PR_BACKGROUND_ATTACHMENT = 8;
+    /** Property constant */
     int PR_BACKGROUND_COLOR = 9;
+    /** Property constant */
     int PR_BACKGROUND_IMAGE = 10;
+    /** Property constant */
     int PR_BACKGROUND_POSITION = 11;
+    /** Property constant */
     int PR_BACKGROUND_POSITION_HORIZONTAL = 12;
+    /** Property constant */
     int PR_BACKGROUND_POSITION_VERTICAL = 13;
+    /** Property constant */
     int PR_BACKGROUND_REPEAT = 14;
+    /** Property constant */
     int PR_BASELINE_SHIFT = 15;
+    /** Property constant */
     int PR_BLANK_OR_NOT_BLANK = 16;
+    /** Property constant */
     int PR_BLOCK_PROGRESSION_DIMENSION = 17;
+    /** Property constant */
     int PR_BORDER = 18;
+    /** Property constant */
     int PR_BORDER_AFTER_COLOR = 19;
+    /** Property constant */
     int PR_BORDER_AFTER_PRECEDENCE = 20;
+    /** Property constant */
     int PR_BORDER_AFTER_STYLE = 21;
+    /** Property constant */
     int PR_BORDER_AFTER_WIDTH = 22;
+    /** Property constant */
     int PR_BORDER_BEFORE_COLOR = 23;
+    /** Property constant */
     int PR_BORDER_BEFORE_PRECEDENCE = 24;
+    /** Property constant */
     int PR_BORDER_BEFORE_STYLE = 25;
+    /** Property constant */
     int PR_BORDER_BEFORE_WIDTH = 26;
+    /** Property constant */
     int PR_BORDER_BOTTOM = 27;
+    /** Property constant */
     int PR_BORDER_BOTTOM_COLOR = 28;
+    /** Property constant */
     int PR_BORDER_BOTTOM_STYLE = 29;
+    /** Property constant */
     int PR_BORDER_BOTTOM_WIDTH = 30;
+    /** Property constant */
     int PR_BORDER_COLLAPSE = 31;
+    /** Property constant */
     int PR_BORDER_COLOR = 32;
+    /** Property constant */
     int PR_BORDER_END_COLOR = 33;
+    /** Property constant */
     int PR_BORDER_END_PRECEDENCE = 34;
+    /** Property constant */
     int PR_BORDER_END_STYLE = 35;
+    /** Property constant */
     int PR_BORDER_END_WIDTH = 36;
+    /** Property constant */
     int PR_BORDER_LEFT = 37;
+    /** Property constant */
     int PR_BORDER_LEFT_COLOR = 38;
+    /** Property constant */
     int PR_BORDER_LEFT_STYLE = 39;
+    /** Property constant */
     int PR_BORDER_LEFT_WIDTH = 40;
+    /** Property constant */
     int PR_BORDER_RIGHT = 41;
+    /** Property constant */
     int PR_BORDER_RIGHT_COLOR = 42;
+    /** Property constant */
     int PR_BORDER_RIGHT_STYLE = 43;
+    /** Property constant */
     int PR_BORDER_RIGHT_WIDTH = 44;
+    /** Property constant */
     int PR_BORDER_SEPARATION = 45;
+    /** Property constant */
     int PR_BORDER_SPACING = 46;
+    /** Property constant */
     int PR_BORDER_START_COLOR = 47;
+    /** Property constant */
     int PR_BORDER_START_PRECEDENCE = 48;
+    /** Property constant */
     int PR_BORDER_START_STYLE = 49;
+    /** Property constant */
     int PR_BORDER_START_WIDTH = 50;
+    /** Property constant */
     int PR_BORDER_STYLE = 51;
+    /** Property constant */
     int PR_BORDER_TOP = 52;
+    /** Property constant */
     int PR_BORDER_TOP_COLOR = 53;
+    /** Property constant */
     int PR_BORDER_TOP_STYLE = 54;
+    /** Property constant */
     int PR_BORDER_TOP_WIDTH = 55;
+    /** Property constant */
     int PR_BORDER_WIDTH = 56;
+    /** Property constant */
     int PR_BOTTOM = 57;
+    /** Property constant */
     int PR_BREAK_AFTER = 58;
+    /** Property constant */
     int PR_BREAK_BEFORE = 59;
+    /** Property constant */
     int PR_CAPTION_SIDE = 60;
+    /** Property constant */
     int PR_CASE_NAME = 61;
+    /** Property constant */
     int PR_CASE_TITLE = 62;
+    /** Property constant */
     int PR_CHARACTER = 63;
+    /** Property constant */
     int PR_CLEAR = 64;
+    /** Property constant */
     int PR_CLIP = 65;
+    /** Property constant */
     int PR_COLOR = 66;
+    /** Property constant */
     int PR_COLOR_PROFILE_NAME = 67;
+    /** Property constant */
     int PR_COLUMN_COUNT = 68;
+    /** Property constant */
     int PR_COLUMN_GAP = 69;
+    /** Property constant */
     int PR_COLUMN_NUMBER = 70;
+    /** Property constant */
     int PR_COLUMN_WIDTH = 71;
+    /** Property constant */
     int PR_CONTENT_HEIGHT = 72;
+    /** Property constant */
     int PR_CONTENT_TYPE = 73;
+    /** Property constant */
     int PR_CONTENT_WIDTH = 74;
+    /** Property constant */
     int PR_COUNTRY = 75;
+    /** Property constant */
     int PR_CUE = 76;
+    /** Property constant */
     int PR_CUE_AFTER = 77;
+    /** Property constant */
     int PR_CUE_BEFORE = 78;
+    /** Property constant */
     int PR_DESTINATION_PLACEMENT_OFFSET = 79;
+    /** Property constant */
     int PR_DIRECTION = 80;
+    /** Property constant */
     int PR_DISPLAY_ALIGN = 81;
+    /** Property constant */
     int PR_DOMINANT_BASELINE = 82;
+    /** Property constant */
     int PR_ELEVATION = 83;
+    /** Property constant */
     int PR_EMPTY_CELLS = 84;
+    /** Property constant */
     int PR_END_INDENT = 85;
+    /** Property constant */
     int PR_ENDS_ROW = 86;
+    /** Property constant */
     int PR_EXTENT = 87;
+    /** Property constant */
     int PR_EXTERNAL_DESTINATION = 88;
+    /** Property constant */
     int PR_FLOAT = 89;
+    /** Property constant */
     int PR_FLOW_NAME = 90;
+    /** Property constant */
     int PR_FONT = 91;
+    /** Property constant */
     int PR_FONT_FAMILY = 92;
+    /** Property constant */
     int PR_FONT_SELECTION_STRATEGY = 93;
+    /** Property constant */
     int PR_FONT_SIZE = 94;
+    /** Property constant */
     int PR_FONT_SIZE_ADJUST = 95;
+    /** Property constant */
     int PR_FONT_STRETCH = 96;
+    /** Property constant */
     int PR_FONT_STYLE = 97;
+    /** Property constant */
     int PR_FONT_VARIANT = 98;
+    /** Property constant */
     int PR_FONT_WEIGHT = 99;
+    /** Property constant */
     int PR_FORCE_PAGE_COUNT = 100;
+    /** Property constant */
     int PR_FORMAT = 101;
+    /** Property constant */
     int PR_GLYPH_ORIENTATION_HORIZONTAL = 102;
+    /** Property constant */
     int PR_GLYPH_ORIENTATION_VERTICAL = 103;
+    /** Property constant */
     int PR_GROUPING_SEPARATOR = 104;
+    /** Property constant */
     int PR_GROUPING_SIZE = 105;
+    /** Property constant */
     int PR_HEIGHT = 106;
+    /** Property constant */
     int PR_HYPHENATE = 107;
+    /** Property constant */
     int PR_HYPHENATION_CHARACTER = 108;
+    /** Property constant */
     int PR_HYPHENATION_KEEP = 109;
+    /** Property constant */
     int PR_HYPHENATION_LADDER_COUNT = 110;
+    /** Property constant */
     int PR_HYPHENATION_PUSH_CHARACTER_COUNT = 111;
+    /** Property constant */
     int PR_HYPHENATION_REMAIN_CHARACTER_COUNT = 112;
+    /** Property constant */
     int PR_ID = 113;
+    /** Property constant */
     int PR_INDICATE_DESTINATION = 114;
+    /** Property constant */
     int PR_INITIAL_PAGE_NUMBER = 115;
+    /** Property constant */
     int PR_INLINE_PROGRESSION_DIMENSION = 116;
+    /** Property constant */
     int PR_INTERNAL_DESTINATION = 117;
+    /** Property constant */
     int PR_KEEP_TOGETHER = 118;
+    /** Property constant */
     int PR_KEEP_WITH_NEXT = 119;
+    /** Property constant */
     int PR_KEEP_WITH_PREVIOUS = 120;
+    /** Property constant */
     int PR_LANGUAGE = 121;
+    /** Property constant */
     int PR_LAST_LINE_END_INDENT = 122;
+    /** Property constant */
     int PR_LEADER_ALIGNMENT = 123;
+    /** Property constant */
     int PR_LEADER_LENGTH = 124;
+    /** Property constant */
     int PR_LEADER_PATTERN = 125;
+    /** Property constant */
     int PR_LEADER_PATTERN_WIDTH = 126;
+    /** Property constant */
     int PR_LEFT = 127;
+    /** Property constant */
     int PR_LETTER_SPACING = 128;
+    /** Property constant */
     int PR_LETTER_VALUE = 129;
+    /** Property constant */
     int PR_LINEFEED_TREATMENT = 130;
+    /** Property constant */
     int PR_LINE_HEIGHT = 131;
+    /** Property constant */
     int PR_LINE_HEIGHT_SHIFT_ADJUSTMENT = 132;
+    /** Property constant */
     int PR_LINE_STACKING_STRATEGY = 133;
+    /** Property constant */
     int PR_MARGIN = 134;
+    /** Property constant */
     int PR_MARGIN_BOTTOM = 135;
+    /** Property constant */
     int PR_MARGIN_LEFT = 136;
+    /** Property constant */
     int PR_MARGIN_RIGHT = 137;
+    /** Property constant */
     int PR_MARGIN_TOP = 138;
+    /** Property constant */
     int PR_MARKER_CLASS_NAME = 139;
+    /** Property constant */
     int PR_MASTER_NAME = 140;
+    /** Property constant */
     int PR_MASTER_REFERENCE = 141;
+    /** Property constant */
     int PR_MAX_HEIGHT = 142;
+    /** Property constant */
     int PR_MAXIMUM_REPEATS = 143;
+    /** Property constant */
     int PR_MAX_WIDTH = 144;
+    /** Property constant */
     int PR_MEDIA_USAGE = 145;
+    /** Property constant */
     int PR_MIN_HEIGHT = 146;
+    /** Property constant */
     int PR_MIN_WIDTH = 147;
+    /** Property constant */
     int PR_NUMBER_COLUMNS_REPEATED = 148;
+    /** Property constant */
     int PR_NUMBER_COLUMNS_SPANNED = 149;
+    /** Property constant */
     int PR_NUMBER_ROWS_SPANNED = 150;
+    /** Property constant */
     int PR_ODD_OR_EVEN = 151;
+    /** Property constant */
     int PR_ORPHANS = 152;
+    /** Property constant */
     int PR_OVERFLOW = 153;
+    /** Property constant */
     int PR_PADDING = 154;
+    /** Property constant */
     int PR_PADDING_AFTER = 155;
+    /** Property constant */
     int PR_PADDING_BEFORE = 156;
+    /** Property constant */
     int PR_PADDING_BOTTOM = 157;
+    /** Property constant */
     int PR_PADDING_END = 158;
+    /** Property constant */
     int PR_PADDING_LEFT = 159;
+    /** Property constant */
     int PR_PADDING_RIGHT = 160;
+    /** Property constant */
     int PR_PADDING_START = 161;
+    /** Property constant */
     int PR_PADDING_TOP = 162;
+    /** Property constant */
     int PR_PAGE_BREAK_AFTER = 163;
+    /** Property constant */
     int PR_PAGE_BREAK_BEFORE = 164;
+    /** Property constant */
     int PR_PAGE_BREAK_INSIDE = 165;
+    /** Property constant */
     int PR_PAGE_HEIGHT = 166;
+    /** Property constant */
     int PR_PAGE_POSITION = 167;
+    /** Property constant */
     int PR_PAGE_WIDTH = 168;
+    /** Property constant */
     int PR_PAUSE = 169;
+    /** Property constant */
     int PR_PAUSE_AFTER = 170;
+    /** Property constant */
     int PR_PAUSE_BEFORE = 171;
+    /** Property constant */
     int PR_PITCH = 172;
+    /** Property constant */
     int PR_PITCH_RANGE = 173;
+    /** Property constant */
     int PR_PLAY_DURING = 174;
+    /** Property constant */
     int PR_POSITION = 175;
+    /** Property constant */
     int PR_PRECEDENCE = 176;
+    /** Property constant */
     int PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS = 177;
+    /** Property constant */
     int PR_PROVISIONAL_LABEL_SEPARATION = 178;
+    /** Property constant */
     int PR_REFERENCE_ORIENTATION = 179;
+    /** Property constant */
     int PR_REF_ID = 180;
+    /** Property constant */
     int PR_REGION_NAME = 181;
+    /** Property constant */
     int PR_RELATIVE_ALIGN = 182;
+    /** Property constant */
     int PR_RELATIVE_POSITION = 183;
+    /** Property constant */
     int PR_RENDERING_INTENT = 184;
+    /** Property constant */
     int PR_RETRIEVE_BOUNDARY = 185;
+    /** Property constant */
     int PR_RETRIEVE_CLASS_NAME = 186;
+    /** Property constant */
     int PR_RETRIEVE_POSITION = 187;
+    /** Property constant */
     int PR_RICHNESS = 188;
+    /** Property constant */
     int PR_RIGHT = 189;
+    /** Property constant */
     int PR_ROLE = 190;
+    /** Property constant */
     int PR_RULE_STYLE = 191;
+    /** Property constant */
     int PR_RULE_THICKNESS = 192;
+    /** Property constant */
     int PR_SCALING = 193;
+    /** Property constant */
     int PR_SCALING_METHOD = 194;
+    /** Property constant */
     int PR_SCORE_SPACES = 195;
+    /** Property constant */
     int PR_SCRIPT = 196;
+    /** Property constant */
     int PR_SHOW_DESTINATION = 197;
+    /** Property constant */
     int PR_SIZE = 198;
+    /** Property constant */
     int PR_SOURCE_DOCUMENT = 199;
+    /** Property constant */
     int PR_SPACE_AFTER = 200;
+    /** Property constant */
     int PR_SPACE_BEFORE = 201;
+    /** Property constant */
     int PR_SPACE_END = 202;
+    /** Property constant */
     int PR_SPACE_START = 203;
+    /** Property constant */
     int PR_SPAN = 204;
+    /** Property constant */
     int PR_SPEAK = 205;
+    /** Property constant */
     int PR_SPEAK_HEADER = 206;
+    /** Property constant */
     int PR_SPEAK_NUMERAL = 207;
+    /** Property constant */
     int PR_SPEAK_PUNCTUATION = 208;
+    /** Property constant */
     int PR_SPEECH_RATE = 209;
+    /** Property constant */
     int PR_SRC = 210;
+    /** Property constant */
     int PR_START_INDENT = 211;
+    /** Property constant */
     int PR_STARTING_STATE = 212;
+    /** Property constant */
     int PR_STARTS_ROW = 213;
+    /** Property constant */
     int PR_STRESS = 214;
+    /** Property constant */
     int PR_SUPPRESS_AT_LINE_BREAK = 215;
+    /** Property constant */
     int PR_SWITCH_TO = 216;
+    /** Property constant */
     int PR_TABLE_LAYOUT = 217;
+    /** Property constant */
     int PR_TABLE_OMIT_FOOTER_AT_BREAK = 218;
+    /** Property constant */
     int PR_TABLE_OMIT_HEADER_AT_BREAK = 219;
+    /** Property constant */
     int PR_TARGET_PRESENTATION_CONTEXT = 220;
+    /** Property constant */
     int PR_TARGET_PROCESSING_CONTEXT = 221;
+    /** Property constant */
     int PR_TARGET_STYLESHEET = 222;
+    /** Property constant */
     int PR_TEXT_ALIGN = 223;
+    /** Property constant */
     int PR_TEXT_ALIGN_LAST = 224;
+    /** Property constant */
     int PR_TEXT_ALTITUDE = 225;
+    /** Property constant */
     int PR_TEXT_DECORATION = 226;
+    /** Property constant */
     int PR_TEXT_DEPTH = 227;
+    /** Property constant */
     int PR_TEXT_INDENT = 228;
+    /** Property constant */
     int PR_TEXT_SHADOW = 229;
+    /** Property constant */
     int PR_TEXT_TRANSFORM = 230;
+    /** Property constant */
     int PR_TOP = 231;
+    /** Property constant */
     int PR_TREAT_AS_WORD_SPACE = 232;
+    /** Property constant */
     int PR_UNICODE_BIDI = 233;
+    /** Property constant */
     int PR_VERTICAL_ALIGN = 234;
+    /** Property constant */
     int PR_VISIBILITY = 235;
+    /** Property constant */
     int PR_VOICE_FAMILY = 236;
+    /** Property constant */
     int PR_VOLUME = 237;
+    /** Property constant */
     int PR_WHITE_SPACE_COLLAPSE = 238;
+    /** Property constant */
     int PR_WHITE_SPACE_TREATMENT = 239;
+    /** Property constant */
     int PR_WIDOWS = 240;
+    /** Property constant */
     int PR_WIDTH = 241;
+    /** Property constant */
     int PR_WORD_SPACING = 242;
+    /** Property constant */
     int PR_WRAP_OPTION = 243;
+    /** Property constant */
     int PR_WRITING_MODE = 244;
+    /** Property constant */
     int PR_XML_LANG = 245;
+    /** Property constant */
     int PR_Z_INDEX = 246;
+    /** Property constant */
     int PR_INTRUSION_DISPLACE = 247;
-    int PR_INDEX_CLASS = 248;   // XSL 1.1
-    int PR_INDEX_KEY = 249;     // XSL 1.1
-    int PR_X_BLOCK_PROGRESSION_UNIT = 250; //Custom extension
+    /** Property constant - XSL 1.1 */
+    int PR_INDEX_CLASS = 248;
+    /** Property constant - XSL 1.1 */
+    int PR_INDEX_KEY = 249;
+    /** Property constant - Custom extension */
+    int PR_X_BLOCK_PROGRESSION_UNIT = 250;
+    /** Number of property constants defined */
     int PROPERTY_COUNT = 250;
 
     // compound property constants
 
+    /** Property constant for compund property */
     int CP_BLOCK_PROGRESSION_DIRECTION = 1 << COMPOUND_SHIFT;
+    /** Property constant for compund property */
     int CP_CONDITIONALITY = 2 << COMPOUND_SHIFT;
+    /** Property constant for compund property */
     int CP_INLINE_PROGRESSION_DIRECTION = 3 << COMPOUND_SHIFT;
+    /** Property constant for compund property */
     int CP_LENGTH = 4 << COMPOUND_SHIFT;
+    /** Property constant for compund property */
     int CP_MAXIMUM = 5 << COMPOUND_SHIFT;
+    /** Property constant for compund property */
     int CP_MINIMUM = 6 << COMPOUND_SHIFT;
+    /** Property constant for compund property */
     int CP_OPTIMUM = 7 << COMPOUND_SHIFT;
+    /** Property constant for compund property */
     int CP_PRECEDENCE = 8 << COMPOUND_SHIFT;
+    /** Property constant for compund property */
     int CP_WITHIN_COLUMN = 9 << COMPOUND_SHIFT;
+    /** Property constant for compund property */
     int CP_WITHIN_LINE = 10 << COMPOUND_SHIFT;
+    /** Property constant for compund property */
     int CP_WITHIN_PAGE = 11 << COMPOUND_SHIFT;
 
     // Enumeration constants
+    /** Enumeration constant */
     int EN_ABSOLUTE = 1;
+    /** Enumeration constant */
     int EN_ABSOLUTE_COLORMETRIC = 2;
+    /** Enumeration constant */
     int EN_AFTER = 3;
+    /** Enumeration constant */
     int EN_AFTER_EDGE = 4;
+    /** Enumeration constant */
     int EN_ALL = 5;
+    /** Enumeration constant */
     int EN_ALPHABETIC = 6;
+    /** Enumeration constant */
     int EN_ALWAYS = 7;
+    /** Enumeration constant */
     int EN_ANY = 8;
+    /** Enumeration constant */
     int EN_AUTO = 9;
+    /** Enumeration constant */
     int EN_AUTO_EVEN = 10;
+    /** Enumeration constant */
     int EN_AUTO_ODD = 11;
+    /** Enumeration constant */
     int EN_BASELINE = 12;
+    /** Enumeration constant */
     int EN_BEFORE = 13;
+    /** Enumeration constant */
     int EN_BEFORE_EDGE = 14;
+    /** Enumeration constant */
     int EN_BIDI_OVERRIDE = 15;
+    /** Enumeration constant */
     int EN_BLANK = 16;
+    /** Enumeration constant */
     int EN_BLINK = 17;
+    /** Enumeration constant */
     int EN_BLOCK = 18;
+    /** Enumeration constant */
     int EN_BOTH = 19;
+    /** Enumeration constant */
     int EN_BOTTOM = 20;
+    /** Enumeration constant */
     int EN_BOUNDED_IN_ONE_DIMENSION = 21;
+    /** Enumeration constant */
     int EN_CAPITALIZE = 22;
+    /** Enumeration constant */
     int EN_CENTER = 23;
+    /** Enumeration constant */
     int EN_CENTRAL = 24;
+    /** Enumeration constant */
     int EN_CHARACTER_BY_CHARACTER = 25;
+    /** Enumeration constant */
     int EN_COLLAPSE = 26;
+    /** Enumeration constant */
     int EN_COLLAPSE_WITH_PRECEDENCE = 27;
+    /** Enumeration constant */
     int EN_COLUMN = 28;
+    /** Enumeration constant */
     int EN_CONDENSED = 29;
+    /** Enumeration constant */
     int EN_CONSIDER_SHIFTS = 30;
+    /** Enumeration constant */
     int EN_DASHED = 31;
+    /** Enumeration constant */
     int EN_DISCARD = 32;
+    /** Enumeration constant */
     int EN_DISREGARD_SHIFTS = 33;
+    /** Enumeration constant */
     int EN_DOCUMENT = 34;
+    /** Enumeration constant */
     int EN_DOTS = 35;
+    /** Enumeration constant */
     int EN_DOTTED = 36;
+    /** Enumeration constant */
     int EN_DOUBLE = 37;
+    /** Enumeration constant */
     int EN_EMBED = 38;
+    /** Enumeration constant */
     int EN_END = 39;
+    /** Enumeration constant */
     int EN_END_ON_EVEN = 40;
+    /** Enumeration constant */
     int EN_END_ON_ODD = 41;
+    /** Enumeration constant */
     int EN_ERROR_IF_OVERFLOW = 42;
+    /** Enumeration constant */
     int EN_EVEN = 43;
+    /** Enumeration constant */
     int EN_EVEN_PAGE = 44;
+    /** Enumeration constant */
     int EN_EXPANDED = 45;
+    /** Enumeration constant */
     int EN_EXTRA_CONDENSED = 46;
+    /** Enumeration constant */
     int EN_EXTRA_EXPANDED = 47;
+    /** Enumeration constant */
     int EN_FALSE = 48;
+    /** Enumeration constant */
     int EN_FIC = 49;
+    /** Enumeration constant */
     int EN_FIRST = 50;
+    /** Enumeration constant */
     int EN_FIXED = 51;
+    /** Enumeration constant */
     int EN_FONT_HEIGHT = 52;
+    /** Enumeration constant */
     int EN_FORCE = 53;
+    /** Enumeration constant */
     int EN_FSWP = 54;
+    /** Enumeration constant */
     int EN_GROOVE = 55;
+    /** Enumeration constant */
     int EN_HANGING = 56;
+    /** Enumeration constant */
     int EN_HIDDEN = 57;
+    /** Enumeration constant */
     int EN_HIDE = 58;
+    /** Enumeration constant */
     int EN_IDEOGRAPHIC = 59;
+    /** Enumeration constant */
     int EN_IGNORE = 60;
+    /** Enumeration constant */
     int EN_IGNORE_IF_AFTER_LINEFEED = 61;
+    /** Enumeration constant */
     int EN_IGNORE_IF_BEFORE_LINEFEED = 62;
+    /** Enumeration constant */
     int EN_IGNORE_IF_SURROUNDING_LINEFEED = 63;
+    /** Enumeration constant */
     int EN_INDEFINITE = 64;
+    /** Enumeration constant */
     int EN_INDENT = 65;
+    /** Enumeration constant */
     int EN_INHERIT = 66;
+    /** Enumeration constant */
     int EN_INSET = 67;
+    /** Enumeration constant */
     int EN_INSIDE = 68;
+    /** Enumeration constant */
     int EN_INTEGER_PIXELS = 69;
+    /** Enumeration constant */
     int EN_JUSTIFY = 70;
+    /** Enumeration constant */
     int EN_LARGER = 71;
+    /** Enumeration constant */
     int EN_LAST = 72;
+    /** Enumeration constant */
     int EN_LEFT = 73;
+    /** Enumeration constant */
     int EN_LEWP = 74;
+    /** Enumeration constant */
     int EN_LINE = 75;
+    /** Enumeration constant */
     int EN_LINE_HEIGHT = 76;
+    /** Enumeration constant */
     int EN_LINE_THROUGH = 77;
+    /** Enumeration constant */
     int EN_LOWERCASE = 78;
+    /** Enumeration constant */
     int EN_LR_TB = 79;
+    /** Enumeration constant */
     int EN_LTR = 80;
+    /** Enumeration constant */
     int EN_LSWP = 81;
+    /** Enumeration constant */
     int EN_MATHEMATICAL = 82;
+    /** Enumeration constant */
     int EN_MAX_HEIGHT = 83;
+    /** Enumeration constant */
     int EN_MIDDLE = 84;
+    /** Enumeration constant */
     int EN_NARROWER = 85;
+    /** Enumeration constant */
     int EN_NO_BLINK = 86;
+    /** Enumeration constant */
     int EN_NO_CHANGE = 87;
+    /** Enumeration constant */
     int EN_NO_FORCE = 88;
+    /** Enumeration constant */
     int EN_NO_LIMIT = 89;
+    /** Enumeration constant */
     int EN_NO_LINE_THROUGH = 90;
+    /** Enumeration constant */
     int EN_NO_OVERLINE = 91;
+    /** Enumeration constant */
     int EN_NO_UNDERLINE = 92;
+    /** Enumeration constant */
     int EN_NO_WRAP = 93;
+    /** Enumeration constant */
     int EN_NON_UNIFORM = 94;
+    /** Enumeration constant */
     int EN_NONE = 95;
+    /** Enumeration constant */
     int EN_NOREPEAT = 96;
+    /** Enumeration constant */
     int EN_NORMAL = 97;
+    /** Enumeration constant */
     int EN_NOT_BLANK = 98;
+    /** Enumeration constant */
     int EN_ODD = 99;
+    /** Enumeration constant */
     int EN_ODD_PAGE = 100;
+    /** Enumeration constant */
     int EN_OUTSET = 101;
+    /** Enumeration constant */
     int EN_OUTSIDE = 102;
+    /** Enumeration constant */
     int EN_OVERLINE = 103;
+    /** Enumeration constant */
     int EN_PAGE = 104;
+    /** Enumeration constant */
     int EN_PAGE_SEQUENCE = 105;
+    /** Enumeration constant */
     int EN_PAGINATE = 106;
+    /** Enumeration constant */
     int EN_PERCEPTUAL = 107;
+    /** Enumeration constant */
     int EN_PRESERVE = 108;
+    /** Enumeration constant */
     int EN_REFERENCE_AREA = 109;
+    /** Enumeration constant */
     int EN_RELATIVE = 110;
+    /** Enumeration constant */
     int EN_RELATIVE_COLOMETRIC = 111;
+    /** Enumeration constant */
     int EN_REPEAT = 112;
+    /** Enumeration constant */
     int EN_REPEATX = 113;
+    /** Enumeration constant */
     int EN_REPEATY = 114;
+    /** Enumeration constant */
     int EN_RESAMPLE_ANY_METHOD = 115;
+    /** Enumeration constant */
     int EN_RESET_SIZE = 116;
+    /** Enumeration constant */
     int EN_REST = 117;
+    /** Enumeration constant */
     int EN_RETAIN = 118;
+    /** Enumeration constant */
     int EN_RIDGE = 119;
+    /** Enumeration constant */
     int EN_RIGHT = 120;
+    /** Enumeration constant */
     int EN_RL_TB = 121;
+    /** Enumeration constant */
     int EN_RTL = 122;
+    /** Enumeration constant */
     int EN_RULE = 123;
+    /** Enumeration constant */
     int EN_SATURATION = 124;
+    /** Enumeration constant */
     int EN_SCALE_TO_FIT = 125;
+    /** Enumeration constant */
     int EN_SCROLL = 126;
+    /** Enumeration constant */
     int EN_SEMI_CONDENSED = 127;
+    /** Enumeration constant */
     int EN_SEMI_EXPANDED = 128;
+    /** Enumeration constant */
     int EN_SEPARATE = 129;
+    /** Enumeration constant */
     int EN_SHOW = 130;
+    /** Enumeration constant */
     int EN_SMALL_CAPS = 131;
+    /** Enumeration constant */
     int EN_SMALLER = 132;
+    /** Enumeration constant */
     int EN_SOLID = 133;
+    /** Enumeration constant */
     int EN_SPACE = 134;
+    /** Enumeration constant */
     int EN_START = 135;
+    /** Enumeration constant */
     int EN_STATIC = 136;
+    /** Enumeration constant */
     int EN_SUB = 137;
+    /** Enumeration constant */
     int EN_SUPER = 138;
+    /** Enumeration constant */
     int EN_SUPPRESS = 139;
+    /** Enumeration constant */
     int EN_TB_RL = 140;
+    /** Enumeration constant */
     int EN_TEXT_AFTER_EDGE = 141;
+    /** Enumeration constant */
     int EN_TEXT_BEFORE_EDGE = 142;
+    /** Enumeration constant */
     int EN_TEXT_BOTTOM = 143;
+    /** Enumeration constant */
     int EN_TEXT_TOP = 144;
+    /** Enumeration constant */
     int EN_TOP = 145;
+    /** Enumeration constant */
     int EN_TRADITIONAL = 146;
+    /** Enumeration constant */
     int EN_TREAT_AS_SPACE = 147;
+    /** Enumeration constant */
     int EN_TREAT_AS_ZERO_WIDTH_SPACE = 148;
+    /** Enumeration constant */
     int EN_TRUE = 149;
+    /** Enumeration constant */
     int EN_ULTRA_CONDENSED = 150;
+    /** Enumeration constant */
     int EN_ULTRA_EXPANDED = 151;
+    /** Enumeration constant */
     int EN_UNBOUNDED = 152;
+    /** Enumeration constant */
     int EN_UNDERLINE = 153;
+    /** Enumeration constant */
     int EN_UNIFORM = 154;
+    /** Enumeration constant */
     int EN_UPPERCASE = 155;
+    /** Enumeration constant */
     int EN_USE_FONT_METRICS = 156;
+    /** Enumeration constant */
     int EN_USE_SCRIPT = 157;
+    /** Enumeration constant */
     int EN_USECONTENT = 158;
+    /** Enumeration constant */
     int EN_VISIBLE = 159;
+    /** Enumeration constant */
     int EN_WIDER = 160;
+    /** Enumeration constant */
     int EN_WRAP = 161;
-    int EN_X_FILL = 162; //non-standard for display-align
-    int EN_X_DISTRIBUTE = 163; //non-standard for display-align
+    /** Enumeration constant - non-standard for display-align */
+    int EN_X_FILL = 162;
+    /** Enumeration constant - non-standard for display-align */
+    int EN_X_DISTRIBUTE = 163;
+    /** Number of enumeration constants defined */
     int ENUM_COUNT = 163;
 }

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FOPropertyMapping.java Wed Aug 31 13:29:33 2005
@@ -280,12 +280,13 @@
         genericCondPadding.useGeneric(genericCondLength);
         genericCondPadding.setInherited(false);
         genericCondPadding.getSubpropMaker(CP_LENGTH).setDefault("0pt");
+        genericCondPadding.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
 
         // GenericPadding
         genericPadding = new LengthProperty.Maker(0);
         genericPadding.setInherited(false);
         genericPadding.setDefault("0pt");
-        genericPadding.setPercentBase(LengthBase.BLOCK_WIDTH);
+        genericPadding.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         genericPadding.addShorthand(s_generics[PR_PADDING]);
 
         // GenericCondBorderWidth
@@ -716,7 +717,7 @@
         m.addKeyword("left", "0%");
         m.addKeyword("center", "50%");
         m.addKeyword("right", "100%");
-        m.setPercentBase(LengthBase.CONTAINING_BOX);
+        m.setPercentBase(LengthBase.IMAGE_BACKGROUND_POSITION_HORIZONTAL);
         addPropertyMaker("background-position-horizontal", m);
 
         // background-position-vertical
@@ -726,7 +727,7 @@
         m.addKeyword("top", "0%");
         m.addKeyword("center", "50%");
         m.addKeyword("bottom", "100%");
-        m.setPercentBase(LengthBase.CONTAINING_BOX);
+        m.setPercentBase(LengthBase.IMAGE_BACKGROUND_POSITION_VERTICAL);
         addPropertyMaker("background-position-vertical", m);
 
         // border-before-color
@@ -1202,7 +1203,7 @@
         m.setInherited(false);
         m.setDefault("0pt");
         m.addShorthand(s_generics[PR_MARGIN]);
-        m.setPercentBase(LengthBase.BLOCK_WIDTH);
+        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         addPropertyMaker("margin-top", m);
 
         // margin-bottom
@@ -1210,7 +1211,7 @@
         m.setInherited(false);
         m.setDefault("0pt");
         m.addShorthand(s_generics[PR_MARGIN]);
-        m.setPercentBase(LengthBase.BLOCK_WIDTH);
+        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         addPropertyMaker("margin-bottom", m);
 
         // margin-left
@@ -1218,7 +1219,7 @@
         m.setInherited(false);
         m.setDefault("0pt");
         m.addShorthand(s_generics[PR_MARGIN]);
-        m.setPercentBase(LengthBase.BLOCK_WIDTH);
+        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         addPropertyMaker("margin-left", m);
 
         // margin-right
@@ -1226,7 +1227,7 @@
         m.setInherited(false);
         m.setDefault("0pt");
         m.addShorthand(s_generics[PR_MARGIN]);
-        m.setPercentBase(LengthBase.BLOCK_WIDTH);
+        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         addPropertyMaker("margin-right", m);
 
         // space-before
@@ -1407,26 +1408,26 @@
         // block-progression-dimension
         m = new LengthRangeProperty.Maker(PR_BLOCK_PROGRESSION_DIMENSION);
         m.setInherited(false);
-        m.setPercentBase(LengthBase.BLOCK_HEIGHT);
+        m.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
 
         l = new LengthProperty.Maker(CP_MINIMUM);
         l.setDefault("auto");
         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
-        l.setPercentBase(LengthBase.CONTAINING_BOX);
+        l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
         l.setByShorthand(true);
         m.addSubpropMaker(l);
 
         l = new LengthProperty.Maker(CP_OPTIMUM);
         l.setDefault("auto");
         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
-        l.setPercentBase(LengthBase.CONTAINING_BOX);
+        l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
         l.setByShorthand(true);
         m.addSubpropMaker(l);
 
         l = new LengthProperty.Maker(CP_MAXIMUM);
         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
         l.setDefault("auto");
-        l.setPercentBase(LengthBase.CONTAINING_BOX);
+        l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
         l.setByShorthand(true);
         m.addSubpropMaker(l);
 
@@ -1462,33 +1463,33 @@
         l  = new LengthProperty.Maker(PR_HEIGHT);
         l.setInherited(false);
         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
-        l.setPercentBase(LengthBase.BLOCK_HEIGHT);
+        l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
         l.setDefault("auto");
         addPropertyMaker("height", l);
 
         // inline-progression-dimension
         m = new LengthRangeProperty.Maker(PR_INLINE_PROGRESSION_DIMENSION);
         m.setInherited(false);
-        m.setPercentBase(LengthBase.BLOCK_WIDTH);
+        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
 
         l = new LengthProperty.Maker(CP_MINIMUM);
         l.setDefault("auto");
         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
-        l.setPercentBase(LengthBase.CONTAINING_BOX);
+        l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         l.setByShorthand(true);
         m.addSubpropMaker(l);
 
         l = new LengthProperty.Maker(CP_OPTIMUM);
         l.setDefault("auto");
         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
-        l.setPercentBase(LengthBase.CONTAINING_BOX);
+        l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         l.setByShorthand(true);
         m.addSubpropMaker(l);
 
         l = new LengthProperty.Maker(CP_MAXIMUM);
         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
         l.setDefault("auto");
-        l.setPercentBase(LengthBase.CONTAINING_BOX);
+        l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         l.setByShorthand(true);
         m.addSubpropMaker(l);
 
@@ -1547,7 +1548,7 @@
         l  = new LengthProperty.Maker(PR_WIDTH);
         l.setInherited(false);
         l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
-        l.setPercentBase(LengthBase.BLOCK_WIDTH);
+        l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         l.setDefault("auto");
         addPropertyMaker("width", l);
 
@@ -1679,7 +1680,7 @@
         m  = new LengthProperty.Maker(PR_TEXT_INDENT);
         m.setInherited(true);
         m.setDefault("0pt");
-        m.setPercentBase(LengthBase.BLOCK_WIDTH);
+        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         addPropertyMaker("text-indent", m);
 
         // white-space-collapse
@@ -1957,29 +1958,29 @@
         m.setInherited(true);
         m.setDefault("use-font-metrics", true);
         m.addKeyword("use-font-metrics", "0pt");
-        m.setPercentBase(LengthBase.CONTAINING_BOX);
+        m.setPercentBase(LengthBase.PARENT_AREA_WIDTH);
         addPropertyMaker("leader-pattern-width", m);
 
         // leader-length
         m  = new LengthRangeProperty.Maker(PR_LEADER_LENGTH);
         m.setInherited(true);
-        m.setPercentBase(LengthBase.CONTAINING_BOX);
+        m.setPercentBase(LengthBase.PARENT_AREA_WIDTH);
 
         sub = new LengthProperty.Maker(CP_MINIMUM);
         sub.setDefault("0pt");
-        sub.setPercentBase(LengthBase.BLOCK_WIDTH);
+        sub.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         sub.setByShorthand(true);
         m.addSubpropMaker(sub);
 
         sub = new LengthProperty.Maker(CP_OPTIMUM);
         sub.setDefault("12.0pt");
-        sub.setPercentBase(LengthBase.BLOCK_WIDTH);
+        sub.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         sub.setByShorthand(true);
         m.addSubpropMaker(sub);
 
         sub = new LengthProperty.Maker(CP_MAXIMUM);
         sub.setDefault("100%", true);
-        sub.setPercentBase(LengthBase.BLOCK_WIDTH);
+        sub.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         sub.setByShorthand(true);
         m.addSubpropMaker(sub);
         addPropertyMaker("leader-length", m);
@@ -2190,6 +2191,7 @@
         m  = new LengthProperty.Maker(PR_EXTENT);
         m.setInherited(true);
         m.setDefault("0pt");
+        m.setPercentBase(LengthBase.CUSTOM_BASE);
         addPropertyMaker("extent", m);
 
         // flow-name
@@ -2376,7 +2378,7 @@
         m  = new LengthProperty.Maker(PR_COLUMN_WIDTH);
         m.setInherited(false);
         m.setDefault("proportional-column-width(1)", true);
-        m.setPercentBase(LengthBase.BLOCK_WIDTH);
+        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         addPropertyMaker("column-width", m);
 
         // empty-cells
@@ -2651,13 +2653,14 @@
         m.setInherited(false);
         m.setDefault("");
         m.setDatatypeParser(new BoxPropShorthandParser());
-        m.setPercentBase(LengthBase.BLOCK_WIDTH);
+        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         addPropertyMaker("margin", m);
 
         // padding
         m  = new ListProperty.Maker(PR_PADDING);
         m.setInherited(false);
         m.setDatatypeParser(new BoxPropShorthandParser());
+        m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
         addPropertyMaker("padding", m);
 
         // page-break-after

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/InlineCharIterator.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/InlineCharIterator.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/InlineCharIterator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/InlineCharIterator.java Wed Aug 31 13:29:33 2005
@@ -40,9 +40,9 @@
 
     private void checkBoundaries(CommonBorderPaddingBackground bpb) {
         bStartBoundary = (bpb.getBorderStartWidth(false) > 0
-                       || bpb.getPaddingStart(false) > 0);
+                       || bpb.getPaddingStart(false, null) > 0); // TODO do we need context here?
         bEndBoundary = (bpb.getBorderEndWidth(false) > 0
-                     || bpb.getPaddingEnd(false) > 0);
+                     || bpb.getPaddingEnd(false, null) > 0); // TODO do we need context here?
     }
 
     /**

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/LabelEndFunction.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/LabelEndFunction.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/LabelEndFunction.java Wed Aug 31 13:29:33 2005
@@ -66,7 +66,7 @@
         Length startIndent = pList.get(Constants.PR_START_INDENT).getLength();
 
         LengthBase base = new LengthBase(pList.getFObj(), pInfo.getPropertyList(),
-                                         LengthBase.CONTAINING_REFAREA);
+                                         LengthBase.CONTAINING_REFAREA_WIDTH);
         PercentLength refWidth = new PercentLength(1.0, base);
 
         Numeric labelEnd = distance; 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/NumericOp.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/NumericOp.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/NumericOp.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/NumericOp.java Wed Aug 31 13:29:33 2005
@@ -18,6 +18,7 @@
 
 package org.apache.fop.fo.expr;
 
+import org.apache.fop.datatypes.PercentBaseContext;
 import org.apache.fop.datatypes.Numeric;
 
 /**
@@ -39,17 +40,17 @@
      */
     public static Numeric addition(Numeric op1, Numeric op2) throws PropertyException {
         if (op1.isAbsolute() && op2.isAbsolute()) {
-            return addition2(op1, op2);
+            return addition2(op1, op2, null);
         } else {
             return new RelativeNumericProperty(RelativeNumericProperty.ADDITION, op1, op2);
         }
     }
     
-    public static Numeric addition2(Numeric op1, Numeric op2) throws PropertyException {
+    public static Numeric addition2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
         if (op1.getDimension() != op2.getDimension()) {
             throw new PropertyException("Can't subtract Numerics of different dimensions");
         }
-        return numeric(op1.getNumericValue() + op2.getNumericValue(), op1.getDimension());
+        return numeric(op1.getNumericValue(context) + op2.getNumericValue(context), op1.getDimension());
     }
     
     /**
@@ -63,17 +64,17 @@
      */
     public static Numeric subtraction(Numeric op1, Numeric op2) throws PropertyException {
         if (op1.isAbsolute() && op2.isAbsolute()) {
-            return subtraction2(op1, op2);
+            return subtraction2(op1, op2, null);
         } else {
             return new RelativeNumericProperty(RelativeNumericProperty.SUBTRACTION, op1, op2);
         }
     }
 
-    public static Numeric subtraction2(Numeric op1, Numeric op2) throws PropertyException {
+    public static Numeric subtraction2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
         if (op1.getDimension() != op2.getDimension()) {
             throw new PropertyException("Can't subtract Numerics of different dimensions");
         }
-        return numeric(op1.getNumericValue() - op2.getNumericValue(), op1.getDimension());
+        return numeric(op1.getNumericValue(context) - op2.getNumericValue(context), op1.getDimension());
     }
     
     /**
@@ -87,14 +88,14 @@
      */
     public static Numeric multiply(Numeric op1, Numeric op2) throws PropertyException {
         if (op1.isAbsolute() && op2.isAbsolute()) {
-            return multiply2(op1, op2);
+            return multiply2(op1, op2, null);
         } else {
             return new RelativeNumericProperty(RelativeNumericProperty.MULTIPLY, op1, op2);
         }
     }    
 
-    public static Numeric multiply2(Numeric op1, Numeric op2) throws PropertyException {
-        return numeric(op1.getNumericValue() * op2.getNumericValue(), 
+    public static Numeric multiply2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
+        return numeric(op1.getNumericValue(context) * op2.getNumericValue(context), 
                        op1.getDimension() + op2.getDimension());
     }
     
@@ -110,14 +111,14 @@
      */
     public static Numeric divide(Numeric op1, Numeric op2) throws PropertyException {
         if (op1.isAbsolute() && op2.isAbsolute()) {
-            return divide2(op1, op2);
+            return divide2(op1, op2, null);
         } else {
             return new RelativeNumericProperty(RelativeNumericProperty.DIVIDE, op1, op2);
         }
     }
     
-    public static Numeric divide2(Numeric op1, Numeric op2) throws PropertyException {
-        return numeric(op1.getNumericValue() / op2.getNumericValue(), 
+    public static Numeric divide2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
+        return numeric(op1.getNumericValue(context) / op2.getNumericValue(context), 
                        op1.getDimension() - op2.getDimension());
     }
     
@@ -129,14 +130,14 @@
      */
     public static Numeric modulo(Numeric op1, Numeric op2) throws PropertyException {
         if (op1.isAbsolute() && op2.isAbsolute()) {
-            return modulo2(op1, op2);
+            return modulo2(op1, op2, null);
         } else {
             return new RelativeNumericProperty(RelativeNumericProperty.MODULO, op1, op2);
         }
     }
     
-    public static Numeric modulo2(Numeric op1, Numeric op2) throws PropertyException {
-        return numeric(op1.getNumericValue() % op2.getNumericValue(), op1.getDimension());
+    public static Numeric modulo2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
+        return numeric(op1.getNumericValue(context) % op2.getNumericValue(context), op1.getDimension());
     }
 
     /**
@@ -146,14 +147,14 @@
      */
     public static Numeric abs(Numeric op) throws PropertyException {
         if (op.isAbsolute()) {
-            return abs2(op);
+            return abs2(op, null);
         } else {
             return new RelativeNumericProperty(RelativeNumericProperty.ABS, op);
         }
     }
 
-    public static Numeric abs2(Numeric op) throws PropertyException {
-        return numeric(Math.abs(op.getNumericValue()), op.getDimension());
+    public static Numeric abs2(Numeric op, PercentBaseContext context) throws PropertyException {
+        return numeric(Math.abs(op.getNumericValue(context)), op.getDimension());
     }
     
     /**
@@ -163,14 +164,14 @@
      */
     public static Numeric negate(Numeric op) throws PropertyException {
         if (op.isAbsolute()) {
-            return negate2(op);
+            return negate2(op, null);
         } else {
             return new RelativeNumericProperty(RelativeNumericProperty.NEGATE, op);
         }
     }
 
-    public static Numeric negate2(Numeric op) throws PropertyException {
-        return numeric(- op.getNumericValue(), op.getDimension());
+    public static Numeric negate2(Numeric op, PercentBaseContext context) throws PropertyException {
+        return numeric(- op.getNumericValue(context), op.getDimension());
     }
     
     /**
@@ -182,17 +183,17 @@
      */
     public static Numeric max(Numeric op1, Numeric op2) throws PropertyException {
         if (op1.isAbsolute() && op2.isAbsolute()) {
-            return max2(op1, op2);
+            return max2(op1, op2, null);
         } else {
             return new RelativeNumericProperty(RelativeNumericProperty.MAX, op1, op2);
         }
     }
 
-    public static Numeric max2(Numeric op1, Numeric op2) throws PropertyException {
+    public static Numeric max2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
         if (op1.getDimension() != op2.getDimension()) {
             throw new PropertyException("Arguments to max() must have same dimensions");
         }
-        return op1.getNumericValue() > op2.getNumericValue() ? op1 : op2;
+        return op1.getNumericValue(context) > op2.getNumericValue(context) ? op1 : op2;
     }
     
     /**
@@ -204,17 +205,17 @@
      */
     public static Numeric min(Numeric op1, Numeric op2) throws PropertyException {
         if (op1.isAbsolute() && op2.isAbsolute()) {
-            return min2(op1, op2);
+            return min2(op1, op2, null);
         } else {
             return new RelativeNumericProperty(RelativeNumericProperty.MIN, op1, op2);
         }
     }
 
-    public static Numeric min2(Numeric op1, Numeric op2) throws PropertyException {
+    public static Numeric min2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
         if (op1.getDimension() != op2.getDimension()) {
             throw new PropertyException("Arguments to min() must have same dimensions");
         }
-        return op1.getNumericValue() <= op2.getNumericValue() ? op1 : op2;
+        return op1.getNumericValue(context) <= op2.getNumericValue(context) ? op1 : op2;
     }
     
     /**

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/NumericProperty.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/NumericProperty.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/NumericProperty.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/NumericProperty.java Wed Aug 31 13:29:33 2005
@@ -19,6 +19,7 @@
 package org.apache.fop.fo.expr;
 
 import org.apache.fop.datatypes.Length;
+import org.apache.fop.datatypes.PercentBaseContext;
 import org.apache.fop.datatypes.Numeric;
 import org.apache.fop.fo.properties.ColorTypeProperty;
 import org.apache.fop.fo.properties.Property;
@@ -60,6 +61,15 @@
     }
 
     /**
+     * Return the value.
+     * @param Evaluation context
+     * @see Numeric#getNumericValue(Object)
+     */
+    public double getNumericValue(PercentBaseContext context) {
+        return value;
+    }
+
+    /**
      * Return true of the numeric is absolute.
      * @see Numeric#isAbsolute()
      */
@@ -85,6 +95,14 @@
      * Return the value of this numeric as a length in millipoints. 
      */
     public int getValue() {
+        return (int) value;
+    }
+
+    /**
+     * Return the value of this numeric as a length in millipoints. 
+     * @param Evaluation context
+     */
+    public int getValue(PercentBaseContext context) {
         return (int) value;
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/PropertyInfo.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/PropertyInfo.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/PropertyInfo.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/PropertyInfo.java Wed Aug 31 13:29:33 2005
@@ -20,11 +20,12 @@
 
 import java.util.Stack;
 
+import org.apache.fop.datatypes.Length;
+import org.apache.fop.datatypes.PercentBase;
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
 import org.apache.fop.fo.properties.PropertyMaker;
-import org.apache.fop.datatypes.PercentBase;
 
 
 /**
@@ -57,7 +58,7 @@
      * Propagates to the Maker.
      * @return The PercentBase object or null if percentLengthOK()=false.
      */
-    public PercentBase getPercentBase() {
+    public PercentBase getPercentBase() throws PropertyException {
         PercentBase pcbase = getFunctionPercentBase();
         return (pcbase != null) ? pcbase : maker.getPercentBase(fo, plist);
     }
@@ -65,8 +66,8 @@
     /**
      * @return the current font-size value as base units (milli-points).
      */
-    public int currentFontSize() throws PropertyException {
-        return plist.get(Constants.PR_FONT_SIZE).getLength().getValue();
+    public Length currentFontSize() throws PropertyException {
+        return plist.get(Constants.PR_FONT_SIZE).getLength();
     }
 
     /**

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/PropertyParser.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/PropertyParser.java?rev=265577&r1=265576&r2=265577&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/PropertyParser.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/expr/PropertyParser.java Wed Aug 31 13:29:33 2005
@@ -285,18 +285,11 @@
             String unitPart = currentTokenValue.substring(numLen);
             Double numPart = new Double(currentTokenValue.substring(0,
                     numLen));
-            LengthProperty length = null;
             if (unitPart.equals(RELUNIT)) {
-                length = new FixedLength(numPart.doubleValue(),
+                prop = (Property) NumericOp.multiply(new NumberProperty(numPart.doubleValue()),
                                     propInfo.currentFontSize());
             } else {
-                length = new FixedLength(numPart.doubleValue(), unitPart);
-            }
-            if (length == null) {
-                throw new PropertyException("unrecognized unit name: "
-                                            + currentTokenValue);
-            } else {
-                prop = length;
+                prop = new FixedLength(numPart.doubleValue(), unitPart);
             }
             break;
 



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Re: svn commit: r265577 [1/5] - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/area/ src/java/org/apache/fop/datatypes/ src/java/org/apache/fop/fo/ src/java/org/apache/fop/fo/expr/ src/java/org/apache/fop/fo/flow/ src/java/org/apache/fop/fo/pagination/...

Posted by Manuel Mall <mm...@arcus.com.au>.
Sorry, that was my mistake - need to configure NetBeans to  put the 
Apache license into new files generated by the IDE.

Manuel

On Thu, 1 Sep 2005 04:42 am, Jeremias Maerki wrote:
> Oops.
>
> On 31.08.2005 22:30:49 bckfnn wrote:
> > Author: bckfnn
> > Date: Wed Aug 31 13:29:33 2005
> > New Revision: 265577
> >
> > URL: http://svn.apache.org/viewcvs?rev=265577&view=rev
> > Log:
> > Bugzilla #36379:
> > Revised percentage resolution system.
> > Submitted by: Manuel Mall <mm.at.arcus.com.au>
> >
> > Slightly modified to avoid early evaluation of getValue().
>
> <snip/>
>
> > Added:
> > xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePerce
> >ntBaseContext.java URL:
> > http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/ap
> >ache/fop/datatypes/SimplePercentBaseContext.java?rev=265577&view=aut
> >o
> > ===================================================================
> >=========== ---
> > xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePerce
> >ntBaseContext.java (added) +++
> > xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePerce
> >ntBaseContext.java Wed Aug 31 13:29:33 2005 @@ -0,0 +1,51 @@
> > +/*
> > + * SimplePercentBaseContext.java
> > + *
> > + * Created on 29 August 2005, 17:02
> > + *
> > + * To change this template, choose Tools | Options and locate the
> > template under + * the Source Creation and Management node.
> > Right-click the template and choose + * Open. You can then make
> > changes to the template in the Source Editor. + */
> > +
> > +package org.apache.fop.datatypes;
> > +
> > +import org.apache.fop.fo.FObj;
>
> Jeremias Maerki

Re: svn commit: r265577 [1/5] - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/area/ src/java/org/apache/fop/datatypes/ src/java/org/apache/fop/fo/ src/java/org/apache/fop/fo/expr/ src/java/org/apache/fop/fo/flow/ src/java/org/apache/fop/fo/pagination/...

Posted by Jeremias Maerki <de...@greenmail.ch>.
Oops.


On 31.08.2005 22:30:49 bckfnn wrote:
> Author: bckfnn
> Date: Wed Aug 31 13:29:33 2005
> New Revision: 265577
> 
> URL: http://svn.apache.org/viewcvs?rev=265577&view=rev
> Log:
> Bugzilla #36379:
> Revised percentage resolution system.
> Submitted by: Manuel Mall <mm.at.arcus.com.au>
> 
> Slightly modified to avoid early evaluation of getValue().

<snip/>

> Added: xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java
> URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java?rev=265577&view=auto
> ==============================================================================
> --- xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java (added)
> +++ xmlgraphics/fop/trunk/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java Wed Aug 31 13:29:33 2005
> @@ -0,0 +1,51 @@
> +/*
> + * SimplePercentBaseContext.java
> + *
> + * Created on 29 August 2005, 17:02
> + *
> + * To change this template, choose Tools | Options and locate the template under
> + * the Source Creation and Management node. Right-click the template and choose
> + * Open. You can then make changes to the template in the Source Editor.
> + */
> +
> +package org.apache.fop.datatypes;
> +
> +import org.apache.fop.fo.FObj;


Jeremias Maerki