From: Jeremias Maerki Date: Mon, 8 Aug 2005 14:29:49 +0000 (+0000) Subject: Bugfix: Remove empty sequence at the end. X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7b64dcd92692ae430fba6376a251243627cfe03f;p=xmlgraphics-fop.git Bugfix: Remove empty sequence at the end. 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 --- diff --git a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java index 77a70e9bf..77d560df1 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java @@ -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);