]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bug #25031 -- patch in calculation of line breakpoints, by Simon Pepping (spepping...
authorGlen Mazza <gmazza@apache.org>
Tue, 23 Dec 2003 20:41:58 +0000 (20:41 +0000)
committerGlen Mazza <gmazza@apache.org>
Tue, 23 Dec 2003 20:41:58 +0000 (20:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197051 13f79535-47bb-0310-9956-ffa450edef68

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

index d04bdd5abbe3da1df9f71e1b7abfcdfb6b952790..32a280f39608d327295f150379d3afbf419fabc1 100644 (file)
@@ -242,6 +242,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager {
                         // If we are already in a hyphenation loop, then stop.
 
                         if (inlineLC.tryHyphenate()) {
+                            if (prevBP == null) {
+                                vecInlineBreaks.add(bp);
+                                prevBP = bp;
+                            }
                             break;
                         }
                         // Otherwise, prepare to try hyphenation
@@ -254,6 +258,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager {
                         inlineLC.setHyphContext(
                           getHyphenContext((prevBP == null) ? prev : prevBP, bp));
                         if (inlineLC.getHyphContext() == null) {
+                            if (prevBP == null) {
+                                vecInlineBreaks.add(bp);
+                                prevBP = bp;
+                            }
                             break;
                         }
                         inlineLC.setFlags(LayoutContext.TRY_HYPHENATE,
@@ -264,6 +272,10 @@ 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);
+                            prevBP = bp;
+                        }
                         break;
                     }
                 } else {
@@ -313,7 +325,6 @@ public class LineLayoutManager extends InlineStackingLayoutManager {
             return null;
         }
         if (prevBP == null) {
-            vecInlineBreaks.add(bp);
             prevBP = bp;
         }