gears       01/09/05 11:13:20

  Modified:    src/org/apache/fop/render/ps PSRenderer.java
  Log:
  Jeremias Maerki's patch to fix page citations for PostScript rendering.
  Is this broken in other renderers as well?
  
  Revision  Changes    Path
  1.10      +16 -2     xml-fop/src/org/apache/fop/render/ps/PSRenderer.java
  
  Index: PSRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/render/ps/PSRenderer.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PSRenderer.java   2001/08/21 06:18:55     1.9
  +++ PSRenderer.java   2001/09/05 18:13:19     1.10
  @@ -1,5 +1,5 @@
   /*
  - * $Id: PSRenderer.java,v 1.9 2001/08/21 06:18:55 keiron Exp $
  + * $Id: PSRenderer.java,v 1.10 2001/09/05 18:13:19 gears Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -108,6 +108,8 @@
   
       private FontInfo fontInfo;
   
  +    protected IDReferences idReferences;
  +
       protected Hashtable options;
   
   
  @@ -611,8 +613,18 @@
           FontState fs = area.getFontState();
           String fontWeight = fs.getFontWeight();
           StringBuffer sb = new StringBuffer();
  -        String s = area.getText();
  +        String s;
  +        if (area.getPageNumberID()
  +                != null) {    // this text is a page number, so resolve it
  +            s = idReferences.getPageNumber(area.getPageNumberID());
  +            if (s == null) {
  +                s = "";
  +            }
  +        } else {
  +            s = area.getText();
  +        }
           int l = s.length();
  +        
           for (int i = 0; i < l; i++) {
               char ch = s.charAt(i);
               char mch = fs.mapChar(ch);
  @@ -709,6 +721,8 @@
        * @param page the page to render
        */
       public void renderPage(Page page) {
  +        this.idReferences = page.getIDReferences();
  +
           BodyAreaContainer body;
           AreaContainer before, after;
           write("%%Page: " + page.getNumber() + " " + page.getNumber());
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to