/* TODO: This base is probably not quite right. */
final int base = context.ipdAncestorBlockOrRa();
return Math.round(value().evalPercentage() * base);
}
if (value() instanceof DtLengthConditional) {
final DtLengthConditional lengthConditional
= (DtLengthConditional) value();
/*
* TODO: I'm not sure we have enough information here yet. We may
* need to know the writing mode of the reference-area. If so,
* add it to the parameters of the method.
*/
final FoValue condition = lengthConditional.getConditionality();
/* If the condition is discard and this is *not* the outer edge,
* then the padding should be zero.
*/
if (condition == FoValue.DISCARD) {
if (! isOuterEdge(context, fobj)) {
return 0;
}
}
/* In all other cases, return the length*/
final DtLength length = lengthConditional.getLength();
final int lengthValue = length.getValue(fobj.traitFontSize(
context));
return Math.max(lengthValue, 0);
}
throw this.unexpectedRetrieval();