aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pepping <spepping@apache.org>2005-10-11 20:42:53 +0000
committerSimon Pepping <spepping@apache.org>2005-10-11 20:42:53 +0000
commitdf580155b427e37a03016d6ec3ac72e4842f3d5f (patch)
tree5d08e27d142120627b464be777a3d012c4ac7867
parentc0e673c4ca674e7477edfa183dacec5512a7c717 (diff)
downloadxmlgraphics-fop-df580155b427e37a03016d6ec3ac72e4842f3d5f.tar.gz
xmlgraphics-fop-df580155b427e37a03016d6ec3ac72e4842f3d5f.zip
Take the case into account when another LM starts a block sequence.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@312954 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java44
1 files changed, 31 insertions, 13 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
index 652b585c4..d95525380 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
@@ -695,25 +695,43 @@ public class LineLayoutManager extends InlineStackingLayoutManager
if (returnedList.size() == 0) {
continue;
}
- // does the first element of the first paragraph add to an existing word?
+
if (lastPar != null) {
- Object obj = returnedList.getFirst();
- KnuthElement thisElement;
- if (obj instanceof KnuthElement) {
- thisElement = (KnuthElement)obj;
- } else {
- KnuthSequence firstSeq = (KnuthSequence) obj;
- if (!firstSeq.isInlineSequence()) {
- log.error("Expect inline sequence as first sequence when last paragraph is not null");
+ Object firstObj;
+ KnuthSequence firstSeq = null;
+ firstObj = returnedList.getFirst();
+ if (firstObj instanceof KnuthSequence) {
+ firstSeq = (KnuthSequence) firstObj;
+ }
+
+ // finish last paragraph before a new block sequence
+ if (firstSeq != null && !firstSeq.isInlineSequence()) {
+ lastPar.endParagraph();
+ ElementListObserver.observe(lastPar, "line", null);
+ lastPar = null;
+ if (log.isTraceEnabled()) {
+ trace.append(" ]");
}
- thisElement = (KnuthElement) firstSeq.get(0);
+ bPrevWasKnuthBox = false;
}
- if (thisElement.isBox() && !thisElement.isAuxiliary()
- && bPrevWasKnuthBox) {
- lastPar.addALetterSpace();
+
+ // does the first element of the first paragraph add to an existing word?
+ if (lastPar != null) {
+ KnuthElement thisElement;
+ if (firstObj instanceof KnuthElement) {
+ thisElement = (KnuthElement) firstObj;
+ } else {
+ thisElement = (KnuthElement) firstSeq.get(0);
+ }
+ if (thisElement.isBox() && !thisElement.isAuxiliary()
+ && bPrevWasKnuthBox) {
+ lastPar.addALetterSpace();
+ }
}
+
}
+
// loop over the KnuthSequences (and single KnuthElements) in returnedList
// (LeafNodeLM descendants may also skip wrapping elements in KnuthSequences
// to cause fewer container structures)