git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@374541
13f79535-47bb-0310-9956-
ffa450edef68
// 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