aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2003-12-15 22:39:01 +0000
committerGlen Mazza <gmazza@apache.org>2003-12-15 22:39:01 +0000
commitcd6650db7f1a2061c7cfc750b0f09cdd034a86bb (patch)
treed2c4e4ca9fc9c315e83a5fe560552e412310747e /src
parent78da1bcaccb13632482f4ef58d9c8ec71e3cbd5d (diff)
downloadxmlgraphics-fop-cd6650db7f1a2061c7cfc750b0f09cdd034a86bb.tar.gz
xmlgraphics-fop-cd6650db7f1a2061c7cfc750b0f09cdd034a86bb.zip
Hyphenation/Quotation problem fixed ("quoted strings" not breaking properly.)
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
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/layoutmgr/LineLayoutManager.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
index 62014219e..d04bdd5ab 100644
--- a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
@@ -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