Bug 44762

Summary: XSSF FormulaEvaluator does not handle 3D refs or Name tokens
Product: POI Reporter: Josh Micich <josh>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: blocker    
Priority: P4    
Version: 3.0-dev   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X 10.3   

Description Josh Micich 2008-04-06 13:49:43 UTC
In HSSF, the formula evaluator passes around a hsss.model.Workbook for 2 purposes:
 - resolving cross-sheet references (Ref3dPtg and Area3dPtg)
 - resolving named ranges and non-built-in functions (NamePtg and NameXPtg)

A common interface could be introduced to represent this functionality.  In HSSF, the concrete class hssf.model.Workbook could implement this interface.  In XSSF, perhaps an adapter wrapping XSSFWorkbook could be written.  Maybe an adapter in both places.
Comment 1 Nick Burch 2008-04-07 03:34:59 UTC
I have a feeling that HSSFWorkbook / XSSFWorkbook (and hence ss.usermodel.Workbook) will already do the named range stuff for us, so that ought to be an easy change

Is the sheet lookup actually the "get sheet from external sheet number/ref" stuff? If so, I think we could probably put that onto ss.usermodel.Workbook, and have HSSFWorkbook delegate that onto the model.Workbook

I'll have a go at tweaking shortly
Comment 2 Nick Burch 2008-04-16 03:40:53 UTC
I've updated trunk to use hssf.usermodel.HSSFWorkbook, and then applied the same thing to the branch, switched to ss.usermodel.Workbook

All the tests now pass, but there is one rather icky method I've had to put onto ss.usermodel.Workbook:
  public String resolveNameXText(int refIndex, int definedNameIndex)

We'll want to replace that with something better, once someone can figure out what it does!