DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44371>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44371

           Summary: [patch] Added Excel function OFFSET()
           Product: POI
           Version: 3.0-dev
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Filled out implementation for Offset.java.

Some difficulties were encountered performing this work, because the OFFSET 
function requires access to the workbook/sheet which is not part of the 
evaluate() method signature for all functions implemented so far.  This 
requirement seems to be rare.  A quick browse found one other unimplemented 
function (INDIRECT) with the same problem.

I decided to model this requirement with a dedicated interface 
(FreeRefFunction), which has a similar evaluate method but takes two extra 
parameters.  Some rearranging inside HSSFFormulaEvaluator was necessary to 
invoke FreeRefFunction.evaluate() when needed.  This has left a little 
ugliness in HSSFFormulaEvaluator.invokeOperation().  An alternative approach 
might be to make the OperationEval interface aware of this requirement, but I 
thought the flow on effects might be worse.

A mostly complete implementation of OFFSET() has been added.  The need to 
evaluate area refs on the fly caused some more refactoring within 
HSSFFormulaEvaluator to expose that functionality.

A junit (TestOffset) was added, though this only tests trivial parts of 
Offset.java so far.  More thorough testing can easily be achieved through 
FormulaEvalTestData.xls, but there is a much larger pending change to the same 
file in patch 44364. 

Indirect.java was modified to implement the correct interface.  Javadoc was 
added, but the method is still empty.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to