poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 16560] - testBoolErr.xls crashes Excel '97
Date Sat, 09 Aug 2003 02:25:25 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16560>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16560

testBoolErr.xls crashes Excel '97





------- Additional Comments From zalewski@optonline.net  2003-08-09 02:25 -------
This does not work in any version of Excel, unless you run the testcase against 
the head. In that case, the testcase produces a spreadsheet that loads 
properly, but the testcase fails.

The reason is that the testcase calls HSSCell.setErrorValue( (byte) 1), which 
is an invalid argument. The valid arguments are

0   #NULL!
7   #DIV/0!
15  #VALUE!
23  #REF!
29  #NAME?
36  #NUM!
42  #N/A

These are the 7 error types allowed in Excel. There are no others. If you set 
the erro value of a BOOLERR record to any other value, the spreadsheet will not 
load in Excel.

Why these magic numbers? Put the error codewords together in a string and 
seperate each with a \0, like you would if you were programming in C. The magic 
numbers are the offsets to the beginning of each codeword.

#NULL! #DIV/0! #VALUE! #REF! #NAME? #NUM! #N/A
0123456789012345678901234567890123456789012345
0         1         2         3         4

I would work on a patch for this but... the HEAD is very strange right now. The 
performance branch merge seems to have changed *everything*.

My instinct is that BoolErrRecord should throw an exception if the client tries 
to set an unacceptable value. Add public static final int into BoolErrRecord to 
represent the 7 allowed values. Change the testcase that produces 
testBoolErr.xls. And add a new testcase to verify that invalid arguments to 
HSSFCell.setErrorValue throw an exception.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


Mime
View raw message