CVS: jfor/src/org/jfor/jfor/converter TableContext.java,1.2,1.3

Bertrand Delacretaz <[email protected]> Tue, 02 Jul 2002 09:03:22 -0700
Newsgroups gmane.text.xml.jfor.cvs
Message-ID <[email protected]>
Update of /cvsroot/jfor/jfor/src/org/jfor/jfor/converter
In directory usw-pr-cvs1:/tmp/cvs-serv19691/src/org/jfor/jfor/converter

Modified Files:
	TableContext.java 
Log Message:
patch from Trembicki-Guy, Ed <[email protected]> to handle undefined table column widths

Index: TableContext.java
===================================================================
RCS file: /cvsroot/jfor/jfor/src/org/jfor/jfor/converter/TableContext.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** TableContext.java	31 Aug 2001 07:51:01 -0000	1.2
--- TableContext.java	2 Jul 2002 16:03:19 -0000	1.3
***************
*** 35,38 ****
--- 35,41 ----
  // $Id$
  // $Log$
+ // Revision 1.3  2002/07/02 16:03:19  bdelacretaz
+ // patch from Trembicki-Guy, Ed <[email protected]> to handle undefined table column widths
+ //
  // Revision 1.2  2001/08/31 07:51:01  bdelacretaz
  // MPL license text added + javadoc class comments corrected
***************
*** 51,54 ****
--- 54,58 ----
      private final ArrayList m_colWidths = new ArrayList();
      private int m_colIndex;
+     public static final float INVALID_COLUM_WIDTH = 200f;
      
      TableContext(BuilderContext ctx)
***************
*** 75,82 ****
      }
      
!     /** get current column width according to column iteration index */
      float getColumnWidth()
      {
!         return ((Float)m_colWidths.get(m_colIndex)).floatValue();
      }
! }
\ No newline at end of file
--- 79,94 ----
      }
      
!     /** get current column width according to column iteration index
!      *  @return INVALID_COLUMN_WIDTH if we cannot find the value
!      */
      float getColumnWidth()
      {
!         try {
!             return ((Float)m_colWidths.get(m_colIndex)).floatValue();
! 	} catch (IndexOutOfBoundsException ex) {
!             // this code contributed by Trembicki-Guy, Ed <[email protected]>
!             m_context.log.logWarning("fo:table-column width not defined,using " + INVALID_COLUM_WIDTH);
!             return INVALID_COLUM_WIDTH;
!         }
      }
! }



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf