Bug 50607 - Submitting patches for two new function implementations(CLEAN and ADDRESS).
Summary: Submitting patches for two new function implementations(CLEAN and ADDRESS).
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.8-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
: 50384 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-18 03:44 UTC by Aniket
Modified: 2011-01-19 08:51 UTC (History)
0 users



Attachments
Changes related to function implementation of CLEAN and ADDRESS.Newly added files will be in Zip format. (5.60 KB, patch)
2011-01-18 03:44 UTC, Aniket
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.