cbowditch 2004/04/26 07:28:30
Modified: src/java/org/apache/fop/layoutmgr LineLayoutManager.java
Log:
applied Luca Furini's patch from bug #28314
fixes problems with justification on last line in a block.
Revision Changes Path
1.18 +14 -5 xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
Index: LineLayoutManager.java
===================================================================
RCS file:
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- LineLayoutManager.java 2 Apr 2004 10:38:29 -0000 1.17
+++ LineLayoutManager.java 26 Apr 2004 14:28:30 -0000 1.18
@@ -129,7 +129,6 @@
public BreakPoss getNextBreakPoss(LayoutContext context) {
// Get a break from currently active child LM
// Set up constraints for inline level managers
-
LayoutManager curLM ; // currently active LM
BreakPoss prev = null;
BreakPoss bp = null; // proposed BreakPoss
@@ -243,8 +242,8 @@
/* If we are not in justified text, we can end the line at
* prevBP.
*/
- if (prevBP == null) {
vecInlineBreaks.add(bp);
+ if (prevBP == null) {
prevBP = bp;
}
break;
@@ -295,6 +294,7 @@
if (bp == null) {
return null;
}
+
if (prevBP == null) {
BreakPoss prevLineEnd = (iPrevLineEnd == 0)
? null
@@ -389,13 +389,22 @@
/** Test whether all breakposs in vecInlineBreaks
back to and including prev could end line */
private boolean prevCouldEndLine(BreakPoss prev) {
+ if (!isFinished()) {
+ return false;
+ }
ListIterator bpIter =
vecInlineBreaks.listIterator(vecInlineBreaks.size());
boolean couldEndLine = true;
while (bpIter.hasPrevious()) {
BreakPoss bp = (BreakPoss) bpIter.previous();
- couldEndLine = bp.couldEndLine();
- if (!couldEndLine || bp == prev) break;
+ if (bp == prev) {
+ break;
+ } else {
+ couldEndLine = bp.isSuppressible();
+ if (!couldEndLine) {
+ break;
+ }
+ }
}
return couldEndLine;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]