Bug 45091

Summary: Custom validation formula is corrupted by POI
Product: POI Reporter: Ralph Corby <rscsea73>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal CC: bernhard.schwager
Priority: P2    
Version: 3.0-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: Sample excel spreadsheet that causes problem

Description Ralph Corby 2008-05-29 01:26:31 UTC
Created attachment 22027 [details]
Sample excel spreadsheet that causes problem

I have created a new workbook using Excel 2000.  I pick a cell, say C3, and apply custom data validation to it using the following formula

=UPPER(C3)="X"

so that users can only enter x into the cell.  I then saved the workbook.

If I then read in the workbook into an HSSFWorkbook and then save it again the formula changes to

=UPPER(A1)="X"

If the formula is changed to

=UPPER($C$3)="X" then the formula is not changed when the workbook is loaded into the HSSFWorkbook object.

I have seen this bug with the latest beta 3 build of poi (poi-3.1-beta3-20080529).
Comment 1 Josh Micich 2008-05-29 09:27:27 UTC
More problems following on from bug 44921.  tRefNV is being re-written as tRefN.
It might be time to correct the class hierarchy of ReferncePtg and RefN~Ptg.
Comment 2 Josh Micich 2008-06-06 18:08:06 UTC
Fixed in svn r664220.

This involved significant restructuring of the Ptg class hierarchy for a few purposes:
  - to stop instantiating superclasses
  - to combine the subclasses that were distinguished by 'operand class' only.  That structure did not make sense in the presence of the Ptg.setClass() method.
  - general clean-up of much dead/duplicated code.
Some previous bugs (bug 44636, bug 44921) have also provided incentive for these changes.
Comment 3 Josh Micich 2008-06-19 09:23:02 UTC
*** Bug 45233 has been marked as a duplicate of this bug. ***