]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
A glue at the beginning of the element list can't be a legal break point. Fixes an...
authorJeremias Maerki <jeremias@apache.org>
Wed, 25 May 2005 19:16:00 +0000 (19:16 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 25 May 2005 19:16:00 +0000 (19:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198689 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
src/java/org/apache/fop/layoutmgr/table/TableStepper.java

index 05efd5548a55770d2b367fab121de365335775f8..06da89d4b9ba4271ea46c6b588df59aa903cca65 100644 (file)
@@ -304,10 +304,12 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager {
                         break;
                     }
                 } else if (el.isGlue()) {
-                    KnuthElement prev = (KnuthElement)elementLists[i].get(end[i] - 1);
-                    if (prev.isBox()) {
-                        //Second legal break point
-                        break;
+                    if (end[i] > 0) {
+                        KnuthElement prev = (KnuthElement)elementLists[i].get(end[i] - 1);
+                        if (prev.isBox()) {
+                            //Second legal break point
+                            break;
+                        }
                     }
                     partialHeights[i] += el.getW();
                 } else {
index 391595795eb807e890e49120e0fba170c3c00276..0d8d947a936529da34eaed3a1a033542e595920d 100644 (file)
@@ -354,10 +354,12 @@ public class TableStepper {
                         break;
                     }
                 } else if (el.isGlue()) {
-                    KnuthElement prev = (KnuthElement)elementLists[i].get(end[i] - 1);
-                    if (prev.isBox()) {
-                        //Second legal break point
-                        break;
+                    if (end[i] > 0) {
+                        KnuthElement prev = (KnuthElement)elementLists[i].get(end[i] - 1);
+                        if (prev.isBox()) {
+                            //Second legal break point
+                            break;
+                        }
                     }
                     widths[i] += el.getW();
                 } else {