diff options
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java index 52238e9be..c238f3c27 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java @@ -320,7 +320,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { * will not have considered it a legal break, but it could still * be one. */ - if (penalty.getP() == KnuthPenalty.INFINITE) { + if (penalty.getPenalty() == KnuthPenalty.INFINITE) { int breakClass = penalty.getBreakClass(); if (breakClass == Constants.EN_PAGE || breakClass == Constants.EN_COLUMN) { @@ -363,7 +363,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { noteListIterator.hasNext();) { final KnuthElement element = (KnuthElement) noteListIterator.next(); if (element.isBox() || element.isGlue()) { - noteLength += element.getW(); + noteLength += element.getWidth(); } } int prevLength = (lengthList == null || lengthList.isEmpty()) @@ -445,22 +445,22 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { return true; } else { KnuthPenalty p = (KnuthPenalty) element; - if (p.getP() <= 0) { + if (p.getPenalty() <= 0) { return true; } else { int context = p.getBreakClass(); switch (context) { case Constants.EN_LINE: case Constants.EN_COLUMN: - return p.getP() < KnuthPenalty.INFINITE; + return p.getPenalty() < KnuthPenalty.INFINITE; case Constants.EN_PAGE: - return p.getP() < KnuthPenalty.INFINITE + return p.getPenalty() < KnuthPenalty.INFINITE || !pageProvider.endPage(line - 1); case Constants.EN_AUTO: log.debug("keep is not auto but context is"); return true; default: - if (p.getP() < KnuthPenalty.INFINITE) { + if (p.getPenalty() < KnuthPenalty.INFINITE) { log.debug("Non recognized keep context:" + context); return true; } else { @@ -479,7 +479,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { int footnoteSplit = 0; boolean canDeferOldFootnotes; if (element.isPenalty()) { - actualWidth += element.getW(); + actualWidth += element.getWidth(); } if (footnotesPending) { // compute the total length of the footnotes not yet inserted @@ -588,7 +588,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { index++) { if (par.getElement(index).isGlue() && par.getElement(index - 1).isBox() || par.getElement(index).isPenalty() - && ((KnuthElement) par.getElement(index)).getP() < KnuthElement.INFINITE) { + && ((KnuthElement) par.getElement(index)).getPenalty() < KnuthElement.INFINITE) { // break found break; } @@ -711,7 +711,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { element = (KnuthElement) noteListIterator.next(); if (element.isBox()) { // element is a box - splitLength += element.getW(); + splitLength += element.getWidth(); boxPreceding = true; } else if (element.isGlue()) { // element is a glue @@ -721,10 +721,10 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { break; } boxPreceding = false; - splitLength += element.getW(); + splitLength += element.getWidth(); } else { // element is a penalty - if (element.getP() < KnuthElement.INFINITE) { + if (element.getPenalty() < KnuthElement.INFINITE) { // end of the sub-sequence index = noteListIterator.previousIndex(); break; @@ -792,7 +792,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { double f = Math.abs(r); f = 1 + 100 * f * f * f; if (element.isPenalty()) { - double penalty = element.getP(); + double penalty = element.getPenalty(); if (penalty >= 0) { f += penalty; demerits = f * f; @@ -805,9 +805,9 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { demerits = f * f; } - if (element.isPenalty() && ((KnuthPenalty) element).isFlagged() + if (element.isPenalty() && ((KnuthPenalty) element).isPenaltyFlagged() && getElement(activeNode.position).isPenalty() - && ((KnuthPenalty) getElement(activeNode.position)).isFlagged()) { + && ((KnuthPenalty) getElement(activeNode.position)).isPenaltyFlagged()) { // add demerit for consecutive breaks at flagged penalties demerits += repeatedFlaggedDemerit; } |