You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by sp...@apache.org on 2005/10/11 22:42:58 UTC

svn commit: r312954 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java

Author: spepping
Date: Tue Oct 11 13:42:53 2005
New Revision: 312954

URL: http://svn.apache.org/viewcvs?rev=312954&view=rev
Log:
Take the case into account when another LM starts a block sequence.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
URL: http://svn.apache.org/viewcvs/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java?rev=312954&r1=312953&r2=312954&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java Tue Oct 11 13:42:53 2005
@@ -695,25 +695,43 @@
                 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)



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org