GNOME Bugzilla – Bug 676289
failure to correctly round trip a conditional formatting condition
Last modified: 2012-05-21 06:26:34 UTC
It seems that that conditional formatting with a "if this cell contains an error" condition is not persisted through an odf cycle.
We are currently not writing this condition, since ODF 1.2 has no matching condition.
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).
I was mistaken. Using an appropriate style:base-cell-address and relative references, this can be correctly written!
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!
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.
We have expressions in validation too. Do the changes handle that too?
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.