gmazza      2003/08/19 15:17:58

  Modified:    src/java/org/apache/fop/apps Driver.java
  Log:
  Deprecated (since mid-2001) setRenderer(rendererClassName, version) method removed.
  Fix to Bug 22561:  Driver.run() incorrectly setting output type to PDF for the 
structure (MIF and RTF) types.
  Submitted by: Michael Cosby (michael at cosby dot dhs dot org).
  
  Revision  Changes    Path
  1.29      +12 -18    xml-fop/src/java/org/apache/fop/apps/Driver.java
  
  Index: Driver.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/Driver.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Driver.java       19 Aug 2003 05:19:21 -0000      1.28
  +++ Driver.java       19 Aug 2003 22:17:57 -0000      1.29
  @@ -141,6 +141,11 @@
   public class Driver implements LogEnabled, FOTreeListener {
   
       /**
  +     * private constant to indicate renderer was not defined.
  +     */
  +    private static final int NOT_SET = 0;
  +
  +    /**
        * Render to PDF. OutputStream must be set
        */
       public static final int RENDER_PDF = 1;
  @@ -198,7 +203,7 @@
       /**
        * the renderer type code given by setRenderer
        */
  -    private int rendererType;
  +    private int rendererType = NOT_SET;
   
       /**
        * the renderer to use to output the area tree
  @@ -435,7 +440,8 @@
               //foInputHandler will be set later
               break;
           default:
  -            throw new IllegalArgumentException("Unknown renderer type");
  +            rendererType = NOT_SET;
  +            throw new IllegalArgumentException("Unknown renderer type " + renderer);
           }
       }
   
  @@ -462,20 +468,6 @@
       }
   
       /**
  -     * Sets the renderer.
  -     * @param rendererClassName the fully qualified classname of the renderer
  -     * class to use.
  -     * @param version version number
  -     * @deprecated use renderer.setProducer(version) + setRenderer(renderer) or
  -     * just setRenderer(rendererType) which will use the default producer string.
  -     * @see #setRenderer(int)
  -     * @see #setRenderer(Renderer)
  -     */
  -    public void setRenderer(String rendererClassName, String version) {
  -        setRenderer(rendererClassName);
  -    }
  -
  -    /**
        * Set the class name of the Renderer to use as well as the
        * producer string for those renderers that can make use of it.
        * @param rendererClassName classname of the renderer to use such as
  @@ -668,8 +660,10 @@
           if (!isInitialized()) {
               initialize();
           }
  -        if (renderer == null) {
  -            setRenderer(RENDER_PDF);
  +
  +        if (renderer == null && rendererType != RENDER_RTF 
  +            && rendererType != RENDER_MIF) {
  +                setRenderer(RENDER_PDF);
           }
   
           if (source == null) {
  
  
  

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

Reply via email to