git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_WhitespaceManagement@1590758 13f79535-47bb-0310-9956-ffa450edef68tags/fop-2_0
@@ -600,7 +600,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { | |||
private int handleWhitespaceManagementPenalty(KnuthPageNode activeNode, | |||
WhitespaceManagementPenalty penalty, int elementIndex) { | |||
for (Variant var : penalty.getVariants()) { | |||
int difference = computeDifference(activeNode, var.toPenalty(), elementIndex); | |||
int difference = computeDifference(activeNode, var.getPenalty(), elementIndex); | |||
double r = computeAdjustmentRatio(activeNode, difference); | |||
if (r >= -1.0) { | |||
activeNode.addVariant(var); |
@@ -36,14 +36,16 @@ public class WhitespaceManagementPenalty extends KnuthPenalty { | |||
public final List<ListElement> knuthList; | |||
public final int width; | |||
private final KnuthPenalty penalty; | |||
public Variant(List<ListElement> knuthList, int width) { | |||
this.knuthList = knuthList; | |||
this.width = width; | |||
this.penalty = new KnuthPenalty(width, 0, false, null, false); | |||
} | |||
public KnuthElement toPenalty() { | |||
return new KnuthPenalty(width, 0, false, null, false); | |||
public KnuthElement getPenalty() { | |||
return penalty; | |||
} | |||
public WhitespaceManagementPenalty getWhitespaceManagementPenalty() { |