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 760043 - [ods] t6512 fails with new time format tests
[ods] t6512 fails with new time format tests
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: 2016-01-01 01:59 UTC by Morten Welinder
Modified: 2016-01-03 06:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Morten Welinder 2016-01-01 01:59:12 UTC
I added tests for some time formats and ods shows differences.

Some of the differences are just that we grow quotes around colons.
That's not wrong per se, just not canonical.  Note, that some strings
do need quotes.

I also added a test for single character am/pm marker.  I can get rid
of that if ods doesn't have an equivalent.




t6512-format.pl: Check format ods roundtrip.
--- format-tests.xml	2015-12-31 20:51:52.367988881 -0500
+++ format-tests-new.xml	2015-12-31 20:51:52.371988881 -0500
@@ -298,22 +298,17 @@
           </gnm:Style>
         </gnm:StyleRegion>
         <gnm:StyleRegion startCol="1" startRow="33" endCol="1" endRow="33">
-          <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="hh:mm:ss">
+          <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="hh&quot;:&quot;mm&quot;:&quot;ss">
             <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
           </gnm:Style>
         </gnm:StyleRegion>
         <gnm:StyleRegion startCol="1" startRow="34" endCol="1" endRow="34">
-          <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="h:mm:ss">
+          <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="h&quot;:&quot;mm&quot;:&quot;ss">
             <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
           </gnm:Style>
         </gnm:StyleRegion>
-        <gnm:StyleRegion startCol="1" startRow="35" endCol="1" endRow="35">
-          <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="h:mm AM/PM">
-            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
-          </gnm:Style>
-        </gnm:StyleRegion>
-        <gnm:StyleRegion startCol="1" startRow="36" endCol="1" endRow="36">
-          <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="h:mm a/p">
+        <gnm:StyleRegion startCol="1" startRow="35" endCol="1" endRow="36">
+          <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="h&quot;:&quot;mm AM/PM">
             <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
           </gnm:Style>
         </gnm:StyleRegion>
Comment 1 Morten Welinder 2016-01-01 15:14:21 UTC
I fixed the quoting issue.

That leaves the a/p issue.  Can ods handle that?


t6512-format.pl: Check format ods roundtrip.
--- format-tests.xml	2016-01-01 10:12:49.148336582 -0500
+++ format-tests-new.xml	2016-01-01 10:12:49.152336582 -0500
@@ -307,16 +307,11 @@
             <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
           </gnm:Style>
         </gnm:StyleRegion>
-        <gnm:StyleRegion startCol="1" startRow="35" endCol="1" endRow="35">
+        <gnm:StyleRegion startCol="1" startRow="35" endCol="1" endRow="36">
           <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="h:mm AM/PM">
             <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
           </gnm:Style>
         </gnm:StyleRegion>
-        <gnm:StyleRegion startCol="1" startRow="36" endCol="1" endRow="36">
-          <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="h:mm a/p">
-            <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
-          </gnm:Style>
-        </gnm:StyleRegion>
         <gnm:StyleRegion startCol="1" startRow="37" endCol="1" endRow="40">
           <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="m/d/yy">
             <gnm:Font Unit="10" Bold="0" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>
Comment 2 Andreas J. Guelzow 2016-01-01 23:36:29 UTC
The ODF standard at this time does not allow distinction between am/pm and a/p: "The <number:am-pm> element specifies whether AM/PM is included as part of a date or time. If a <number:am-pm> element is contained in a date or time style, hours are displayed using values from 1 to 12 only. The <number:am-pm> element has no attributes. The <number:am-pm> element has no child elements."

LO 3.10.3 understands the a/p notation but when saving to an ODF file and opening again this becomes AM/PM.

So this is a prime candidate for introducing a new foreign element and proposing it to the ODF TC for inclusion into a future version of ODF.

I will do so.
Comment 3 Andreas J. Guelzow 2016-01-02 00:17:37 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.

Note that the writing portion of this fix is in goffice.
Comment 4 Morten Welinder 2016-01-02 00:37:32 UTC
So currently ods will also mess with cases?

am/pm, AM/PM, a/p, A/P
Comment 5 Morten Welinder 2016-01-02 00:47:07 UTC
I updated the ods schema with the new attribute.
Comment 6 Morten Welinder 2016-01-02 01:02:26 UTC
We seem to treat am/pm the same as AM/PM.  I'll have to double-check
with Excel.

But we deliberately treat a/p differently from A/P.  And for kicks there
is also a/P and A/p which we can probably ignore here.
Comment 7 Andreas J. Guelzow 2016-01-02 02:04:26 UTC
I should have seen this before I tried to update the ods schema patch rather than just failing on the push.

ODF has only one marker for am/pm and so it is always AM/PM (full length and capital).

LO seems to only understand: AM/PM (if you enter am/pm it becomes AM/PM) and a/p (it is always shown in the format code as A/P)

In Excel 2013 the AM and PM appears to be always rendered as capitals while the a/p matches the capitalization in the format string. So therr are effectively 5 different possibilities:
am/pm in any of the 16 capitalizations yields AM/PM
a/p yields a/p
A/p yields A/p
a/P yields a/P and
A/P yields A/P

In goffice I see the 2 tokens TOK_AMPM5 and TOK_AMPM3. I gather for the TOK_AMPM3 the exact token string is checked for rendering.
Comment 8 Andreas J. Guelzow 2016-01-02 02:55:30 UTC
The ODF import/export should now handle all of these possibilities.
Comment 9 Morten Welinder 2016-01-03 00:18:08 UTC
Did you forget to commit something?  I don't see the write side.
Comment 10 Andreas J. Guelzow 2016-01-03 06:04:17 UTC
The "write" side is in goffice.