From: Joerg Pietschmann Date: Sun, 20 Jul 2003 19:53:34 +0000 (+0000) Subject: Fixed text setting and width recalculation for forward page X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=29f8d8a02e1bca9b7c86d86ee9f342b7f39c7ecb;p=xmlgraphics-fop.git Fixed text setting and width recalculation for forward page 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 --- diff --git a/src/org/apache/fop/layout/LineArea.java b/src/org/apache/fop/layout/LineArea.java index 6dd25e217..1d869d3a0 100644 --- a/src/org/apache/fop/layout/LineArea.java +++ b/src/org/apache/fop/layout/LineArea.java @@ -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(); } } } diff --git a/src/org/apache/fop/layout/inline/PageNumberInlineArea.java b/src/org/apache/fop/layout/inline/PageNumberInlineArea.java index ff1811c46..177dfbbdb 100644 --- a/src/org/apache/fop/layout/inline/PageNumberInlineArea.java +++ b/src/org/apache/fop/layout/inline/PageNumberInlineArea.java @@ -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); } }