Bug 44449 - [patch] Incorrect SharedFormulaRecord chosen when 'shared record' flag abnormally set.
Summary: [patch] Incorrect SharedFormulaRecord chosen when 'shared record' flag abnorm...
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.0-dev
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-18 21:31 UTC by Josh Micich
Modified: 2008-02-21 07:48 UTC (History)
0 users



Attachments
svn diff of added junit test case and bug fix to ValueRecordsAggregate (10.59 KB, patch)
2008-02-18 21:39 UTC, Josh Micich
Details | Diff
tar bz2 of one added test spreadsheet file (4.34 KB, patch)
2008-02-18 21:40 UTC, Josh Micich
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Micich 2008-02-18 21:31:45 UTC
Excel sometimes saves FormulaRecords with the 'shared record' flag set, but 
with no corresponding SharedFormulaRecord.  The correct operation is to leave 
the FormulaRecord as-is.  POI was making a mistake of using 
SharedFormulaRecords that happen to match the row and column ranges, but come 
from subsequent sheets. (Excel does not define shared formulas across sheets).

The bug results in some cells apparently having formulas from the 
corresponding cell on another sheet. (!)

The solution was to make ValueRecordsAggregate.construct() only consider 
SharedFormulaRecords for the current sheet.
Comment 1 Josh Micich 2008-02-18 21:39:31 UTC
Created attachment 21554 [details]
svn diff of added junit test case and bug fix to ValueRecordsAggregate
Comment 2 Josh Micich 2008-02-18 21:40:06 UTC
Created attachment 21555 [details]
tar bz2 of one added test spreadsheet file
Comment 3 Nick Burch 2008-02-21 07:48:56 UTC
Thanks for this patch, applied to svn trunk