Hi all.
The eval method of the label-end-function
(org.apache.fop.fo.expr.LabelEndFunction.eval()) does not work correctly. The problem
is that the "width of the
content-rectangle of the reference-area into which the list-block is placed"
is erronously returned to be zero.
Here is a quote from the spec:
> label-end() = width of the content-rectangle of the reference-area into
which the list-block is placed - (the value of the
> provisional-distance-between-starts + the value of the start-indent +
start-intrusion-adjustment - the value of the
> provisional-label-separation) of the closest ancestor fo:list-block.
The effect of this bug is that the label-end() function returns much too
small values. Using these values in
<fo:list-item-label
end-indent="label-end()">...</fo:list-item-label>
has the effect that the label is much too wide. I recognized the problem
when I wanted to right-justify labels:
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block text-align="right">label</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>body</fo:block>
</fo:list-item-body>
</fo:list-item>
The result is that the label is rendered right of the body :-).
.... body ........ label
I started debugging the code but unfortunately I do not understand the FOP
internals. However, here are some interesting lines from the eval() method:
// Should be CONTAINING_REFAREA but that doesn't work
LengthBase base = new LengthBase(item, pInfo.getPropertyList(),
LengthBase.CONTAINING_BOX);
PercentLength refWidth = new PercentLength(1.0, base);
labelEnd.addTerm(1.0, refWidth);
labelEnd.addTerm(-1.0, distance);
labelEnd.addTerm(-1.0, startIndent);
labelEnd.addTerm(1.0, separation);
// make sure value gets calculated
labelEnd.computeValue();
Someone already wrote a comment that suggest that something is wrong here
:-). Yet, whatever LengthBase is used (CONTAINING_BOX or CONTAINING_REFAREA)
the result is both times the same. The base is returned to have 0 length.
--Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]