xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Finn Bock <bck...@worldonline.dk>
Subject Re: cvs commit: xml-fop/src/java/org/apache/fop/render/rtf TextAttributesConverter.java
Date Mon, 30 Aug 2004 12:22:27 GMT
gmazza@apache.org wrote:

>   Log:
>   Convenience method fobj.getPropLength() added to simplify some of the code.

>   --- FObj.java	20 Aug 2004 09:38:21 -0000	1.69
>   +++ FObj.java	29 Aug 2004 20:17:34 -0000	1.70
>   @@ -196,6 +196,17 @@
>         */
>        public String getPropString(int propId) {
>            return propertyList.get(propId).getString();
>   +    }
>   +
>   +    /**
>   +     * Convenience method to quickly obtain the length value of a property
>   +     * for this FO, without querying for the propertyList first.
>   +     * Meaningful only for properties having a length representation
>   +     * @param propId - the Constants ID of the desired property to obtain
>   +     * @return the length value of the property value
>   +     */
>   +    public int getPropLength(int propId) {
>   +        return propertyList.get(propId).getLength().getValue();
>        }


Careful here. The final getValue() call can not be performed during 
addProperties() because no base values has yet been assigned to resolve 
relative percentages against.

The getValue() method can only be called from the 
LayoutManager.getNextBreakPoss() loop.

The code you changed in the FO classes was also wrong before, luckily 
the resulting values was never used (I hope).

regards,
finn

Mime
View raw message