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 726201 - Conditional format roundtrip problem [ods]
Conditional format roundtrip problem [ods]
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export OOo / OASIS
git master
Other All
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2014-03-12 20:14 UTC by Morten Welinder
Modified: 2014-03-18 07:13 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Morten Welinder 2014-03-12 20:14:11 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.
Comment 1 Andreas J. Guelzow 2014-03-12 20:54:28 UTC
How does
HAlign="GNM_HALIGN_GENERAL"
differ from the attribute HAlign not being given?
Comment 2 Morten Welinder 2014-03-12 23:40:57 UTC
This is inside a conditional format, so it will override whatever the cell's
regular format says.
Comment 3 Andreas J. Guelzow 2014-03-13 03:55:00 UTC
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.
Comment 4 Andreas J. Guelzow 2014-03-13 04:11:02 UTC
The difference shown above has been fixed.

t6515 still shows:


-            <gnm:Condition Operator="16">
-              <gnm:Expression0>&quot;hi&quot;</gnm:Expression0>
+            <gnm:Condition Operator="8">
+              <gnm:Expression0>(not(iserror(find(&quot;hi&quot;,Sheet1!A1))))</gnm:Expression0>
 

-            <gnm:Condition Operator="17">
-              <gnm:Expression0>&quot;hi&quot;</gnm:Expression0>
+            <gnm:Condition Operator="8">
+              <gnm:Expression0>(iserror(find(&quot;hi&quot;,Sheet1!A1)))</gnm:Expression0>
 

-            <gnm:Condition Operator="18">
-              <gnm:Expression0>&quot;Hi&quot;</gnm:Expression0>
+            <gnm:Condition Operator="8">
+              <gnm:Expression0>(iferror(find(&quot;Hi&quot;,Sheet1!A1),2)=1)</gnm:Expression0>
 


-            <gnm:Condition Operator="19">
-              <gnm:Expression0>&quot;Hi&quot;</gnm:Expression0>
+            <gnm:Condition Operator="8">
+              <gnm:Expression0>(not(iferror(find(&quot;Hi&quot;,Sheet1!A1),2)=1))</gnm:Expression0>
Comment 5 Morten Welinder 2014-03-13 13:46:51 UTC
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.
Comment 6 Andreas J. Guelzow 2014-03-14 07:54:09 UTC
hmm, gnm_style_cond_canonicalize does not seem to work here.
Comment 7 Morten Welinder 2014-03-14 14:14:46 UTC
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.
Comment 8 Morten Welinder 2014-03-14 14:30:18 UTC
Actually, it never gets to isself: there is also an extra () around the
expression.
Comment 9 Andreas J. Guelzow 2014-03-14 14:47:01 UTC
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.
Comment 10 Morten Welinder 2014-03-14 17:29:40 UTC
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"/>
Comment 11 Andreas J. Guelzow 2014-03-17 06:23:51 UTC
The 'indent' change should be fixed. We neither correctly wrote nor read the indent for any style.
Comment 12 Andreas J. Guelzow 2014-03-17 15:59:54 UTC
The colour issue has also been fixed, but there are still other outstanding warnings.
Comment 13 Andreas J. Guelzow 2014-03-18 07:13:05 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.