From 48e97b07b9bd8f249af901a6e5899232c32c3017 Mon Sep 17 00:00:00 2001 From: Joerg Pietschmann Date: Mon, 30 Sep 2002 20:54:23 +0000 Subject: [PATCH] Use the formatted page number string instead of the raw number in IDReferences/IDNode, so that a page-number citation gets the formatted number. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@195253 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/datatypes/IDNode.java | 11 ++++++----- src/org/apache/fop/datatypes/IDReferences.java | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/org/apache/fop/datatypes/IDNode.java b/src/org/apache/fop/datatypes/IDNode.java index 4fd5a72ac..b9df94775 100644 --- a/src/org/apache/fop/datatypes/IDNode.java +++ b/src/org/apache/fop/datatypes/IDNode.java @@ -15,8 +15,9 @@ public class IDNode { private PDFGoTo internalLinkGoTo; - private int pageNumber = -1, xPosition = 0, // x position on page - yPosition = 0; // y position on page + private String pageNumber; + private int xPosition = 0; // x position on page + private int yPosition = 0; // y position on page /** @@ -34,8 +35,8 @@ public class IDNode { * * @param number page number of node */ - protected void setPageNumber(int number) { - pageNumber = number; + protected void setPageNumber(String pageNumber) { + this.pageNumber = pageNumber; } @@ -45,7 +46,7 @@ public class IDNode { * @return page number of this node */ public String getPageNumber() { - return (pageNumber != -1) ? new Integer(pageNumber).toString() : null; + return pageNumber; } diff --git a/src/org/apache/fop/datatypes/IDReferences.java b/src/org/apache/fop/datatypes/IDReferences.java index d3db78c78..afd5e6508 100644 --- a/src/org/apache/fop/datatypes/IDReferences.java +++ b/src/org/apache/fop/datatypes/IDReferences.java @@ -145,7 +145,7 @@ public class IDReferences { + area.getTableCellXOffset() - ID_PADDING, area.getPage().getBody().getYPosition() - area.getAbsoluteHeight() + ID_PADDING); - setPageNumber(id, area.getPage().getNumber()); + setPageNumber(id, area.getPage().getFormattedNumber()); area.getPage().addToIDList(id); } } @@ -307,7 +307,7 @@ public class IDReferences { * @param id The id whose page number is being set * @param pageNumber The page number of the specified id */ - public void setPageNumber(String id, int pageNumber) { + public void setPageNumber(String id, String pageNumber) { IDNode node = (IDNode)idReferences.get(id); node.setPageNumber(pageNumber); } -- 2.39.5