]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Hyphenation/Quotation problem fixed ("quoted strings" not breaking properly.)
authorGlen Mazza <gmazza@apache.org>
Mon, 15 Dec 2003 22:39:01 +0000 (22:39 +0000)
committerGlen Mazza <gmazza@apache.org>
Mon, 15 Dec 2003 22:39:01 +0000 (22:39 +0000)
Patch #25512 by Simon Pepping (spepping at leverkruid dot nl).

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197039 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/LineLayoutManager.java

index 62014219e05e1f2b91860e60d8be43912fc38c92..d04bdd5abbe3da1df9f71e1b7abfcdfb6b952790 100644 (file)
@@ -322,7 +322,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager {
             prevBP = getBestBP(vecPossEnd);
         }
         // Backup child LM if necessary
-        if (bp != prevBP && !prevBP.couldEndLine()) {
+        if (bp != prevBP && !prevCouldEndLine(prevBP)) {
             reset();
         }
 
@@ -396,6 +396,20 @@ public class LineLayoutManager extends InlineStackingLayoutManager {
         return true;
     }
 
+    /** Test whether all breakposs in vecInlineBreaks
+        back to and including prev could end line */
+    private boolean prevCouldEndLine(BreakPoss prev) {
+        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;
+        }
+        return couldEndLine;
+    }
+
     private HyphContext getHyphenContext(BreakPoss prev,
                                          BreakPoss newBP) {
         // Get a "word" to hyphenate by getting characters from all