Bug 50607

Summary: Submitting patches for two new function implementations(CLEAN and ADDRESS).
Product: POI Reporter: Aniket <contact.aniket>
Component: POI OverallAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.8-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Changes related to function implementation of CLEAN and ADDRESS.Newly added files will be in Zip format.

Description Aniket 2011-01-18 03:44:39 UTC
Created attachment 26503 [details]
Changes related to function implementation of CLEAN and ADDRESS.Newly added files will be in Zip format.

Submitting patches for two new function implementations(CLEAN and ADDRESS).
Comment 1 Aniket 2011-01-19 00:35:55 UTC
I have introduced two new excel function that were not implemented yet in POI. The functions are CLEAN and ADDRESS. I have submitted a Zip file that contains all the new files as well as the changed files. Kindly do the review so that I can check-in the files.

Thanks,
Aniket
Comment 2 Yegor Kozlov 2011-01-19 07:31:16 UTC
Applied in r1060788 with some tweaks.

Your implementation of the CLEAN function was not quite correct. According to the Excel docs, the CLEAN function removes the first 32 nonprinting characters in the 7-bit ASCII code (values 0 through 31). All other characters are not affected. This means that CLEAN does not remove any unicode characters above ASCII, including nonprinting unicode characters (values 127, 129, 141, 143, 144, and 157). I changed your code to follow Excel's rules. 

The ADDRESS function is actually a wrapper around  org.apache.poi.ss.util.CellReference. This is a fundamental class in POI and should be cell reference operations. 

Your implementation has a bug and throws IndexOutOfBoundsException for columns greater than 702, i.e. Address.getColName(702) works and Address.getColName(703) fails. I removed this method and used CellReference#formatAsString instead.

Other than that, very good. Thanks for the good patch!

Regards,
Yegor
Comment 3 Yegor Kozlov 2011-01-19 07:32:08 UTC
*** Bug 50384 has been marked as a duplicate of this bug. ***
Comment 4 Aniket 2011-01-19 08:51:36 UTC
(In reply to comment #3)
> *** Bug 50384 has been marked as a duplicate of this bug. ***

Thanks Yegor.