]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Earlier fix was not quite right. TODO can be removed now.
authorJeremias Maerki <jeremias@apache.org>
Mon, 8 Aug 2005 14:28:13 +0000 (14:28 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 8 Aug 2005 14:28:13 +0000 (14:28 +0000)
Early null check to make debugging easier.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/inlineblock@230806 13f79535-47bb-0310-9956-ffa450edef68

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

index 4a551d3205d505791af074d2b484adb2ccc6c63d..808f271ec8cca425b0d4dfef5c18f9e79937b436 100644 (file)
@@ -287,10 +287,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager
                 // the letter space is added to <aux glue>,
                 // while the other elements are not changed
                 oldList.add(prevBox);
-                // TODO check if this is the correct place; merge was not correct
-                // already done by above call???? oldList.addFirst((KnuthBox) removeLast());
                 oldList.addFirst((KnuthGlue) removeLast());
                 oldList.addFirst((KnuthPenalty) removeLast());
+                oldList.addFirst((KnuthBox) removeLast());
             }
             // adding a letter space could involve, according to the text
             // represented by oldList, replacing a glue element or adding
@@ -682,6 +681,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
                             lastElement = singleElement;
                         } else {
                             lastElement = (KnuthElement) sequence.getLast();
+                            if (lastElement == null) {
+                                throw new NullPointerException(
+                                        "Sequence was empty! lastElement is null");
+                            }
                         }
                         bPrevWasKnuthBox = lastElement.isBox();