After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 636968 - Error on reading formula referring to cell in line 65537 (ODS format)
Error on reading formula referring to cell in line 65537 (ODS format)
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export OOo / OASIS
1.10.x
Other All
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-12-10 14:57 UTC by Pedro Lino
Modified: 2010-12-12 10:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ODF spreadsheet with function referring to line 65537 (8.68 KB, application/vnd.oasis.opendocument.spreadsheet)
2010-12-10 14:57 UTC, Pedro Lino
Details

Description Pedro Lino 2010-12-10 14:57:53 UTC
Created attachment 176181 [details]
ODF spreadsheet with function referring to line 65537

Opening an ODS spreadsheet that contains a formula referring to line 65537 (one more than the traditional limit of 2^16 lines) pops the following error message:
Sheet1!A2
Unable to parse 'SUM([.B3:.B65537])' ('Invalid expression')

and the formula is converted to a value.

This does not occur for .gnumeric files.
Comment 1 Andreas J. Guelzow 2010-12-10 17:44:03 UTC
The problem is that when we are parsing the formula in A2 we don't know the size of the spreadsheet. (ODF in its wisdom does not store the spreadsheet size so when we encounter SUM([.B3:.B65537]) it is larger than the current size.)
If you put the same expression in A65538 then we have already enlarged the sheet and everything works.
Comment 2 Pedro Lino 2010-12-10 19:03:03 UTC
Yes, that makes sense. Then this is a BUG for ODF and not for Gnumeric, I guess...
Comment 3 Andreas J. Guelzow 2010-12-10 19:17:16 UTC
Pedro, this is still a bug in Gnumeric; it will just be tricky to fix. (The simple fix would be to read the file twice, but that would be really annoying.)
Comment 4 Jean Bréfort 2010-12-11 08:35:42 UTC
Another way would be to create sheets as large as what OOo supports, load the file, and then reduce the size according to the actual row and column numbers.
Comment 5 Pedro Lino 2010-12-11 10:28:02 UTC
I think it would make more sense to fix this first in the document format so that it benefits all ODF users.
Once the ODF file states the spreadsheet size it's just a matter of adding a check...

Doesn't it make sense for the Gnumeric project to join this (if you haven't already)?
http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office
Comment 6 Andreas J. Guelzow 2010-12-12 04:11:37 UTC
Jean, OOo is only one of several implementations creating ODS files so we would need to use Gnumeric's maximum sheet size and it would be very time consuming to determine the shrinked size afterwards.

Pedro,
changing anything in the ODF file format is a multi-year project. In any case this has been discussed in the OASIS ODF TC and it was declined. The minimum needed size can be inferred from the file content. One just needs to keep track of the references in the formulas... 

Regarding the Gnumeric Project joining the OASIS ODF TC: Membership in the TC requires paid up membership in OASIS which for an Organisation is quite expensive. So you are unlikely to ever see official Gnumeric representation on that TC. 

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 7 Pedro Lino 2010-12-12 10:18:27 UTC
Thank you for the fast and detailed answer (and obviously for fixing the bug)

In my opinion that decision from the TC just shoves the problem to the programmers corner and makes ODS less efficient. I can't see how a simple line (or two) in a XML file could be a disadvantage...

BTW I never imagined that joining a board for an open standard would require members to pay more than a symbolic value. I guess I'm too naive :(

Thank you again!