]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugfix for Bugzilla #36248 (and inline2.xml):
authorJeremias Maerki <jeremias@apache.org>
Sat, 20 Aug 2005 15:01:37 +0000 (15:01 +0000)
committerJeremias Maerki <jeremias@apache.org>
Sat, 20 Aug 2005 15:01:37 +0000 (15:01 +0000)
Nest KnuthElements in inline KnuthSequences.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@234042 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java
src/java/org/apache/fop/layoutmgr/inline/FootnoteLayoutManager.java
src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java

index 9f05e8876bfc93bfd72dda5d187686cb80df0df5..b278c0f2bf569e051450f0f9695e796a0835f296 100644 (file)
@@ -23,6 +23,7 @@ import org.apache.fop.fonts.Font;
 import org.apache.fop.layoutmgr.KnuthElement;
 import org.apache.fop.layoutmgr.KnuthGlue;
 import org.apache.fop.layoutmgr.KnuthPenalty;
+import org.apache.fop.layoutmgr.KnuthSequence;
 import org.apache.fop.layoutmgr.LayoutContext;
 import org.apache.fop.layoutmgr.LeafPosition;
 import org.apache.fop.layoutmgr.Position;
@@ -103,7 +104,7 @@ public class CharacterLayoutManager extends LeafNodeLayoutManager {
                                            int alignment) {
         MinOptMax ipd;
         curArea = get(context);
-        LinkedList returnList = new LinkedList();
+        KnuthSequence seq = new KnuthSequence(true);
 
         if (curArea == null) {
             setFinished(true);
@@ -146,7 +147,7 @@ public class CharacterLayoutManager extends LeafNodeLayoutManager {
         // node is a fo:Character
         if (letterSpaceIPD.min == letterSpaceIPD.max) {
             // constant letter space, only return a box
-            returnList.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead,
+            seq.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead,
                                         areaInfo.total, areaInfo.middle,
                                         new LeafPosition(this, 0), false));
         } else {
@@ -154,17 +155,19 @@ public class CharacterLayoutManager extends LeafNodeLayoutManager {
             // at the moment the character is supposed to have no letter spaces,
             // but returning this sequence allows us to change only one element
             // if addALetterSpaceTo() is called
-            returnList.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead,
+            seq.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead,
                                         areaInfo.total, areaInfo.middle,
                                         new LeafPosition(this, 0), false));
-            returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
+            seq.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
                                             new LeafPosition(this, -1), true));
-            returnList.add(new KnuthGlue(0, 0, 0,
+            seq.add(new KnuthGlue(0, 0, 0,
                                          new LeafPosition(this, -1), true));
-            returnList.add(new KnuthInlineBox(0, 0, 0, 0,
+            seq.add(new KnuthInlineBox(0, 0, 0, 0,
                                         new LeafPosition(this, -1), true));
         }
 
+        LinkedList returnList = new LinkedList();
+        returnList.add(seq);
         setFinished(true);
         return returnList;
     }
index 779c4c5879715b4fed756bec238a6aa99ccdf649..21267f7c59c8dd378b941ef639df4e907fb14429 100644 (file)
@@ -74,7 +74,9 @@ public class FootnoteLayoutManager extends AbstractLayoutManager
         if (returnedList.size() == 0) {
             //Inline part of the footnote is empty. Need to send back an auxiliary
             //zero-width, zero-height inline box so the footnote gets painted.
-            returnedList.add(new KnuthInlineBox(0, 0, 0, 0, null, true));
+            KnuthSequence seq = new KnuthSequence(true);
+            seq.add(new KnuthInlineBox(0, 0, 0, 0, null, true));
+            returnedList.add(seq);
         }
         setFinished(true);
 
index 8dc2481c87fc402050bd8f7eb5cad723ded5450a..7d87ea8fd960e0c00cf3679004ac3917669101a6 100644 (file)
@@ -30,6 +30,7 @@ import org.apache.fop.layoutmgr.KnuthElement;
 import org.apache.fop.layoutmgr.KnuthGlue;
 import org.apache.fop.layoutmgr.KnuthPenalty;
 import org.apache.fop.layoutmgr.KnuthPossPosIter;
+import org.apache.fop.layoutmgr.KnuthSequence;
 import org.apache.fop.layoutmgr.LayoutContext;
 import org.apache.fop.layoutmgr.LeafPosition;
 import org.apache.fop.layoutmgr.Position;
@@ -244,7 +245,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
                                            int alignment) {
         MinOptMax ipd;
         curArea = get(context);
-        LinkedList returnList = new LinkedList();
+        KnuthSequence seq = new KnuthSequence(true);
 
         if (curArea == null) {
             setFinished(true);
@@ -273,20 +274,22 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
                                 lead, total, middle);
 
         // node is a fo:Leader
-        returnList.add(new KnuthInlineBox(0, areaInfo.lead, areaInfo.total,
+        seq.add(new KnuthInlineBox(0, areaInfo.lead, areaInfo.total,
                                     areaInfo.middle,
                                     new LeafPosition(this, -1), true));
-        returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
+        seq.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
                                         new LeafPosition(this, -1), true));
-        returnList.add
+        seq.add
             (new KnuthGlue(areaInfo.ipdArea.opt,
                            areaInfo.ipdArea.max - areaInfo.ipdArea.opt,
                            areaInfo.ipdArea.opt - areaInfo.ipdArea.min, 
                            new LeafPosition(this, 0), false));
-        returnList.add(new KnuthInlineBox(0, areaInfo.lead, areaInfo.total,
+        seq.add(new KnuthInlineBox(0, areaInfo.lead, areaInfo.total,
                                     areaInfo.middle,
                                     new LeafPosition(this, -1), true));
 
+        LinkedList returnList = new LinkedList();
+        returnList.add(seq);
         setFinished(true);
         return returnList;
     }
index 1bd06564cc9fca1c75002bb70aeb740d1533c860..56a8e9f1050ba534371ebbd874cf73ba9c132e22 100644 (file)
@@ -22,6 +22,7 @@ import org.apache.fop.area.Area;
 import org.apache.fop.area.inline.InlineArea;
 import org.apache.fop.fo.FObj;
 import org.apache.fop.layoutmgr.AbstractLayoutManager;
+import org.apache.fop.layoutmgr.KnuthSequence;
 import org.apache.fop.layoutmgr.LayoutContext;
 import org.apache.fop.layoutmgr.LeafPosition;
 import org.apache.fop.layoutmgr.Position;
@@ -286,10 +287,12 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
 
         // node is a fo:ExternalGraphic, fo:InstreamForeignObject,
         // fo:PageNumber or fo:PageNumberCitation
-        LinkedList returnList = new LinkedList();
-        returnList.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead,
+        KnuthSequence seq = new KnuthSequence(true);
+        seq.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.lead,
                                     areaInfo.total, areaInfo.middle,
                                     new LeafPosition(this, 0), false));
+        LinkedList returnList = new LinkedList();
+        returnList.add(seq);
         setFinished(true);
         return returnList;
     }