]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixed text setting and width recalculation for forward page
authorJoerg Pietschmann <pietsch@apache.org>
Sun, 20 Jul 2003 19:53:34 +0000 (19:53 +0000)
committerJoerg Pietschmann <pietsch@apache.org>
Sun, 20 Jul 2003 19:53:34 +0000 (19:53 +0000)
number references.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@196732 13f79535-47bb-0310-9956-ffa450edef68

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

index 6dd25e217eefba8ca32c14ddd9eaeb3776c3c6cc..1d869d3a022ea64dcee8802f9d9da0a27af6324f 100644 (file)
@@ -378,10 +378,9 @@ public class LineArea extends Area {
                 Object o = children.get(i);
                 if ( o instanceof PageNumberInlineArea) {
                     PageNumberInlineArea pia = (PageNumberInlineArea)o;
-                    FontState piaFontState = pia.getFontState();
-                    finalWidth-=piaFontState.getWordWidth(pia.getText());
+                    finalWidth-=pia.getContentWidth();
                     pia.resolve(idReferences);
-                    finalWidth+=piaFontState.getWordWidth(pia.getText());
+                    finalWidth+=pia.getContentWidth();
                 }
             }
         }
index ff1811c46209834d2182cafc41367113d2bf3636..177dfbbdba67bab087b5f3bedc69d335e1be8d94 100644 (file)
@@ -59,7 +59,7 @@ public class PageNumberInlineArea extends WordArea {
 
     public PageNumberInlineArea(FontState fontState, float red, float green,
                                 float blue, String refid, int width) {
-        super(fontState, red, green, blue, "?", width);
+        super(fontState, red, green, blue, "   ", width);
         this.pageNumberId = refid;
     }
 
@@ -68,5 +68,6 @@ public class PageNumberInlineArea extends WordArea {
         if (text == null) {
             text = "";
         }
+        contentRectangleWidth = getFontState().getWordWidth(text);
     }
 }