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 676289 - failure to correctly round trip a conditional formatting condition
failure to correctly round trip a conditional formatting condition
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export OOo / OASIS
git master
Other Linux
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2012-05-18 03:42 UTC by Andreas J. Guelzow
Modified: 2012-05-21 06:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas J. Guelzow 2012-05-18 03:42:09 UTC
It seems that that conditional formatting with a "if this cell contains an error" condition is not persisted through an odf cycle.
Comment 1 Andreas J. Guelzow 2012-05-18 05:46:07 UTC
We are currently not writing this condition, since ODF 1.2 has no matching condition.
Comment 2 Andreas J. Guelzow 2012-05-18 05:57:44 UTC
There seems to be  no reasonable way of encoding this condition within the framework natively available in ODF. We have 
of:is-true-formula(iserror([.A1]))
but this would require a differnet expression for each single cell the condition is effectively used for.

On the other hand we can write an appropriate namespaced expression:
gnm:is-true-formula(iserror).
Comment 3 Andreas J. Guelzow 2012-05-18 06:39:12 UTC
I was mistaken. Using an appropriate style:base-cell-address and relative references, this can be correctly written!
Comment 4 Andreas J. Guelzow 2012-05-19 02:25:38 UTC
We are now correctly exporting this but we have trouble on import:

Unable to parse '(ISERROR([.A1]))' ('Sheet name is required')
Unknown condition 'of:is-true-formula(ISERROR([.A1]))' encountered, ignoring.
Unable to parse '(ISERROR([.A1]))' ('Sheet name is required')
Unknown condition 'of:is-true-formula(ISERROR([.A1]))' encountered, ignoring.

plus many warnings/criticals:

** (gnumeric:1486): WARNING **: NULL sheet in gnm_sheet_get_size!

** (gnumeric:1486): CRITICAL **: workbook_sheet_by_index: assertion `i < (int)wb->sheets->len' failed

** (gnumeric:1486): WARNING **: NULL sheet in gnm_sheet_get_size!

** (gnumeric:1486): WARNING **: NULL sheet in gnm_sheet_get_size!

** (gnumeric:1486): WARNING **: NULL sheet in gnm_sheet_get_size!

** (gnumeric:1486): CRITICAL **: workbook_sheet_reorder: assertion `g_slist_length (new_order) == wb->sheets->len' failed



The main problem is that at the time we are reading and constructing these conditional styles we do not have any sheets yet but need to parse expresssions. We basically ought to store this information at this time only and perform the parsing when we want to apply them to a cell, not before!
Comment 5 Andreas J. Guelzow 2012-05-20 17:55:39 UTC
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 6 Morten Welinder 2012-05-21 01:29:10 UTC
We have expressions in validation too.  Do the changes handle that too?
Comment 7 Andreas J. Guelzow 2012-05-21 06:26:34 UTC
For the validations we always postponed parsing until we needed them while the cells were read. My changes essentially implement the same for conditional styles as we were already using for validation.