From a4bbb9175e15edeae6aad447f1fabd06e0d1a8d9 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Wed, 25 May 2005 19:16:00 +0000 Subject: A glue at the beginning of the element list can't be a legal break point. Fixes an ArrayIndexOutOfBounds when there's a space-before at the beginning of the list. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198689 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/layoutmgr/list/ListItemLayoutManager.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/java/org/apache/fop/layoutmgr/list') diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java index 05efd5548..06da89d4b 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java @@ -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 { -- cgit v1.2.3