aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorChris Bowditch <cbowditch@apache.org>2004-04-26 14:28:30 +0000
committerChris Bowditch <cbowditch@apache.org>2004-04-26 14:28:30 +0000
commit3d81811b573c812279c1a328f6aa132ea8cad2ab (patch)
treeba4bf1d92d6b3b55e4ed0a44ae7c88c9b172b79f /src/java/org
parent333a1dc61ccb85e4a68f484c8cb2e6b8aa734a67 (diff)
downloadxmlgraphics-fop-3d81811b573c812279c1a328f6aa132ea8cad2ab.tar.gz
xmlgraphics-fop-3d81811b573c812279c1a328f6aa132ea8cad2ab.zip
applied Luca Furini's patch from bug #28314
fixes problems with justification on last line in a block. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197540 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/fop/layoutmgr/LineLayoutManager.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
index 780d2fcc3..3c456ee00 100644
--- a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-/* $Id$ */
+/* $Id: LineLayoutManager.java,v 1.17 2004/04/02 10:38:29 cbowditch Exp $ */
package org.apache.fop.layoutmgr;
@@ -129,7 +129,6 @@ public class LineLayoutManager extends InlineStackingLayoutManager {
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 @@ public class LineLayoutManager extends InlineStackingLayoutManager {
/* 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 @@ public class LineLayoutManager extends InlineStackingLayoutManager {
if (bp == null) {
return null;
}
+
if (prevBP == null) {
BreakPoss prevLineEnd = (iPrevLineEnd == 0)
? null
@@ -389,13 +389,22 @@ public class LineLayoutManager extends InlineStackingLayoutManager {
/** 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;
}