You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2012/01/25 19:04:55 UTC

DO NOT REPLY [Bug 52527] New: Failed to find a matching shared formula record

https://issues.apache.org/bugzilla/show_bug.cgi?id=52527

             Bug #: 52527
           Summary: Failed to find a matching shared formula record
           Product: POI
           Version: 3.8-dev
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: d.roe@cyprotex.com
    Classification: Unclassified


Created attachment 28209
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28209
Minimal test case

I'm running into an error "Failed to find a matching shared formula record"
when saving a spreadsheet. I've whittled it down to a minimal test case which
I've attached. Simply loading and saving this file causes the error. I had to
remove some sensitive stuff so there are a few formula errors but the file is
still valid.

I had a look at the code in
org.apache.poi.hssf.record.aggregates.SharedValueManager.findFormulaGroupForCell
where the exception is thrown. It mentions 15228.xls which I tried loading and
saving and it worked fine.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 52527] Failed to find a matching shared formula record

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52527

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Yegor Kozlov <ye...@dinom.ru> 2012-02-07 10:47:41 UTC ---
Thanks for the patch. Applied in r1241419, unit test added.

Yegor

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 52527] Failed to find a matching shared formula record

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52527

David Roe <d....@cyprotex.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|                            |All

--- Comment #2 from David Roe <d....@cyprotex.com> 2012-01-30 10:35:29 UTC ---
I've had another look at the source code and findFormulaGroupForCell is called
from two places: linkSharedFormulaRecord and getRecordForFirstCell.
linkSharedFormulaRecord seems to deal only with shared formulas and so I think
the exception is correct in that case. However, getRecordForFirstCell deals
with tables and arrays and it makes sense there for findFormulaGroupForCell to
return null instead of throwing an exception. The code in getRecordForFirstCell
even checks for null (which won't be possible with the current
exception-throwing code).

It seems with the current code, a spreadsheet with a shared formula cannot
contain any arrays or tables.

I have attached a patch that moves the exception into linkSharedFormulaRecord.
I think the TODO comment could also be removed as that file seems to work fine
(as mentioned in my earlier comment).

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 52527] Failed to find a matching shared formula record

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52527

Wu, Fan <zj...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zjuwufan@gmail.com

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 52527] Failed to find a matching shared formula record

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52527

--- Comment #1 from David Roe <d....@cyprotex.com> 2012-01-30 10:35:15 UTC ---
Created attachment 28227
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28227
Move exception from findFormulaGroupForCell to linkSharedFormulaRecord

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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org