]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fix for ArrayIndexOutOfBoundException in block_white-space_4.
authorJeremias Maerki <jeremias@apache.org>
Thu, 16 Mar 2006 14:15:53 +0000 (14:15 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 16 Mar 2006 14:15:53 +0000 (14:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@386339 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java

index 3822cbc3acd3f42cc2760938a90f8afc58f8e3e5..53c55490d50807443c21201daee44f5830a06335 100644 (file)
@@ -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