This looks like a bug. Its trying to shove uncompressed unicode into a
compressed unicode font name. We need to fix this.
On Wed, 2002-01-30 at 15:31, Thutika, Swamy wrote:
> Hi,
> I get array out of bound exception in reading some xls files. I have
> attached problematic xls file and the
> err text file. Could please someone explain what is the problem??
> <<err>> <<simpletmpl.xls>>
>
> Verison 1.2.0
>
>
> The code snippet is:
>
> ****************************************************************************
> *****************************************
> public static void main(String[] args) throws IOException {
>
> FileOutputStream out = new FileOutputStream("myout.xls");
> POIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(args[0]));
> HSSFWorkbook wb = new HSSFWorkbook(fs); // create a workbook
> reference
> HSSFSheet s = wb.getSheetAt(0); // create a new sheet
> HSSFRow r = s.getRow(0); // get the first row object
> reference
> HSSFCell c = r.getCell((short)1); // get the first cell
> object reference
> HSSFCellStyle cs = c.getCellStyle(); // get the cell style
> //HSSFFont f = wb.createFont();
>
> short csIndex = cs.getIndex();
> System.out.println("Font idx is " + csIndex);
> //HSSFFont f = wb.getFontAt(csIndex);
> //System.out.println(f.getFontHeightInPoints());
> System.out.println(c.getStringCellValue());
> c.setCellValue("Changed");
> System.out.println(cs.getFillForegroundColor());
> System.out.println("NUmber of fonts " + wb.getNumberOfFonts());
>
> wb.write(out);
>
>
> ****************************************************************************
> ***************************************************
>
> thanks in advance
> Swamy
--
www.superlinksoftware.com
www.sourceforge.net/projects/poi - port of Excel format to java
http://developer.java.sun.com/developer/bugParade/bugs/4487555.html
- fix java generics!
The avalanche has already started. It is too late for the pebbles to
vote.
-Ambassador Kosh