]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
File missing from http://svn.apache.org/viewcvs?rev=374174&view=rev... Thanks, Manuel...
authorAndreas L. Delmelle <adelmelle@apache.org>
Thu, 2 Feb 2006 23:25:53 +0000 (23:25 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Thu, 2 Feb 2006 23:25:53 +0000 (23:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@374541 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java

index 6dc013859ce49acc35047da02a6ab39d31446620..4109836e03b144d9f4a309e6bcb54559c7ac6ae4 100644 (file)
@@ -363,9 +363,11 @@ public abstract class BreakingAlgorithm {
 
         // index of the first KnuthBox in the sequence
         int firstBoxIndex = startIndex;
-        while (alignment != org.apache.fop.fo.Constants.EN_CENTER
-               && ! ((KnuthElement) par.get(firstBoxIndex)).isBox()) {
-            firstBoxIndex++;
+        if (alignment != org.apache.fop.fo.Constants.EN_CENTER) {
+            while (par.size() > firstBoxIndex
+                    && ! ((KnuthElement) par.get(firstBoxIndex)).isBox()) {
+                firstBoxIndex++;
+            }
         }
 
         // create an active node representing the starting point