From c7b9024fc8096b14a38fa529203f61ac64619b1c Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Tue, 23 Dec 2003 20:41:58 +0000 Subject: [PATCH] Bug #25031 -- patch in calculation of line breakpoints, by Simon Pepping (spepping at leverkruid dot nl) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197051 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/layoutmgr/LineLayoutManager.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java index d04bdd5ab..32a280f39 100644 --- a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java @@ -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; } -- 2.39.5