vmote       2003/06/29 18:31:16

  Modified:    src/java/org/apache/fop/rtf/rtflib/exceptions
                        RtfException.java RtfStructureException.java
               src/java/org/apache/fop/rtf/rtflib/interfaces
                        ITableColumnsInfo.java
               src/java/org/apache/fop/rtf/rtflib/rtfdoc
                        IBorderAttributes.java IRtfAfterContainer.java
                        IRtfBeforeContainer.java IRtfBookmarkContainer.java
                        IRtfExternalGraphicContainer.java
                        IRtfHyperLinkContainer.java
                        IRtfJforCmdContainer.java IRtfListContainer.java
                        IRtfOptions.java IRtfPageBreakContainer.java
                        IRtfPageContainer.java RtfTable.java
                        RtfTableCell.java RtfTableRow.java RtfTemplate.java
                        RtfText.java WhitespaceCollapser.java
  Log:
  style changes only
  
  Revision  Changes    Path
  1.3       +3 -5      
xml-fop/src/java/org/apache/fop/rtf/rtflib/exceptions/RtfException.java
  
  Index: RtfException.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/exceptions/RtfException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RtfException.java 29 Jun 2003 22:56:29 -0000      1.2
  +++ RtfException.java 30 Jun 2003 01:31:13 -0000      1.3
  @@ -62,10 +62,8 @@
    *  @author Bertrand Delacretaz [EMAIL PROTECTED]
    */
   
  -public class RtfException extends java.io.IOException
  -{
  -    public RtfException(String reason)
  -    {
  +public class RtfException extends java.io.IOException {
  +    public RtfException(String reason) {
           super(reason);
       }
   }
  
  
  
  1.3       +3 -5      
xml-fop/src/java/org/apache/fop/rtf/rtflib/exceptions/RtfStructureException.java
  
  Index: RtfStructureException.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/exceptions/RtfStructureException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RtfStructureException.java        29 Jun 2003 22:56:29 -0000      1.2
  +++ RtfStructureException.java        30 Jun 2003 01:31:13 -0000      1.3
  @@ -63,10 +63,8 @@
    */
   
   public class RtfStructureException
  -extends RtfException
  -{
  -    public RtfStructureException(String reason)
  -    {
  +extends RtfException {
  +    public RtfStructureException(String reason) {
           super(reason);
       }
   }
  
  
  
  1.4       +4 -5      
xml-fop/src/java/org/apache/fop/rtf/rtflib/interfaces/ITableColumnsInfo.java
  
  Index: ITableColumnsInfo.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/interfaces/ITableColumnsInfo.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ITableColumnsInfo.java    29 Jun 2003 22:56:29 -0000      1.3
  +++ ITableColumnsInfo.java    30 Jun 2003 01:31:13 -0000      1.4
  @@ -62,8 +62,7 @@
    *  @author Bertrand Delacretaz [EMAIL PROTECTED]
    */
   
  -public interface ITableColumnsInfo
  -{
  +public interface ITableColumnsInfo {
       float INVALID_COLUM_WIDTH = 200f;
   
       /** reset the column iteration index, meant to be called when creating a new 
row */
  @@ -77,9 +76,9 @@
        */
       float getColumnWidth();
   
  -     /** return current column iteration index */
  +     /** @return current column iteration index */
        int getColumnIndex();
   
  -     /** return number of columns */
  +     /** @return number of columns */
        int getNumberOfColumns();
   }
  
  
  
  1.3       +7 -7      
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IBorderAttributes.java
  
  Index: IBorderAttributes.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IBorderAttributes.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IBorderAttributes.java    29 Jun 2003 22:56:29 -0000      1.2
  +++ IBorderAttributes.java    30 Jun 2003 01:31:14 -0000      1.3
  @@ -64,12 +64,12 @@
   
       String BORDER_SINGLE_THICKNESS = "brdrs";
       String BORDER_DOUBLE_THICKNESS = "brdrth";
  -    String BORDER_SHADOWED ="brdrsh";
  -    String BORDER_DOUBLE ="brdrdb";
  -    String BORDER_DOTTED ="brdrdot";
  -    String BORDER_DASH ="brdrdash";
  -    String BORDER_HAIRLINE ="brdrhair";
  -    String BORDER_DASH_SMALL ="brdrdashsm";
  +    String BORDER_SHADOWED = "brdrsh";
  +    String BORDER_DOUBLE = "brdrdb";
  +    String BORDER_DOTTED = "brdrdot";
  +    String BORDER_DASH = "brdrdash";
  +    String BORDER_HAIRLINE = "brdrhair";
  +    String BORDER_DASH_SMALL = "brdrdashsm";
       String BORDER_DOT_DASH = "brdrdashd";
       String BORDER_DOT_DOT_DASH = "brdrdashdd";
       String BORDER_TRIPLE = "brdrtriple";
  
  
  
  1.3       +3 -4      
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfAfterContainer.java
  
  Index: IRtfAfterContainer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfAfterContainer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IRtfAfterContainer.java   29 Jun 2003 22:56:29 -0000      1.2
  +++ IRtfAfterContainer.java   30 Jun 2003 01:31:14 -0000      1.3
  @@ -61,7 +61,6 @@
   import java.io.IOException;
   
   /** interface for RTF objects that can contain footers */
  -public interface IRtfAfterContainer
  -{
  -    public RtfAfter newAfter(RtfAttributes attrs) throws IOException;
  +public interface IRtfAfterContainer {
  +    RtfAfter newAfter(RtfAttributes attrs) throws IOException;
   }
  
  
  
  1.3       +3 -4      
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java
  
  Index: IRtfBeforeContainer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IRtfBeforeContainer.java  29 Jun 2003 22:56:29 -0000      1.2
  +++ IRtfBeforeContainer.java  30 Jun 2003 01:31:14 -0000      1.3
  @@ -60,7 +60,6 @@
   
   import java.io.IOException;
   
  -public interface IRtfBeforeContainer
  -{
  -    public RtfBefore newBefore(RtfAttributes attrs) throws IOException;
  +public interface IRtfBeforeContainer {
  +    RtfBefore newBefore(RtfAttributes attrs) throws IOException;
   }
  
  
  
  1.4       +67 -68    
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java
  
  Index: IRtfBookmarkContainer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IRtfBookmarkContainer.java        30 Jun 2003 00:20:07 -0000      1.3
  +++ IRtfBookmarkContainer.java        30 Jun 2003 01:31:15 -0000      1.4
  @@ -1,47 +1,47 @@
  -/*
  - * $Id$
  - * ============================================================================
  - *                    The Apache Software License, Version 1.1
  - * ============================================================================
  - *
  - * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without modifica-
  - * tion, are permitted provided that the following conditions are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright notice,
  - *    this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright notice,
  - *    this list of conditions and the following disclaimer in the documentation
  - *    and/or other materials provided with the distribution.
  - *
  - * 3. The end-user documentation included with the redistribution, if any, must
  - *    include the following acknowledgment: "This product includes software
  - *    developed by the Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself, if
  - *    and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  - *    endorse or promote products derived from this software without prior
  - *    written permission. For written permission, please contact
  - *    [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache", nor may
  - *    "Apache" appear in their name, without prior written permission of the
  - *    Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  - * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  - * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  - * ============================================================================
  +/*
  + * $Id$
  + * ============================================================================
  + *                    The Apache Software License, Version 1.1
  + * ============================================================================
  + *
  + * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without modifica-
  + * tion, are permitted provided that the following conditions are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright notice,
  + *    this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright notice,
  + *    this list of conditions and the following disclaimer in the documentation
  + *    and/or other materials provided with the distribution.
  + *
  + * 3. The end-user documentation included with the redistribution, if any, must
  + *    include the following acknowledgment: "This product includes software
  + *    developed by the Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself, if
  + *    and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  + *    endorse or promote products derived from this software without prior
  + *    written permission. For written permission, please contact
  + *    [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache", nor may
  + *    "Apache" appear in their name, without prior written permission of the
  + *    Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  + * ============================================================================
    *
    * This software consists of voluntary contributions made by many individuals
    * on behalf of the Apache Software Foundation and was originally created by
  @@ -55,27 +55,26 @@
    * contributors to the jfor project (www.jfor.org), who agreed to donate jfor to
    * the FOP project.
    */
  -
  -package org.apache.fop.rtf.rtflib.rtfdoc;
  -
  -import java.io.IOException;
  -
  -/**
  - * RTF Bookmark container interface.
  - * @author <a href="mailto:[EMAIL PROTECTED]">Andreas Putz</a>
  - */
  -public interface IRtfBookmarkContainer
  -{
  -
  -    /**
  -     * Create a new RTF bookmark.
  -     *
  -     * @param bookmark Name of the bookmark
  -     *
  -     * @return RTF bookmark
  -     *
  -     * @throws IOException On eror
  -     */
  -    RtfBookmark newBookmark (String bookmark) throws IOException;
  -}
  -
  +
  +package org.apache.fop.rtf.rtflib.rtfdoc;
  +
  +import java.io.IOException;
  +
  +/**
  + * RTF Bookmark container interface.
  + * @author <a href="mailto:[EMAIL PROTECTED]">Andreas Putz</a>
  + */
  +public interface IRtfBookmarkContainer {
  +
  +    /**
  +     * Create a new RTF bookmark.
  +     *
  +     * @param bookmark Name of the bookmark
  +     *
  +     * @return RTF bookmark
  +     *
  +     * @throws IOException On eror
  +     */
  +    RtfBookmark newBookmark (String bookmark) throws IOException;
  +}
  +
  
  
  
  1.4       +2 -3      
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfExternalGraphicContainer.java
  
  Index: IRtfExternalGraphicContainer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfExternalGraphicContainer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IRtfExternalGraphicContainer.java 30 Jun 2003 00:20:07 -0000      1.3
  +++ IRtfExternalGraphicContainer.java 30 Jun 2003 01:31:15 -0000      1.4
  @@ -60,8 +60,7 @@
   
   import java.io.IOException;
   
  -public interface IRtfExternalGraphicContainer
  -{
  +public interface IRtfExternalGraphicContainer {
   
       /**
        * Creates a new image on external graphic base.
  
  
  
  1.4       +3 -4      
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java
  
  Index: IRtfHyperLinkContainer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IRtfHyperLinkContainer.java       30 Jun 2003 00:20:07 -0000      1.3
  +++ IRtfHyperLinkContainer.java       30 Jun 2003 01:31:15 -0000      1.4
  @@ -63,12 +63,11 @@
   /** interface for RtfElements that can contain RtfHyperLinks
    *  @author Andreas Putz [EMAIL PROTECTED]
    */
  -public interface IRtfHyperLinkContainer extends IRtfTextContainer
  -{
  +public interface IRtfHyperLinkContainer extends IRtfTextContainer {
       /**
        * Creates a new hyperlink.
        *
        * @exception IOException on error
        */
  -    public RtfHyperLink newHyperLink (String str, RtfAttributes attr) throws 
IOException;
  +    RtfHyperLink newHyperLink (String str, RtfAttributes attr) throws IOException;
   }
  
  
  
  1.4       +2 -2      
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java
  
  Index: IRtfJforCmdContainer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IRtfJforCmdContainer.java 30 Jun 2003 00:20:07 -0000      1.3
  +++ IRtfJforCmdContainer.java 30 Jun 2003 01:31:15 -0000      1.4
  @@ -62,5 +62,5 @@
   import java.io.IOException;
   
   public interface IRtfJforCmdContainer {
  -    public RtfJforCmd newJforCmd(RtfAttributes attr) throws IOException;
  +    RtfJforCmd newJforCmd(RtfAttributes attr) throws IOException;
   }
  
  
  
  1.3       +3 -4      
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfListContainer.java
  
  Index: IRtfListContainer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfListContainer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IRtfListContainer.java    29 Jun 2003 22:56:29 -0000      1.2
  +++ IRtfListContainer.java    30 Jun 2003 01:31:15 -0000      1.3
  @@ -64,8 +64,7 @@
    *  @author Bertrand Delacretaz [EMAIL PROTECTED]
    */
   
  -public interface IRtfListContainer
  -{
  +public interface IRtfListContainer {
       /** close current list if any and start a new one */
  -    public RtfList newList(RtfAttributes attrs) throws IOException;
  +    RtfList newList(RtfAttributes attrs) throws IOException;
   }
  
  
  
  1.4       +4 -5      
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfOptions.java
  
  Index: IRtfOptions.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfOptions.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IRtfOptions.java  30 Jun 2003 00:20:07 -0000      1.3
  +++ IRtfOptions.java  30 Jun 2003 01:31:15 -0000      1.4
  @@ -61,17 +61,16 @@
   /**
    * Options for configuring the rtf elements.
    */
  -public interface IRtfOptions
  -{
  +public interface IRtfOptions {
       /**
        * Sets  the compression rate for the external graphic in percent.
        * @param percent Compression rate
        */
  -    public void setRtfExternalGraphicCompressionRate (int percent);
  +    void setRtfExternalGraphicCompressionRate (int percent);
   
       /**
        * Gets  the compression rate for the external graphic in percent.
        * @return Compression rate
        */
  -    public int getRtfExternalGraphicCompressionRate ();
  +    int getRtfExternalGraphicCompressionRate ();
   }
  
  
  
  1.3       +3 -4      
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java
  
  Index: IRtfPageBreakContainer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IRtfPageBreakContainer.java       29 Jun 2003 22:56:29 -0000      1.2
  +++ IRtfPageBreakContainer.java       30 Jun 2003 01:31:15 -0000      1.3
  @@ -64,8 +64,7 @@
    *  @author Bertrand Delacretaz [EMAIL PROTECTED]
    */
   
  -public interface IRtfPageBreakContainer
  -{
  +public interface IRtfPageBreakContainer {
       /** add a page break */
  -    public void newPageBreak() throws IOException;
  +    void newPageBreak() throws IOException;
   }
  
  
  
  1.3       +3 -4      
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfPageContainer.java
  
  Index: IRtfPageContainer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/IRtfPageContainer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IRtfPageContainer.java    29 Jun 2003 22:56:29 -0000      1.2
  +++ IRtfPageContainer.java    30 Jun 2003 01:31:15 -0000      1.3
  @@ -64,10 +64,9 @@
    *  @author Bertrand Delacretaz [EMAIL PROTECTED]
    */
   
  -public interface IRtfPageContainer
  -{
  +public interface IRtfPageContainer {
       /** close current text run if any and start a new one with specified attributes
        *  @param str if not null, added to the RtfText created
        */
  -    public RtfPage newPage(RtfAttributes attrs) throws IOException;
  +    RtfPage newPage(RtfAttributes attrs) throws IOException;
   }
  
  
  
  1.6       +32 -35    xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTable.java
  
  Index: RtfTable.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTable.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RtfTable.java     30 Jun 2003 00:20:07 -0000      1.5
  +++ RtfTable.java     30 Jun 2003 01:31:15 -0000      1.6
  @@ -58,26 +58,26 @@
   
   package org.apache.fop.rtf.rtflib.rtfdoc;
   
  -import java.io.*;
  -import java.util.Iterator;
  +import java.io.Writer;
  +import java.io.IOException;
   import org.apache.fop.rtf.rtflib.interfaces.ITableColumnsInfo;
   
   /**  Container for RtfRow elements
    *  @author Bertrand Delacretaz [EMAIL PROTECTED]
    */
   
  -public class RtfTable extends RtfContainer
  -{
  +public class RtfTable extends RtfContainer {
       private RtfTableRow m_row;
  -    private int highestRow=0;
  +    private int highestRow = 0;
   
  -    /** Added by Boris Poudérous on 07/22/2002 in order to process 
number-columns-spanned attribute */
  +    /** Added by Boris Poudérous on 07/22/2002 in order to process
  +     *  number-columns-spanned attribute */
       private ITableColumnsInfo m_table_context;
   
       /** Create an RTF element as a child of given container */
  -    RtfTable(IRtfTableContainer parent, Writer w, ITableColumnsInfo tc) throws 
IOException
  -    {
  -        super((RtfContainer)parent,w);
  +    RtfTable(IRtfTableContainer parent, Writer w, ITableColumnsInfo tc)
  +            throws IOException {
  +        super((RtfContainer)parent, w);
           // Line added by Boris Poudérous on 07/22/2002
           m_table_context = tc;
       }
  @@ -85,62 +85,59 @@
       /** Create an RTF element as a child of given container
      * Modified by Boris Poudérous in order to process 'number-columns-spanned' 
attribute
      */
  -  RtfTable(IRtfTableContainer parent, Writer w, RtfAttributes attrs, 
ITableColumnsInfo tc) throws IOException
  -    {
  -        super((RtfContainer)parent,w,attrs);
  +  RtfTable(IRtfTableContainer parent, Writer w, RtfAttributes attrs,
  +           ITableColumnsInfo tc) throws IOException {
  +        super((RtfContainer)parent, w, attrs);
       // Line added by Boris Poudérous on 07/22/2002
       m_table_context = tc;
       }
   
       /** close current row if any and start a new one */
  -    public RtfTableRow newTableRow() throws IOException
  -    {
  -        if(m_row != null) m_row.close();
  +    public RtfTableRow newTableRow() throws IOException {
  +        if (m_row != null) {
  +            m_row.close();
  +        }
   
           highestRow++;
  -        m_row = new RtfTableRow(this,m_writer,m_attrib,highestRow);
  +        m_row = new RtfTableRow(this, m_writer, m_attrib, highestRow);
           return m_row;
       }
       /** close current row if any and start a new one */
  -    public RtfTableRow newTableRow(RtfAttributes attrs) throws IOException
  -    {
  +    public RtfTableRow newTableRow(RtfAttributes attrs) throws IOException {
           RtfAttributes attr = null;
  -        if (m_attrib != null)
  -        {
  +        if (m_attrib != null) {
               attr = (RtfAttributes) m_attrib.clone ();
               attr.set (attrs);
  -        }
  -        else
  +        } else {
               attr = attrs;
  -        if(m_row != null) m_row.close();
  +        }
  +        if (m_row != null) {
  +            m_row.close();
  +        }
           highestRow++;
   
  -        m_row = new RtfTableRow(this,m_writer,attr,highestRow);
  +        m_row = new RtfTableRow(this, m_writer, attr, highestRow);
           return m_row;
       }
   
   
   
       /** overridden to write RTF prefix code, what comes before our children */
  -    protected void writeRtfPrefix() throws IOException
  -    {
  +    protected void writeRtfPrefix() throws IOException {
           writeGroupMark(true);
       }
   
       /** overridden to write RTF suffix code, what comes after our children */
  -    protected void writeRtfSuffix() throws IOException
  -    {
  +    protected void writeRtfSuffix() throws IOException {
           writeGroupMark(false);
       }
   
  -    public boolean isHighestRow(int id)
  -    {
  +    public boolean isHighestRow(int id) {
           return (highestRow == id) ? true : false;
       }
   
       /** Added by Boris Poudérous on 07/22/2002 */
  -    public ITableColumnsInfo getITableColumnsInfo()
  -    {
  +    public ITableColumnsInfo getITableColumnsInfo() {
         return this.m_table_context;
       }
   
  @@ -148,7 +145,7 @@
   
       // Added by Normand Masse
       // Support for table-header attributes (used instead of table attributes
  -    public void setHeaderAttribs( RtfAttributes attrs ) {
  +    public void setHeaderAttribs(RtfAttributes attrs) {
           m_header_attribs = attrs;
       }
   
  @@ -156,7 +153,7 @@
       // Returns the table-header attributes if they are present, otherwise the
       // parent's attributes are returned normally.
       public RtfAttributes getRtfAttributes() {
  -        if ( m_header_attribs != null ) {
  +        if (m_header_attribs != null) {
               return m_header_attribs;
           }
   
  
  
  
  1.6       +81 -81    
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableCell.java
  
  Index: RtfTableCell.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableCell.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RtfTableCell.java 30 Jun 2003 00:20:07 -0000      1.5
  +++ RtfTableCell.java 30 Jun 2003 01:31:15 -0000      1.6
  @@ -58,8 +58,9 @@
   
   package org.apache.fop.rtf.rtflib.rtfdoc;
   
  -import java.io.*;
  -import java.util.*;
  +import java.io.Writer;
  +import java.io.IOException;
  +import java.util.Iterator;
   import org.apache.fop.rtf.rtflib.interfaces.ITableColumnsInfo;
   
   /**  A cell in an RTF table, container for paragraphs, lists, etc.
  @@ -68,7 +69,8 @@
   
   public class RtfTableCell
   extends RtfContainer
  -implements 
IRtfParagraphContainer,IRtfListContainer,IRtfTableContainer,IRtfExternalGraphicContainer
 {
  +implements IRtfParagraphContainer, IRtfListContainer, IRtfTableContainer,
  +       IRtfExternalGraphicContainer {
       private RtfParagraph m_paragraph;
       private RtfList m_list;
       private RtfTable m_table;
  @@ -89,17 +91,17 @@
       private int m_hMerge = NO_MERGE;
   
       /** cell merging: this cell is not merged */
  -    public final static int NO_MERGE = 0;
  +    public static final int NO_MERGE = 0;
   
       /** cell merging: this cell is the start of a range of merged cells */
  -    public final static int MERGE_START = 1;
  +    public static final int MERGE_START = 1;
   
       /** cell merging: this cell is part of (but not the start of) a range of merged 
cells */
  -    public final static int MERGE_WITH_PREVIOUS = 2;
  +    public static final int MERGE_WITH_PREVIOUS = 2;
   
       /** Create an RTF element as a child of given container */
  -    RtfTableCell(RtfTableRow parent, Writer w,int cellWidth, int idNum) throws 
IOException {
  -        super(parent,w);
  +    RtfTableCell(RtfTableRow parent, Writer w, int cellWidth, int idNum) throws 
IOException {
  +        super(parent, w);
           id = idNum;
           m_parentRow = parent;
           m_cellWidth = cellWidth;
  @@ -108,44 +110,47 @@
       }
   
       /** Create an RTF element as a child of given container */
  -    RtfTableCell(RtfTableRow parent, Writer w,int cellWidth, RtfAttributes attrs, 
int idNum) throws IOException {
  -        super(parent,w,attrs);
  +    RtfTableCell(RtfTableRow parent, Writer w, int cellWidth, RtfAttributes attrs,
  +            int idNum) throws IOException {
  +        super(parent, w, attrs);
           id = idNum;
           m_parentRow = parent;
           m_cellWidth = cellWidth;
   
  -    /** Added by Boris Poudérous on 07/22/2002 in order to process 
number-columns-spanned attribute */
  +    /** Added by Boris Poudérous on 07/22/2002 in order to process
  +     *  number-columns-spanned attribute */
       // If the cell is spanned horizontally
  -    if (attrs.getValue("number-columns-spanned") != null)
  -      {
  +    if (attrs.getValue("number-columns-spanned") != null) {
           // Start horizontal merge
           this.setHMerge(MERGE_START);
   
           // Get the number of columns spanned
           int nbMergedCells = 
((Integer)attrs.getValue("number-columns-spanned")).intValue();
   
  -        if (parent.m_parent instanceof RtfTable)
  -          {
  +        if (parent.m_parent instanceof RtfTable) {
               // Get the context of the current table in order to get the width of 
each column
  -            ITableColumnsInfo ITableColumnsInfo = 
((RtfTable)parent.m_parent).getITableColumnsInfo();
  +            ITableColumnsInfo ITableColumnsInfo =
  +                    ((RtfTable)parent.m_parent).getITableColumnsInfo();
               ITableColumnsInfo.selectFirstColumn();
   
               // Reach the column index in table context corresponding to the current 
column cell
               // id is the index of the current cell (it begins at 1)
               // getColumnIndex() is the index of the current column in table context 
(it begins at 0)
               //  => so we must widthdraw 1 when comparing these two variables.
  -            while ((this.id-1) != ITableColumnsInfo.getColumnIndex())
  +            while ((this.id - 1) != ITableColumnsInfo.getColumnIndex()) {
                  ITableColumnsInfo.selectNextColumn();
  +            }
   
  -            // We widthdraw one cell because the first cell is already created 
(it's the current cell) !
  +            // We widthdraw one cell because the first cell is already created
  +            // (it's the current cell) !
               int i = nbMergedCells - 1;
  -            while (i > 0)
  -              {
  +            while (i > 0) {
                   ITableColumnsInfo.selectNextColumn();
                   // Added by Normand Masse
                   // Pass in the current cell's attributes so the 'merged' cell has 
the
                   // same display attributes.
  -                
parent.newTableCellMergedHorizontally((int)ITableColumnsInfo.getColumnWidth(), attrs);
  +                
parent.newTableCellMergedHorizontally((int)ITableColumnsInfo.getColumnWidth(),
  +                        attrs);
   
                   i--;
                 }
  @@ -159,23 +164,20 @@
           closeAll();
   
           // in tables, RtfParagraph must have the intbl attribute
  -        if(attrs==null) attrs = new RtfAttributes();
  +        if (attrs == null) {
  +            attrs = new RtfAttributes();
  +        }
           attrs.set("intbl");
   
  -        m_paragraph = new RtfParagraph(this,m_writer,attrs);
  +        m_paragraph = new RtfParagraph(this, m_writer, attrs);
   
  -        if(m_paragraph.m_attrib.isSet("qc"))
  -        {
  -            set_center=true;
  +        if (m_paragraph.m_attrib.isSet("qc")) {
  +            set_center = true;
               attrs.set("qc");
  -        }
  -        else if(m_paragraph.m_attrib.isSet("qr"))
  -        {
  -            set_right=true;
  +        } else if (m_paragraph.m_attrib.isSet("qr")) {
  +            set_right = true;
               attrs.set("qr");
  -        }
  -        else
  -        {
  +        } else {
               attrs.set("ql");
           }
           attrs.set("intbl");
  @@ -188,7 +190,7 @@
       /** start a new external graphic after closing current paragraph, list and 
table */
       public RtfExternalGraphic newImage() throws IOException {
           closeAll();
  -        m_externalGraphic = new RtfExternalGraphic(this,m_writer);
  +        m_externalGraphic = new RtfExternalGraphic(this, m_writer);
           return m_externalGraphic;
       }
   
  @@ -200,18 +202,19 @@
       /** start a new list after closing current paragraph, list and table */
       public RtfList newList(RtfAttributes attrib) throws IOException {
           closeAll();
  -        m_list = new RtfList(this,m_writer,attrib);
  +        m_list = new RtfList(this, m_writer, attrib);
           return m_list;
       }
   
       /** start a new nested table after closing current paragraph, list and table */
       public RtfTable newTable(ITableColumnsInfo tc) throws IOException {
           closeAll();
  -        m_table = new RtfTable(this,m_writer,tc);
  +        m_table = new RtfTable(this, m_writer, tc);
           return m_table;
       }
   
  -    /** start a new nested table after closing current paragraph, list and table */ 
 // Modified by Boris Poudérous on 07/22/2002
  +    /** start a new nested table after closing current paragraph, list and table */
  +    // Modified by Boris Poudérous on 07/22/2002
       public RtfTable newTable(RtfAttributes attrs, ITableColumnsInfo tc) throws 
IOException
       {
           closeAll();
  @@ -227,16 +230,16 @@
           m_widthOffset = widthOffset;
   
           // vertical cell merge codes
  -        if(m_vMerge == MERGE_START) {
  +        if (m_vMerge == MERGE_START) {
               writeControlWord("clvmgf");
  -        } else if(m_vMerge == MERGE_WITH_PREVIOUS) {
  +        } else if (m_vMerge == MERGE_WITH_PREVIOUS) {
               writeControlWord("clvmrg");
           }
   
           // horizontal cell merge codes
  -        if(m_hMerge == MERGE_START) {
  +        if (m_hMerge == MERGE_START) {
               writeControlWord("clmgf");
  -        } else if(m_hMerge == MERGE_WITH_PREVIOUS) {
  +        } else if (m_hMerge == MERGE_WITH_PREVIOUS) {
               writeControlWord("clmrg");
           }
   
  @@ -256,22 +259,17 @@
   
           //these lines added by Chris Scott, Westinghouse
           //some attributes need to be writting before opening block
  -        if(set_center)
  -        {
  +        if (set_center) {
               writeControlWord("qc");
  -        }
  -        else if (set_right)
  -        {
  +        } else if (set_right) {
               writeControlWord("qr");
  -        }
  -        else
  -        {
  +        } else {
               writeControlWord("ql");
           }
   
           writeControlWord("cellx" + xPos);
   
  -        writeControlWord( "ql" );
  +        writeControlWord("ql");
   
           return xPos;
   
  @@ -280,25 +278,21 @@
       /** the "cell" control word marks the end of a cell */
       protected void writeRtfSuffix() throws IOException {
           // word97 hangs if cell does not contain at least one "par" control word
  -        // TODO this is what causes the extra spaces in nested table of test 
004-spacing-in-tables.fo,
  +        // TODO this is what causes the extra spaces in nested table of test
  +        //      004-spacing-in-tables.fo,
           // but if is not here we generate invalid RTF for word97
   
  -        if(set_center)
  -        {
  +        if (set_center) {
               writeControlWord("qc");
  -        }
  -        else if (set_right)
  -        {
  +        } else if (set_right) {
               writeControlWord("qr");
  -        }
  -        else
  -        {
  +        } else {
               writeControlWord("ql");
           }
   
   
   
  -        if(!containsText()) {
  +        if (!containsText()) {
               writeControlWord("intbl");
   
               //R.Marra this create useless paragraph
  @@ -312,22 +306,27 @@
   
       //modified by Chris Scott, Westinghouse
       private void closeCurrentParagraph() throws IOException {
  -        if(m_paragraph!=null)
  -        {
  +        if (m_paragraph != null) {
               m_paragraph.close();
           }
       }
   
       private void closeCurrentList() throws IOException {
  -        if(m_list!=null) m_list.close();
  +        if (m_list != null) {
  +            m_list.close();
  +        }
       }
   
       private void closeCurrentTable() throws IOException {
  -        if(m_table!=null) m_table.close();
  +        if (m_table != null) {
  +            m_table.close();
  +        }
       }
   
       private void closeCurrentExternalGraphic() throws IOException {
  -        if(m_externalGraphic!=null) m_externalGraphic.close();
  +        if (m_externalGraphic != null) {
  +            m_externalGraphic.close();
  +        }
       }
   
       private void closeAll()
  @@ -358,19 +357,23 @@
           int extraRowIndex = 0;
           RtfTableCell extraCell = null;
   
  -        for(Iterator it = getChildren().iterator(); it.hasNext(); ) {
  +        for (Iterator it = getChildren().iterator(); it.hasNext();) {
               final RtfElement e = (RtfElement)it.next();
  -            if(e instanceof RtfTable) {
  +            if (e instanceof RtfTable) {
                   // nested table - render its cells in supplementary rows after 
current row,
                   // and put the remaining content of this cell in a new cell after 
nested table
                   // Line added by Boris Poudérous
           
m_parentRow.getExtraRowSet().setParentITableColumnsInfo(((RtfTable)this.getParentOfClass(e.getClass())).getITableColumnsInfo());
  -        extraRowIndex = 
m_parentRow.getExtraRowSet().addTable((RtfTable)e,extraRowIndex,m_widthOffset);
  -                // Boris Poudérous added the passing of the current cell 
attributes to the new cells (in order not to have cell without border for example)
  -        extraCell = 
m_parentRow.getExtraRowSet().createExtraCell(extraRowIndex,m_widthOffset,this.getCellWidth(),
 m_attrib);
  +        extraRowIndex = m_parentRow.getExtraRowSet().addTable((RtfTable)e,
  +                extraRowIndex, m_widthOffset);
  +                // Boris Poudérous added the passing of the current cell
  +                // attributes to the new cells (in order not to have cell without
  +                // border for example)
  +        extraCell = m_parentRow.getExtraRowSet().createExtraCell(extraRowIndex,
  +                m_widthOffset, this.getCellWidth(), m_attrib);
                   extraRowIndex++;
   
  -            } else if(extraCell!=null) {
  +            } else if (extraCell != null) {
                   // we are after a nested table, add elements to the extra cell 
created for them
                   extraCell.addChild(e);
   
  @@ -386,34 +389,31 @@
        *  Use containsText() to find out if there is really some useful content in 
the cell.
        *  TODO: containsText could use the original isEmpty implementation?
        */
  -    public boolean isEmpty()
  -    {
  +    public boolean isEmpty() {
           return false;
       }
   
       /** true if the "par" control word must be written for given RtfParagraph
        *  (which is not the case for the last non-empty paragraph of the cell)
        */
  -    boolean paragraphNeedsPar(RtfParagraph p)
  -    {
  +    boolean paragraphNeedsPar(RtfParagraph p) {
           // true if there is at least one non-empty paragraph after p in our children
           boolean pFound = false;
           boolean result = false;
  -        for(Iterator it = getChildren().iterator(); it.hasNext(); ) {
  +        for (Iterator it = getChildren().iterator(); it.hasNext();) {
               final Object o = it.next();
  -            if(!pFound) {
  +            if (!pFound) {
                   // set pFound when p is found in the list
                   pFound =  (o == p);
               } else {
                   if (o instanceof RtfParagraph) {
                       final RtfParagraph p2 = (RtfParagraph)o;
  -                    if(!p2.isEmpty()) {
  +                    if (!p2.isEmpty()) {
                           // found a non-empty paragraph after p
                           result = true;
                           break;
                       }
  -                }
  -                else if (o instanceof RtfTable) {
  +                } else if (o instanceof RtfTable) {
                       break;
                   }
               }
  
  
  
  1.4       +76 -78    
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java
  
  Index: RtfTableRow.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTableRow.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RtfTableRow.java  29 Jun 2003 22:56:29 -0000      1.3
  +++ RtfTableRow.java  30 Jun 2003 01:31:15 -0000      1.4
  @@ -58,8 +58,9 @@
   
   package org.apache.fop.rtf.rtflib.rtfdoc;
   
  -import java.io.*;
  -import java.util.*;
  +import java.io.IOException;
  +import java.io.Writer;
  +import java.util.Iterator;
   
   /**  Container for RtfTableCell elements
    *  @author Bertrand Delacretaz [EMAIL PROTECTED]
  @@ -71,32 +72,32 @@
       private RtfTableCell m_cell;
       private RtfExtraRowSet m_extraRowSet;
       private int id;
  -    private int highestCell=0;
  +    private int highestCell = 0;
   
   
       /** Create an RTF element as a child of given container */
       RtfTableRow(RtfTable parent, Writer w, int idNum) throws IOException {
  -        super(parent,w);
  +        super(parent, w);
           id = idNum;
       }
   
       /** Create an RTF element as a child of given container */
       RtfTableRow(RtfTable parent, Writer w, RtfAttributes attrs, int idNum) throws 
IOException {
  -        super(parent,w,attrs);
  -        id=idNum;
  +        super(parent, w, attrs);
  +        id = idNum;
       }
   
       /** close current cell if any and start a new one */
       public RtfTableCell newTableCell(int cellWidth) throws IOException {
           highestCell++;
  -        m_cell = new RtfTableCell(this,m_writer,cellWidth,highestCell);
  +        m_cell = new RtfTableCell(this, m_writer, cellWidth, highestCell);
           return m_cell;
       }
   
       /** close current cell if any and start a new one */
       public RtfTableCell newTableCell(int cellWidth, RtfAttributes attrs) throws 
IOException {
           highestCell++;
  -        m_cell = new RtfTableCell(this,m_writer,cellWidth, attrs,highestCell);
  +        m_cell = new RtfTableCell(this, m_writer, cellWidth, attrs, highestCell);
           return m_cell;
       }
   
  @@ -105,7 +106,8 @@
        * in order to add an empty cell that is merged with the cell above.
        * This cell is placed before or after the nested table.
        */
  -    public RtfTableCell newTableCellMergedVertically(int cellWidth, RtfAttributes 
attrs) throws IOException {
  +    public RtfTableCell newTableCellMergedVertically(int cellWidth,
  +           RtfAttributes attrs) throws IOException {
           highestCell++;
           m_cell = new RtfTableCell (this, m_writer, cellWidth, attrs, highestCell);
           m_cell.setVMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
  @@ -116,14 +118,15 @@
        * Added by Boris POUDEROUS on 07/02/2002
        * in order to add an empty cell that is merged with the previous cell.
        */
  -    public RtfTableCell newTableCellMergedHorizontally (int cellWidth, 
RtfAttributes attrs) throws IOException {
  +    public RtfTableCell newTableCellMergedHorizontally (int cellWidth,
  +           RtfAttributes attrs) throws IOException {
           highestCell++;
           // Added by Normand Masse
           // Inherit attributes from base cell for merge
           RtfAttributes wAttributes = (RtfAttributes)attrs.clone();
  -        wAttributes.unset( "number-columns-spanned" );
  +        wAttributes.unset("number-columns-spanned");
   
  -        m_cell = new RtfTableCell(this,m_writer,cellWidth,wAttributes,highestCell);
  +        m_cell = new RtfTableCell(this, m_writer, cellWidth, wAttributes, 
highestCell);
           m_cell.setHMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
           return m_cell;
       }
  @@ -143,7 +146,7 @@
           writeControlWord("trowd");
   
           //check for keep-together
  -        if(m_attrib != null && m_attrib.isSet(ITableAttributes.ROW_KEEP_TOGETHER)) {
  +        if (m_attrib != null && m_attrib.isSet(ITableAttributes.ROW_KEEP_TOGETHER)) 
{
               writeControlWord(ROW_KEEP_TOGETHER);
           }
   
  @@ -151,27 +154,27 @@
   
           // if we have attributes, manipulate border properties
           final RtfTable parentTable = (RtfTable) m_parent;
  -        if(m_attrib != null && parentTable != null) {
  +        if (m_attrib != null && parentTable != null) {
   
               //if table is only one row long
  -            if(isFirstRow() && parentTable.isHighestRow(id)){
  +            if (isFirstRow() && parentTable.isHighestRow(id)) {
                   m_attrib.unset(ITableAttributes.ROW_BORDER_HORIZONTAL);
                   //or if row is the first row
  -            }else if(isFirstRow()){
  +            } else if (isFirstRow()) {
                   m_attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM);
                   //or if row is the last row
  -            }else if(parentTable.isHighestRow(id)){
  +            } else if (parentTable.isHighestRow(id)) {
                   m_attrib.unset(ITableAttributes.ROW_BORDER_TOP);
                   //else the row is an inside row
  -            }else{
  +            } else {
                   m_attrib.unset(ITableAttributes.ROW_BORDER_BOTTOM);
                   m_attrib.unset(ITableAttributes.ROW_BORDER_TOP);
               }
           }
   
  -        writeAttributes(m_attrib,ITableAttributes.ROW_BORDER);
  -        writeAttributes(m_attrib,ITableAttributes.CELL_BORDER);
  -        writeAttributes(m_attrib,BorderAttributesConverter.BORDERS);
  +        writeAttributes(m_attrib, ITableAttributes.ROW_BORDER);
  +        writeAttributes(m_attrib, ITableAttributes.CELL_BORDER);
  +        writeAttributes(m_attrib, BorderAttributesConverter.BORDERS);
   
           /**
            * Added by Boris POUDEROUS on 07/02/2002
  @@ -183,30 +186,24 @@
           int numberOfCellsBeforeNestedTable = 0;
   
           java.util.Vector indexesFound = new java.util.Vector();
  -        for (Iterator it = getChildren().iterator(); it.hasNext(); )
  -          {
  +        for (Iterator it = getChildren().iterator(); it.hasNext();) {
               final RtfElement e = (RtfElement)it.next();
   
  -            if (e instanceof RtfTableCell)
  -              {
  -                if (!nestedTableFound)
  -                  ++numberOfCellsBeforeNestedTable;
  -
  -                for (Iterator it2 = ((RtfTableCell)e).getChildren().iterator(); 
it2.hasNext(); )
  -                   {
  +            if (e instanceof RtfTableCell) {
  +                if (!nestedTableFound) {
  +                    ++numberOfCellsBeforeNestedTable;
  +                }
  +                for (Iterator it2 = ((RtfTableCell)e).getChildren().iterator(); 
it2.hasNext();) {
                         final RtfElement subElement = (RtfElement)it2.next();
  -                      if (subElement instanceof RtfTable)
  -                        {
  +                      if (subElement instanceof RtfTable) {
                             nestedTableFound = true;
                             indexesFound.addElement(new Integer(index));
  -                        }
  -                      else if (subElement instanceof RtfParagraph)
  -                        {
  -                           for (Iterator it3 = 
((RtfParagraph)subElement).getChildren().iterator(); it3.hasNext(); )
  +                        } else if (subElement instanceof RtfParagraph) {
  +                           for (Iterator it3 =
  +                               ((RtfParagraph)subElement).getChildren().iterator(); 
it3.hasNext();)
                                {
                                   final RtfElement subSubElement = 
(RtfElement)it3.next();
  -                                if (subSubElement instanceof RtfTable)
  -                                  {
  +                                if (subSubElement instanceof RtfTable) {
                                       nestedTableFound = true;
                                       indexesFound.addElement(new Integer(index));
                                     }
  @@ -222,34 +219,29 @@
           // write X positions of our cells
           int xPos = 0;
           index = 0;            // Line added by Boris POUDEROUS on 07/02/2002
  -        for(Iterator it = getChildren().iterator(); it.hasNext(); ) {
  +        for (Iterator it = getChildren().iterator(); it.hasNext();) {
               final RtfElement e = (RtfElement)it.next();
  -            if(e instanceof RtfTableCell) {
  +            if (e instanceof RtfTableCell) {
                   /**
                    * Added by Boris POUDEROUS on 2002/07/02
                    */
                   // If one of the row's child cells contains a nested table :
  -                if (!indexesFound.isEmpty())
  -                  {
  -                    for (int i = 0; i < indexesFound.size(); i++)
  -                      {
  +                if (!indexesFound.isEmpty()) {
  +                    for (int i = 0; i < indexesFound.size(); i++) {
                           // If the current cell index is equals to the index of the 
cell that
                           // contains a nested table => NO MERGE
  -                        if (index == ((Integer)indexesFound.get(i)).intValue())
  -                          break;
  +                        if (index == ((Integer)indexesFound.get(i)).intValue()) {
  +                            break;
   
                           // If the current cell index is lower than the index of the 
cell that
                           // contains a nested table => START VERTICAL MERGE
  -                        else if (index < ((Integer)indexesFound.get(i)).intValue())
  -                          {
  +                        } else if (index < 
((Integer)indexesFound.get(i)).intValue()) {
                               ((RtfTableCell)e).setVMerge(RtfTableCell.MERGE_START);
                               break;
  -                          }
   
                           // If the current cell index is greater than the index of 
the cell that
                           // contains a nested table => START VERTICAL MERGE
  -                        else if (index > ((Integer)indexesFound.get(i)).intValue())
  -                          {
  +                        } else if (index > 
((Integer)indexesFound.get(i)).intValue()) {
                               ((RtfTableCell)e).setVMerge(RtfTableCell.MERGE_START);
                               break;
                             }
  @@ -261,31 +253,31 @@
                   // Adjust the cell's display attributes so the table's/row's borders
                   // are drawn properly.
                   RtfTableCell cell = (RtfTableCell)e;
  -                if ( index == 0 ) {
  -                    if ( !cell.getRtfAttributes().isSet( 
ITableAttributes.CELL_BORDER_LEFT ) ) {
  -                        cell.getRtfAttributes().set( 
ITableAttributes.CELL_BORDER_LEFT,
  -                            (String)m_attrib.getValue( 
ITableAttributes.ROW_BORDER_LEFT ));
  +                if (index == 0) {
  +                    if 
(!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_LEFT)) {
  +                        
cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_LEFT,
  +                            
(String)m_attrib.getValue(ITableAttributes.ROW_BORDER_LEFT));
                       }
                   }
   
  -                if ( index == this.getChildCount() -1 ) {
  -                    if ( !cell.getRtfAttributes().isSet( 
ITableAttributes.CELL_BORDER_RIGHT ) ) {
  -                        cell.getRtfAttributes().set( 
ITableAttributes.CELL_BORDER_RIGHT,
  -                            (String)m_attrib.getValue( 
ITableAttributes.ROW_BORDER_RIGHT ));
  +                if (index == this.getChildCount() - 1) {
  +                    if 
(!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_RIGHT)) {
  +                        
cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_RIGHT,
  +                            
(String)m_attrib.getValue(ITableAttributes.ROW_BORDER_RIGHT));
                       }
                   }
   
  -                if ( isFirstRow() ) {
  -                    if ( !cell.getRtfAttributes().isSet( 
ITableAttributes.CELL_BORDER_TOP ) ) {
  -                        cell.getRtfAttributes().set( 
ITableAttributes.CELL_BORDER_TOP,
  -                            (String)m_attrib.getValue( 
ITableAttributes.ROW_BORDER_TOP ));
  +                if (isFirstRow()) {
  +                    if 
(!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_TOP)) {
  +                        
cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_TOP,
  +                            
(String)m_attrib.getValue(ITableAttributes.ROW_BORDER_TOP));
                       }
                   }
   
  -                if ( parentTable.isHighestRow(id) ) {
  -                    if ( !cell.getRtfAttributes().isSet( 
ITableAttributes.CELL_BORDER_BOTTOM ) ) {
  -                        cell.getRtfAttributes().set( 
ITableAttributes.CELL_BORDER_BOTTOM,
  -                            (String)m_attrib.getValue( 
ITableAttributes.ROW_BORDER_BOTTOM ));
  +                if (parentTable.isHighestRow(id)) {
  +                    if 
(!cell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_BOTTOM)) {
  +                        
cell.getRtfAttributes().set(ITableAttributes.CELL_BORDER_BOTTOM,
  +                            
(String)m_attrib.getValue(ITableAttributes.ROW_BORDER_BOTTOM));
                       }
                   }
   
  @@ -314,22 +306,27 @@
       private void writePaddingAttributes()
       throws IOException {
           // Row padding attributes generated in the converter package
  -        // use RTF 1.6 definitions - try to compute a reasonable RTF 1.5 value out 
of them if present
  +        // use RTF 1.6 definitions - try to compute a reasonable RTF 1.5 value
  +        // out of them if present
           // how to do vertical padding with RTF 1.5?
  -        if(m_attrib != null && !m_attrib.isSet(ATTR_RTF_15_TRGAPH)) {
  +        if (m_attrib != null && !m_attrib.isSet(ATTR_RTF_15_TRGAPH)) {
               int gaph = -1;
               try {
                   // set (RTF 1.5) gaph to the average of the (RTF 1.6) left and 
right padding values
                   final Integer leftPadStr = 
(Integer)m_attrib.getValue(ATTR_ROW_PADDING_LEFT);
  -                if(leftPadStr != null) gaph = leftPadStr.intValue();
  +                if (leftPadStr != null) {
  +                    gaph = leftPadStr.intValue();
  +                }
                   final Integer rightPadStr = 
(Integer)m_attrib.getValue(ATTR_ROW_PADDING_RIGHT);
  -                if(rightPadStr != null) gaph = (gaph + rightPadStr.intValue()) / 2;
  -            } catch(Exception e) {
  +                if (rightPadStr != null) {
  +                    gaph = (gaph + rightPadStr.intValue()) / 2;
  +                }
  +            } catch (Exception e) {
                   final String msg = "RtfTableRow.writePaddingAttributes: " + 
e.toString();
   //                getRtfFile().getLog().logWarning(msg);
               }
  -            if(gaph >= 0) {
  -                m_attrib.set(ATTR_RTF_15_TRGAPH,gaph);
  +            if (gaph >= 0) {
  +                m_attrib.set(ATTR_RTF_15_TRGAPH, gaph);
               }
           }
   
  @@ -337,11 +334,12 @@
           writeAttributes(m_attrib, ATTRIB_ROW_PADDING);
       }
   
  -    public boolean isFirstRow(){
  -        if(id == 1)
  +    public boolean isFirstRow() {
  +        if (id == 1) {
               return true;
  -        else
  +        } else {
               return false;
  +        }
       }
   
       public boolean isHighestCell(int id) {
  
  
  
  1.4       +8 -12     
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTemplate.java
  
  Index: RtfTemplate.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfTemplate.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RtfTemplate.java  30 Jun 2003 00:20:07 -0000      1.3
  +++ RtfTemplate.java  30 Jun 2003 01:31:15 -0000      1.4
  @@ -58,10 +58,7 @@
   
   package org.apache.fop.rtf.rtflib.rtfdoc;
   
  -import java.util.*;
  -import java.io.Writer;
   import java.io.IOException;
  -import java.io.File;
   
   /**
    * Singelton of the RTF style template
  @@ -78,8 +75,7 @@
       /**
        * Constructor.
        */
  -    private RtfTemplate ()
  -    {
  +    private RtfTemplate () {
   
       }
   
  @@ -89,8 +85,7 @@
        *
        * @return The instance of RtfTemplate
        */
  -    public static RtfTemplate getInstance ()
  -    {
  +    public static RtfTemplate getInstance () {
           if (instance == null) {
               instance = new RtfTemplate();
           }
  @@ -106,7 +101,7 @@
        **/
       public void setTemplateFilePath(String templateFilePath) throws IOException {
           // no validity checks here - leave this to the RTF client
  -        if(templateFilePath == null) {
  +        if (templateFilePath == null) {
               this.templateFilePath = null;
           } else {
               this.templateFilePath = templateFilePath.trim();
  @@ -118,9 +113,10 @@
        * @param header Rtf header is the parent
        * @throws IOException On write error
        */
  -    public void writeTemplate (RtfHeader header) throws IOException
  -    {
  -        if (templateFilePath == null || templateFilePath.length() == 0) return;
  +    public void writeTemplate (RtfHeader header) throws IOException {
  +        if (templateFilePath == null || templateFilePath.length() == 0) {
  +            return;
  +        }
   
           header.writeGroupMark (true);
           header.writeControlWord ("template");
  
  
  
  1.4       +62 -62    xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfText.java
  
  Index: RtfText.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/RtfText.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RtfText.java      30 Jun 2003 00:20:07 -0000      1.3
  +++ RtfText.java      30 Jun 2003 01:31:15 -0000      1.4
  @@ -65,8 +65,7 @@
    *  @author Bertrand Delacretaz [EMAIL PROTECTED]
    */
   
  -public class RtfText extends RtfElement
  -{
  +public class RtfText extends RtfElement {
           // char code for non-breakable space
           private static final int CHAR_NBSP = 160;
           private static final int CHAR_TAB = 137;
  @@ -85,7 +84,8 @@
       private final RtfAttributes m_attr;
   
   
  -    /** RtfText attributes: attribute names are RTF control word names to avoid 
additional mapping */
  +    /** RtfText attributes: attribute names are RTF control word names to avoid
  +     *  additional mapping */
       public static final String ATTR_BOLD = "b";
       public static final String ATTR_ITALIC = "i";
       public static final String ATTR_UNDERLINE = "ul";
  @@ -145,7 +145,8 @@
       //this line added by Chris Scott, Westinghouse
       public static String[] BORDER = new String []
       {
  -        
BDR_BOTTOM_SINGLE,BDR_BOTTOM_DOUBLE,BDR_BOTTOM_EMBOSS,BDR_BOTTOM_DOTTED,BDR_BOTTOM_DASH
  +        BDR_BOTTOM_SINGLE, BDR_BOTTOM_DOUBLE, BDR_BOTTOM_EMBOSS, BDR_BOTTOM_DOTTED,
  +        BDR_BOTTOM_DASH
       };
   
       public static String[] INDENT = new String []
  @@ -155,8 +156,8 @@
   
       public static String[] TABS = new String []
       {
  -        TAB_CENTER ,TAB_RIGHT,TAB_LEADER_DOTS,TAB_LEADER_HYPHEN,TAB_LEADER_UNDER,
  -        TAB_LEADER_THICK,TAB_LEADER_EQUALS
  +        TAB_CENTER, TAB_RIGHT, TAB_LEADER_DOTS, TAB_LEADER_HYPHEN, TAB_LEADER_UNDER,
  +        TAB_LEADER_THICK, TAB_LEADER_EQUALS
       };
   
   
  @@ -174,40 +175,39 @@
       /** Create an RtfText in given IRtfTextContainer.
        *  @param str optional initial text content
        */
  -    RtfText(IRtfTextContainer parent,Writer w,String str,RtfAttributes attr) throws 
IOException
  -    {
  -        super((RtfContainer)parent,w);
  +    RtfText(IRtfTextContainer parent, Writer w, String str, RtfAttributes attr)
  +           throws IOException {
  +        super((RtfContainer)parent, w);
           m_text = str;
           m_attr = attr;
       }
   
       /** write our text to the RTF stream */
  -    public void writeRtfContent() throws IOException
  -    {
  +    public void writeRtfContent() throws IOException {
               writeChars: {
   
                   //these lines were added by Boris Pouderous
                     if (m_attr != null) {
  -                  writeAttributes(m_attr,new String[] {RtfText.SPACE_BEFORE});
  -                  writeAttributes(m_attr,new String[] {RtfText.SPACE_AFTER});
  +                  writeAttributes(m_attr, new String[] {RtfText.SPACE_BEFORE});
  +                  writeAttributes(m_attr, new String[] {RtfText.SPACE_AFTER});
                   }
   
  -                if(isTab()){
  +                if (isTab()) {
                       writeControlWord("tab");
  -                }else if(isNewLine()){
  +                } else if (isNewLine()) {
                       break writeChars;
  -                }else if(isBold(true)){
  +                } else if (isBold(true)) {
                       writeControlWord("b");
  -                }else if(isBold(false)){
  +                } else if (isBold(false)) {
                       writeControlWord("b0");
  -                }
  -                // TODO not optimal, consecutive RtfText with same attributes could 
be written without group marks
  -                else{
  +                // TODO not optimal, consecutive RtfText with same attributes
  +                // could be written without group marks
  +                } else {
                       writeGroupMark(true);
  -                    if(m_attr != null && mustWriteAttributes()) {
  -                        writeAttributes(m_attr,RtfText.ATTR_NAMES);
  +                    if (m_attr != null && mustWriteAttributes()) {
  +                        writeAttributes(m_attr, RtfText.ATTR_NAMES);
                       }
  -                    
RtfStringConverter.getInstance().writeRtfString(m_writer,m_text);
  +                    RtfStringConverter.getInstance().writeRtfString(m_writer, 
m_text);
                       writeGroupMark(false);
                   }
   
  @@ -215,89 +215,89 @@
       }
   
           /** true if our text attributes must be written */
  -        private boolean mustWriteAttributes()
  -        {
  +        private boolean mustWriteAttributes() {
               return !isEmpty() && !isNbsp();
           }
   
  -    /** IRtfTextContainer requirement: return a copy of our attributes */
  +    /** IRtfTextContainer requirement:
  +     * @return a copy of our attributes */
       public RtfAttributes getTextContainerAttributes() {
  -        if(m_attrib == null) return null;
  +        if (m_attrib == null) {
  +            return null;
  +        }
           return (RtfAttributes)this.m_attrib.clone();
       }
   
       /** direct access to our text */
  -    String getText()
  -    {
  +    String getText() {
           return m_text;
       }
   
       /** direct access to our text */
  -    void setText(String str)
  -    {
  +    void setText(String str) {
           m_text = str;
       }
   
       /**
        * Checks whether the text is empty.
        *
  -     * @return
  -     *  true    If m_text is null\n
  -     *  false   m_text is set
  +     * @return true    If m_text is null\n
  +     *         false   m_text is set
        */
  -    public boolean isEmpty ()
  -    {
  +    public boolean isEmpty () {
           return m_text == null || m_text.trim().length() == 0;
       }
   
       /**
        *  True if text contains a single non-breaking space (#160).
  -         *  TODO make this more general and/or merge with isEmpty? <-- what happen 
with empty paragraphs, if they will be removed, than NO, else ok
  +     *  TODO make this more general and/or merge with isEmpty? <-- what happen
  +     *       with empty paragraphs, if they will be removed, than NO, else ok
        *
  -     * @return
  -     *  true    If m_text is character 160\n
  -     *  false   m_text is not a nbsp
  +     * @return true    If m_text is character 160\n
  +     *         false   m_text is not a nbsp
        */
  -    public boolean isNbsp ()
  -    {
  -        if (! isEmpty ())
  -            if (m_text.trim ().length () == 1 && m_text.charAt (0) == CHAR_NBSP)
  +    public boolean isNbsp () {
  +        if (!isEmpty ()) {
  +            if (m_text.trim ().length () == 1 && m_text.charAt (0) == CHAR_NBSP) {
                   return true;
  +            }
  +        }
           return false;
       }
   
  -    public boolean isTab()
  -    {
  -        if(m_text.trim().length()==1 && m_text.charAt(0)== CHAR_TAB)
  +    public boolean isTab() {
  +        if (m_text.trim().length() == 1 && m_text.charAt(0) == CHAR_TAB) {
               return true;
  -        else
  +        } else {
               return false;
  +        }
       }
   
  -    public boolean isNewLine()
  -    {
  -        if(m_text.trim().length()==1 && m_text.charAt(0)== CHAR_NEW_LINE)
  +    public boolean isNewLine() {
  +        if (m_text.trim().length() == 1 && m_text.charAt(0) == CHAR_NEW_LINE) {
               return true;
  -        else
  +        } else {
               return false;
  +        }
       }
   
  -    public boolean isBold(boolean isStart)
  -    {
  -        if(isStart){
  -            if(m_text.trim().length()==1 && m_text.charAt(0)== CHAR_BOLD_START)
  +    public boolean isBold(boolean isStart) {
  +        if (isStart) {
  +            if (m_text.trim().length() == 1 && m_text.charAt(0) == CHAR_BOLD_START) 
{
                   return true;
  -        }else{
  -            if(m_text.trim().length()==1 && m_text.charAt(0)== CHAR_BOLD_END)
  +            }
  +        } else {
  +            if (m_text.trim().length() == 1 && m_text.charAt(0) == CHAR_BOLD_END) {
                   return true;
  -            else
  +            } else {
                   return false;
  +            }
           }
           return false;
       }
   
  -    /** get the attributes of our text */
  -    public RtfAttributes getTextAttributes(){
  +    /** @return the attributes of our text */
  +    public RtfAttributes getTextAttributes() {
           return m_attr;
       }
   }
  
  
  
  1.3       +18 -15    
xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/WhitespaceCollapser.java
  
  Index: WhitespaceCollapser.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/rtf/rtflib/rtfdoc/WhitespaceCollapser.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WhitespaceCollapser.java  29 Jun 2003 22:56:29 -0000      1.2
  +++ WhitespaceCollapser.java  30 Jun 2003 01:31:16 -0000      1.3
  @@ -66,21 +66,21 @@
    */
   
   class WhitespaceCollapser {
  -    private final static String SPACE = " ";
  -    private boolean m_lastEndSpace = true;
  +    private static final String SPACE = " ";
  +    private boolean lastEndSpace = true;
   
       /** remove extra whitespace in RtfText elements that are inside c */
       WhitespaceCollapser(RtfContainer c) {
           // process all texts
  -        for(Iterator it = c.getChildren().iterator(); it.hasNext(); ) {
  +        for (Iterator it = c.getChildren().iterator(); it.hasNext();) {
               RtfText current = null;
               final Object kid = it.next();
  -            if(kid instanceof RtfText) {
  +            if (kid instanceof RtfText) {
                   current = (RtfText)kid;
                   processText(current);
               } else {
                   // if there is something between two texts, it counts for a space
  -                m_lastEndSpace = true;
  +                lastEndSpace = true;
               }
           }
       }
  @@ -91,35 +91,38 @@
   
           // tokenize the text based on whitespace and regenerate it so as
           // to collapse multiple spaces into one
  -        if(orig != null && orig.length() > 0) {
  +        if (orig != null && orig.length() > 0) {
               final boolean allSpaces = orig.trim().length() == 0;
  -            final boolean endSpace = allSpaces || 
Character.isWhitespace(orig.charAt(orig.length() - 1));
  +            final boolean endSpace = allSpaces
  +                                     || 
Character.isWhitespace(orig.charAt(orig.length() - 1));
               final boolean beginSpace = Character.isWhitespace(orig.charAt(0));
               final StringBuffer sb = new StringBuffer(orig.length());
   
               // if text contains spaces only, keep at most one
  -            if(allSpaces) {
  -                if(!m_lastEndSpace) sb.append(SPACE);
  +            if (allSpaces) {
  +                if (!lastEndSpace) {
  +                    sb.append(SPACE);
  +                }
               } else {
                   // TODO to be compatible with different Locales, should use 
Character.isWhitespace
                   // instead of this limited list
                   boolean first = true;
  -                final StringTokenizer stk = new StringTokenizer(txt.getText()," 
\t\n\r");
  -                while(stk.hasMoreTokens()) {
  -                    if(first && beginSpace && !m_lastEndSpace) {
  +                final StringTokenizer stk = new StringTokenizer(txt.getText(), " 
\t\n\r");
  +                while (stk.hasMoreTokens()) {
  +                    if (first && beginSpace && !lastEndSpace) {
                           sb.append(SPACE);
                       }
                       first = false;
   
                       sb.append(stk.nextToken());
  -                    if(stk.hasMoreTokens() || endSpace) {
  +                    if (stk.hasMoreTokens() || endSpace) {
                           sb.append(SPACE);
                       }
                   }
               }
   
               txt.setText(sb.toString());
  -            m_lastEndSpace = endSpace;
  +            lastEndSpace = endSpace;
           }
       }
   }
  
  
  

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

Reply via email to