]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added a check to make sure a whitespace space isn't added to the
authorKeiron Liddle <keiron@apache.org>
Tue, 28 Nov 2000 06:56:51 +0000 (06:56 +0000)
committerKeiron Liddle <keiron@apache.org>
Tue, 28 Nov 2000 06:56:51 +0000 (06:56 +0000)
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

src/org/apache/fop/layout/LineArea.java

index 923e549e65e28d015c1ff462fb68bbfb26051bcb..e1100007324d9df76c82bf9561b0bedafb95db50 100644 (file)
@@ -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();