From: Keiron Liddle Date: Tue, 28 Nov 2000 06:56:51 +0000 (+0000) Subject: Added a check to make sure a whitespace space isn't added to the X-Git-Tag: pre-columns~44 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e636b00ca25beabb705740925e8f9e5b73045ce9;p=xmlgraphics-fop.git Added a check to make sure a whitespace space isn't added to the end of a line, makes sure that the right alignment works Code changes sponsored by Dresdner Bank, Germany git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193842 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/layout/LineArea.java b/src/org/apache/fop/layout/LineArea.java index 923e549e6..e11000073 100644 --- a/src/org/apache/fop/layout/LineArea.java +++ b/src/org/apache/fop/layout/LineArea.java @@ -525,9 +525,13 @@ public class LineArea extends Area { */ public void addPending() { if (spaceWidth > 0) { - addChild(new InlineSpace(spaceWidth)); - finalWidth += spaceWidth; - spaceWidth = 0; + // this should handle the correct amount of space after + // the text if there is no more text, important for right alignment + if(this.whiteSpaceCollapse == WhiteSpaceCollapse.FALSE || pendingAreas.size() > 0) { + addChild(new InlineSpace(spaceWidth)); + finalWidth += spaceWidth; + spaceWidth = 0; + } } Enumeration e = pendingAreas.elements();