From 4596b5c7e9726ba8fe1dcceff1c403bcd3fadb13 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 16 Mar 2006 14:15:53 +0000 Subject: [PATCH] Fix for ArrayIndexOutOfBoundException in block_white-space_4. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@386339 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/inline/LineLayoutManager.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index 3822cbc3a..53c55490d 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -744,7 +744,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager } if (lastPar != null) { lastPar.endParagraph(); - ElementListObserver.observe(lastPar, "line", null); + ElementListObserver.observe(lastPar, "line", fobj.getId()); if (log.isTraceEnabled()) { trace.append(" ]"); } @@ -1641,9 +1641,15 @@ public class LineLayoutManager extends InlineStackingLayoutManager iEndElement--; // this returns the same KnuthElement seqIterator.previous(); - tempElement = (KnuthElement) seqIterator.previous(); + if (seqIterator.hasPrevious()) { + tempElement = (KnuthElement) seqIterator.previous(); + } else { + tempElement = null; + } + } + if (tempElement != null) { + lastLM = tempElement.getLayoutManager(); } - lastLM = tempElement.getLayoutManager(); // ignore KnuthGlue and KnuthPenalty objects // at the beginning of the line -- 2.39.5