Bug 29976

Summary: [PATCH] HSSF hyperlink formula size problem
Product: POI Reporter: Bernard Chesnoy <bernard.chesnoy>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 2.5-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: contains the patch and the test case, format (tar and bz2)
tar and bz2 compression

Description Bernard Chesnoy 2004-07-08 14:41:22 UTC
If you give an hyperlink with a size between 127 and 255 length, with the 
sources I got an ArrayOutOfBoundException, and with the binary distribution 
everything goes good until you try to read the .xls, excel can't do it
(unreadable file...).

It seems, that the length is keep in a Byte, so when it is cast in an int it 
gives a negative length. 
Class modified : org.apache.poi.hssf.record.formula.StringPtg
file added : HyperlinkFormula.java a test case
I correct this using an int for the length and a mask to remove all unneeded 
bits.
As I'm a newbie tell me if I do something wrong.
Comment 1 Bernard Chesnoy 2004-07-08 14:42:46 UTC
Created attachment 12062 [details]
contains the patch and the test case, format (tar and bz2)
Comment 2 Avik Sengupta 2004-07-08 16:08:41 UTC
thanks in particular for the testcase. I'll check it out. 
Comment 3 Glen Stampoultzis 2004-08-04 01:16:36 UTC
bernard: I'm having trouble untaring your patch.  I'm getting the following errors:

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
tar: Error exit delayed from previous errors
Comment 4 Bernard Chesnoy 2004-08-04 09:10:42 UTC
Created attachment 12322 [details]
tar and bz2 compression
Comment 5 Bernard Chesnoy 2004-08-04 09:12:36 UTC
The new archive seems to be good, sorry for the inconvenience, I don't what I 
messed up with this file.
Comment 6 Glen Stampoultzis 2004-08-26 03:20:23 UTC
Committed to HEAD