GNOME Bugzilla – Bug 726201
Conditional format roundtrip problem [ods]
Last modified: 2014-03-18 07:13:05 UTC
New test t6515: - <gnm:Style Shade="1" Back="FFFF:CCCC:0" PatternColor="0:0:0"/> + <gnm:Style HAlign="GNM_HALIGN_GENERAL" Shade="1" Back="FFFF:CCCC:0" PatternColor="0:0:0"> + <gnm:Font StrikeThrough="0">Helvetica</gnm:Font> + </gnm:Style> Other formats in different bug.
How does HAlign="GNM_HALIGN_GENERAL" differ from the attribute HAlign not being given?
This is inside a conditional format, so it will override whatever the cell's regular format says.
I have fixed the alignment part. In the ODF file we now have: <style:style style:name="Gnumeric-1" style:family="table-cell"> <style:table-cell-properties fo:background-color="#ff0000" gnm:background-colour="#ff0000" gnm:pattern-colour="#000000" gnm:pattern="1" style:print-content="true" style:decimal-places="13"/> <style:paragraph-properties/> <style:text-properties/> </style:style> Which looks okay to me. So we are creating the problem when reading.
The difference shown above has been fixed. t6515 still shows: - <gnm:Condition Operator="16"> - <gnm:Expression0>"hi"</gnm:Expression0> + <gnm:Condition Operator="8"> + <gnm:Expression0>(not(iserror(find("hi",Sheet1!A1))))</gnm:Expression0> - <gnm:Condition Operator="17"> - <gnm:Expression0>"hi"</gnm:Expression0> + <gnm:Condition Operator="8"> + <gnm:Expression0>(iserror(find("hi",Sheet1!A1)))</gnm:Expression0> - <gnm:Condition Operator="18"> - <gnm:Expression0>"Hi"</gnm:Expression0> + <gnm:Condition Operator="8"> + <gnm:Expression0>(iferror(find("Hi",Sheet1!A1),2)=1)</gnm:Expression0> - <gnm:Condition Operator="19"> - <gnm:Expression0>"Hi"</gnm:Expression0> + <gnm:Condition Operator="8"> + <gnm:Expression0>(not(iferror(find("Hi",Sheet1!A1),2)=1))</gnm:Expression0>
The new functions... GnmExprTop const *gnm_style_cond_get_alternate_expr (GnmStyleCond const *cond); void gnm_style_cond_canonicalize (GnmStyleCond *cond); ...should make it easy to support the strange Gnumeric operators.
hmm, gnm_style_cond_canonicalize does not seem to work here.
I added a strategic print statement and see... | Trying to canonicalize [(iserror(Sheet1!A1))] | Trying to canonicalize [(not(iserror(Sheet1!A1)))] | Trying to canonicalize [(not(iserror(find(" ",Sheet1!A1))))] | Trying to canonicalize [(iserror(find(" ",Sheet1!A1)))] | Trying to canonicalize [(not(iserror(find("hi",Sheet1!A1))))] | Trying to canonicalize [(iserror(find("hi",Sheet1!A1)))] | Trying to canonicalize [(exact(left(Sheet1!A1,2),"Hi"))] | Trying to canonicalize [(not(exact(left(Sheet1!A1,2),"Hi")))] | Trying to canonicalize [(exact(right(Sheet1!A1,6),"there!"))] | Trying to canonicalize [(not(exact(right(Sheet1!A1,6),"there!")))] Someone the "A1" that was saved has turned into "Sheet1!A1" and the isself function rejects it.
Actually, it never gets to isself: there is also an extra () around the expression.
Thank you Morten! 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.
More tests added - <gnm:Style HAlign="GNM_HALIGN_GENERAL" VAlign="GNM_VALIGN_BOTTOM" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="C0C0:C0C0:C0C0" PatternColor="0:0:0" Format="0.000"> + <gnm:Style HAlign="GNM_HALIGN_GENERAL" VAlign="GNM_VALIGN_BOTTOM" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="0" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="0.000"> - <gnm:Style HAlign="GNM_HALIGN_CENTER" VAlign="GNM_VALIGN_BOTTOM" WrapText="0" ShrinkToFit="0" Rotation="0" Indent="0"/> + <gnm:Style HAlign="GNM_HALIGN_CENTER" VAlign="GNM_VALIGN_BOTTOM" WrapText="0" ShrinkToFit="0" Rotation="0"/>
The 'indent' change should be fixed. We neither correctly wrote nor read the indent for any style.
The colour issue has also been fixed, but there are still other outstanding warnings.
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.