> From: Andrew C. Oliver <acoliver@apache.org> > Subject: Re: function table > Sent: 09 Jul 2003 23:08:38 IIRC, those are "reserved" or non-implemented. We haven't yet implemented "macro functions"... Shouldn't be hard to implement I suppose if we just add a lookup for the POIFS filesystem in the event it can't lookup the function to verify its there and just use it...Otherwise we should probably throw an exception. Someone should put this in bugzilla as an [RFE] Macro functions if it isn't already there.
Created attachment 7337 [details] support for NamePtg.toFormulaString (no test cases)
Posted a patch that makes toFormulaString work for macro functions that have internal names. Test cases to follow later - this patch is huge enough already. Issues: 1. signature change AbstractFunctionPtg.toFormulaString(SheetReferences) is now AbstractFunctionPtg.toFormulaString(Workbook). This is an incompatible change. 2. NamePtg's field_3_zero Ugly hack to getSize to get around this. See email on this topic for more information.
Created attachment 7353 [details] src/testcases/org/apache/poi/hssf/data/SquareMacro.xls is a small Excel file that defines and uses the SQUARE macro
Created attachment 7354 [details] test case
Whhy no unit tests? :-( I'm marking half this patch to be applied.. . The half with unit tests ;-)
The unit tests are posted separatly from the patch, but they belong together. The procedure to follow is: 1. Apply unit tests (7354) and excel file (7353). 2. Run unit tests. Watch them fail. 3. Apply the patch (7337). Run the unit tests again. They should work now. 4. Commit. That being said, I have discovered a problem with an interaction betwen macros and nested IFs. Stand by for an updated patch. I would have posted it sooner, but HEAD has been massively broken since July 18. Since it doesn't look the HEAD is going to get fixed anytime soon, these patches will have to be checked most carefully.
Created attachment 7495 [details] revised SquareMacro.xls
you should be doing these against the REL_2_BRANCH...
Created attachment 7498 [details] revised patch (test cases included) against HEAD
Revised patch handles nested macros and IF/macro nesting. Andy is right that this patch needs to be made against 2.0, but my workspace was pointed at HEAD. Now that it is posted. I will follow up with another patch against 2.0 as soon as I reconfigure my workspace. Procedure for this patch: 1. Install 7495 as src/testcases/org/apache/poi/hssf/data/SquareMacro.xls. 2. Patch 7498 against HEAD. 3. Build, Test, and Commit. Avik, please note that this revised patch includes a completely rewritten NamePtg, including an implementation of writeBytes. NameRecord also has a lot of changes, including several new accessors for reading the options field.
I'll put this in after we release 2.0pre3 this week. Dont want to destabilise that atm.
Created attachment 7555 [details] patch against REL_2_BRANCH
I finally finished reconfiguring my workspace, so here is the patch against the release 2 branch. This patch is completely automatic, and all the test cases pass, so it should be safe to apply it as is. Procedure for this patch: 1. Install 7495 as src/testcases/org/apache/poi/hssf/data/SquareMacro.xls. 2. Patch 7555 against REL_2_BRANCH. 3. Build, Test, and Commit.
I think this is great.. however, since this is a very large patch, will apply them after sleeping over it for a day. I think this solves a lot of our issues.. so thanks.
Checked in to REL_2_BRANCH and HEAD. Thanks a lot Paul. Please cross check. Maybe we should have a few more testcases for the toFormulaString implementations for named ranges and 3DAreas.