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.
Created attachment 21487 [details] svn diff for 9 changed files
Created attachment 21488 [details] tar bz2 of 2 added files
Was a little bit of a faff to apply, as didn't include the fix for bug #44410, but that's probably our fault for not applying your patch quick enough... Committed to svn trunk