poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gl...@apache.org
Subject cvs commit: jakarta-poi/src/java/org/apache/poi/hssf/record UnknownRecord.java
Date Fri, 18 Jul 2003 12:20:18 GMT
glens       2003/07/18 05:20:18

  Modified:    src/java/org/apache/poi/hssf/dev HSSF.java
               src/java/org/apache/poi/hssf/record UnknownRecord.java
  Log:
  Fixed some problems
  
  Revision  Changes    Path
  1.4       +16 -49    jakarta-poi/src/java/org/apache/poi/hssf/dev/HSSF.java
  
  Index: HSSF.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hssf/dev/HSSF.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- HSSF.java	30 Apr 2003 04:39:11 -0000	1.3
  +++ HSSF.java	18 Jul 2003 12:20:18 -0000	1.4
  @@ -55,19 +55,13 @@
   
   package org.apache.poi.hssf.dev;
   
  -import java.io.InputStream;
  -import java.io.IOException;
  -import java.io.ByteArrayInputStream;
  +import org.apache.poi.hssf.usermodel.*;
  +import org.apache.poi.hssf.util.Region;
  +import org.apache.poi.poifs.filesystem.POIFSFileSystem;
  +
   import java.io.FileInputStream;
   import java.io.FileOutputStream;
  -
  -import java.util.Random;
  -
  -import org.apache.poi.poifs.filesystem.POIFSFileSystem;
  -import org.apache.poi.hssf.record.*;
  -import org.apache.poi.hssf.model.*;
  -import org.apache.poi.hssf.usermodel.*;
  -import org.apache.poi.hssf.util.*;
  +import java.io.IOException;
   
   /**
    * File for HSSF testing/examples
  @@ -81,11 +75,9 @@
   
   public class HSSF
   {
  -    private String         filename     = null;
  -
       // private POIFSFileSystem     fs           = null;
  -    private InputStream    stream       = null;
  -    private Record[]       records      = null;
  +//    private InputStream    stream       = null;
  +//    private Record[]       records      = null;
       protected HSSFWorkbook hssfworkbook = null;
   
       /**
  @@ -102,7 +94,6 @@
       public HSSF(String filename)
           throws IOException
       {
  -        this.filename = filename;
           POIFSFileSystem fs =
               new POIFSFileSystem(new FileInputStream(filename));
   
  @@ -140,13 +131,13 @@
   
           f.setFontHeightInPoints(( short ) 12);
           f.setColor(( short ) 0xA);
  -        f.setBoldweight(f.BOLDWEIGHT_BOLD);
  +        f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
           f2.setFontHeightInPoints(( short ) 10);
           f2.setColor(( short ) 0xf);
  -        f2.setBoldweight(f2.BOLDWEIGHT_BOLD);
  +        f2.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
           cs.setFont(f);
           cs.setDataFormat(HSSFDataFormat.getBuiltinFormat("($#,##0_);[Red]($#,##0)"));
  -        cs2.setBorderBottom(cs2.BORDER_THIN);
  +        cs2.setBorderBottom(HSSFCellStyle.BORDER_THIN);
           cs2.setFillPattern(( short ) 1);   // fill w fg
           cs2.setFillForegroundColor(( short ) 0xA);
           cs2.setFont(f2);
  @@ -162,7 +153,7 @@
               // r.setRowNum(( short ) rownum);
               for (short cellnum = ( short ) 0; cellnum < 50; cellnum += 2)
               {
  -                c = r.createCell(cellnum, HSSFCell.CELL_TYPE_NUMERIC);
  +                c = r.createCell(cellnum);
                   c.setCellValue(rownum * 10000 + cellnum
                                  + ((( double ) rownum / 1000)
                                     + (( double ) cellnum / 10000)));
  @@ -170,8 +161,7 @@
                   {
                       c.setCellStyle(cs);
                   }
  -                c = r.createCell(( short ) (cellnum + 1),
  -                                 HSSFCell.CELL_TYPE_STRING);
  +                c = r.createCell(( short ) (cellnum + 1));
                   c.setCellValue("TEST");
                   s.setColumnWidth(( short ) (cellnum + 1),
                                    ( short ) ((50 * 8) / (( double ) 1 / 20)));
  @@ -186,10 +176,11 @@
           rownum++;
           rownum++;
           r = s.createRow(rownum);
  -        cs3.setBorderBottom(cs3.BORDER_THICK);
  +        cs3.setBorderBottom(HSSFCellStyle.BORDER_THICK);
           for (short cellnum = ( short ) 0; cellnum < 50; cellnum++)
           {
  -            c = r.createCell(cellnum, HSSFCell.CELL_TYPE_BLANK);
  +            c = r.createCell(cellnum);
  +//            c = r.createCell(cellnum, HSSFCell.CELL_TYPE_BLANK);
   
               // c.setCellValue(0);
               c.setCellStyle(cs3);
  @@ -211,30 +202,6 @@
       }
   
       /**
  -     * Constructor HSSF - takes in file - attempts to read it then reconstruct it
  -     *
  -     *
  -     * @param infile
  -     * @param outfile
  -     * @param write
  -     *
  -     * @exception IOException
  -     *
  -     */
  -
  -    public HSSF(String infile, String outfile, boolean write)
  -        throws IOException
  -    {
  -        this.filename = filename;
  -        POIFSFileSystem fs =
  -            new POIFSFileSystem(new FileInputStream(filename));
  -
  -        hssfworkbook = new HSSFWorkbook(fs);
  -
  -        // HSSFWorkbook book = hssfstream.getWorkbook();
  -    }
  -
  -    /**
        * Method main
        *
        * Given 1 argument takes that as the filename, inputs it and dumps the
  @@ -326,7 +293,7 @@
                   try
                   {
                       long time = System.currentTimeMillis();
  -                    HSSF hssf = new HSSF(args[ 0 ], true);
  +                    new HSSF(args[ 0 ], true);
   
                       System.out
                           .println("" + (System.currentTimeMillis() - time)
  
  
  
  1.7       +5 -5      jakarta-poi/src/java/org/apache/poi/hssf/record/UnknownRecord.java
  
  Index: UnknownRecord.java
  ===================================================================
  RCS file: /home/cvs/jakarta-poi/src/java/org/apache/poi/hssf/record/UnknownRecord.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- UnknownRecord.java	30 Apr 2003 04:38:48 -0000	1.6
  +++ UnknownRecord.java	18 Jul 2003 12:20:18 -0000	1.7
  @@ -90,9 +90,9 @@
   
       public UnknownRecord(short id, short size, byte [] data)
       {
  -        sid     = id;
  -        size    = size;
  -        thedata = data;
  +        this.sid     = id;
  +        this.size    = size;
  +        this.thedata = data;
       }
   
       /**
  @@ -127,8 +127,8 @@
   
       protected void fillFields(byte [] data, short sid)
       {
  -        sid     = sid;
  -        thedata = data;
  +        this.sid     = sid;
  +        this.thedata = data;
       }
   
       /**
  
  
  

Mime
View raw message