]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugfix: Remove empty sequence at the end.
authorJeremias Maerki <jeremias@apache.org>
Mon, 8 Aug 2005 14:29:49 +0000 (14:29 +0000)
committerJeremias Maerki <jeremias@apache.org>
Mon, 8 Aug 2005 14:29:49 +0000 (14:29 +0000)
Bugfix: Don't check the "sequence" variable but the "returnList" variable for size() > 0. This ate up text.

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

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

index 77a70e9bf0f8958f587e3266b1036365ea4d555f..77d560df167ebf3c79a06142cecc715826c03eef 100644 (file)
@@ -596,8 +596,12 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
                 iNextStart = iTempStart;
             }
         } // end of while
+        if (((List)returnList.getLast()).size() == 0) {
+            //Remove an empty sequence because of a trailing newline
+            returnList.removeLast();
+        }
         setFinished(true);
-        if (sequence.size() > 0) {
+        if (returnList.size() > 0) {
             return returnList;
         } else {
             return null;
@@ -609,7 +613,8 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
         // look at the Position stored in the first element in oldList
         // which is always a box
         ListIterator oldListIterator = oldList.listIterator();
-        LeafPosition pos = (LeafPosition) ((KnuthBox) oldListIterator.next()).getPosition();
+        KnuthElement el = (KnuthElement)oldListIterator.next();
+        LeafPosition pos = (LeafPosition) ((KnuthBox) el).getPosition();
         AreaInfo ai = (AreaInfo) vecAreaInfo.get(pos.getLeafPos());
         ai.iLScount ++;
         ai.ipdArea.add(letterSpaceIPD);