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 726035 - ods roundtrip of alignment "fill" and "distributed"
ods roundtrip of alignment "fill" and "distributed"
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-10 14:22 UTC by Morten Welinder
Modified: 2014-03-12 08:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Morten Welinder 2014-03-10 14:22:51 UTC
With updated t6502:

-          <gnm:Style HAlign="GNM_HALIGN_FILL" VAlign="GNM_VALIGN_BOTTOM" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="1" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="CCCC:FFFF:FFFF" PatternColor="0:0:0" Format="General">
+          <gnm:Style HAlign="GNM_HALIGN_GENERAL" VAlign="GNM_VALIGN_BOTTOM" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="1" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="CCCC:FFFF:FFFF" PatternColor="0:0:0" Format="General">


-          <gnm:Style HAlign="GNM_HALIGN_DISTRIBUTED" VAlign="GNM_VALIGN_BOTTOM" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="1" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="CCCC:FFFF:FFFF" PatternColor="0:0:0" Format="General">
+          <gnm:Style HAlign="GNM_HALIGN_GENERAL" VAlign="GNM_VALIGN_BOTTOM" WrapText="0" ShrinkToFit="0" Rotation="0" Shade="1" Indent="0" Locked="1" Hidden="0" Fore="0:0:0" Back="CCCC:FFFF:FFFF" PatternColor="0:0:0" Format="General">



("Fill" is occasionally useful; I don't even know what "distributed" does.)
Comment 1 Morten Welinder 2014-03-10 15:35:57 UTC
Super- and subscript also fail:

-            <gnm:Font Unit="10" Bold="1" Italic="0" Underline="0" StrikeThrough="0" Script="1">Sans</gnm:Font>
+            <gnm:Font Unit="10" Bold="1" Italic="0" Underline="0" StrikeThrough="0" Script="0">Sans</gnm:Font>


(With identical failure for xlsx; xls passes, somehow.)
Comment 2 Morten Welinder 2014-03-10 16:01:32 UTC
xlsx fixed.
Comment 3 Morten Welinder 2014-03-10 16:02:46 UTC
LO reads our xlsx files and shows super/subscript so ods ought to have a
place to put super/subscript.
Comment 4 Andreas J. Guelzow 2014-03-11 05:35:57 UTC
There seems to be lots of code related to the GNM_HALIGN_FILL on the "write" side, but we write the wrong cell content: rather than the real cell content we write the filled version.
Comment 5 Andreas J. Guelzow 2014-03-11 05:39:48 UTC
We have
<table:table-cell table:style-name="ACE-0x161a9f0" office:value-type="string"><text:p>hh​hh​hh​hh​hh​hh​hh</text:p>          </table:table-cell>
when the cell content should just be 'hh'.
Comment 6 Andreas J. Guelzow 2014-03-11 06:52:31 UTC
Note that in ODF we can store the string values in two ways: as character content of the table:table-cell element or as value of the string-value attribute of the table:table-cell element. The former can carry formatting, the latter cannot. Since the 'filled' values can carry formatting, we need to use the former. Currently we use the formatted value. Clearly that cannot be done in the presence of GNM_HALIGN_FILL.
Comment 7 Morten Welinder 2014-03-11 11:48:26 UTC
The let-LO-read-our-xlsx trick produces this style for B91 which shows
correctly as "TextTextTextText".  The contents is still "Text" in the cell,
though.

I think the magic is this: style:repeat-content="true"


    <style:style style:name="ce63" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N5000">
      <style:table-cell-properties fo:background-color="#ccffff" style:diagonal-bl-tr="none" style:diagonal-tl-br="none" style:text-align-source="fix" style:repeat-content="true" fo:wrap-option="no-wrap" fo:border="none" style:direction="ltr" style:rotation-angle="0" style:rotation-align="none" style:shrink-to-fit="false" style:vertical-align="bottom" style:vertical-justify="auto"/>
      <style:paragraph-properties fo:text-align="start" css3t:text-justify="auto" fo:margin-left="0in" style:writing-mode="page"/>
      <style:text-properties fo:color="#000000" style:text-outline="false" style:text-line-through-style="none" style:font-name="Sans" fo:font-size="10pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" style:font-size-asian="10pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-name-complex="Sans" style:font-size-complex="10pt" style:font-style-complex="normal" style:font-weight-complex="normal"/>
    </style:style>
Comment 8 Andreas J. Guelzow 2014-03-11 14:10:28 UTC
Note that alignment-wise (FILL) it should be a reading problem: LO reads our files fine.
Comment 9 Andreas J. Guelzow 2014-03-11 14:18:37 UTC
I should note that our current xlsx export does not preserve formatting of individual characters in cells, say "axa" with 'x' red and bold.
The interaction between those formats and the 'fill' alignment makes the ODF export a little tricky.
Comment 10 Andreas J. Guelzow 2014-03-11 14:29:33 UTC
LO seems to have a different issue: In the presence of fill-alignment it does not render character formatting. In the files it saves only a single copy of the content as element content. While this seems to contradict what the ODF standard says we should surely do that too.
Comment 11 Andreas J. Guelzow 2014-03-12 05:45:54 UTC
The GNM_HALIGN_FILL round trip should now be fixed.
Comment 12 Andreas J. Guelzow 2014-03-12 05:54:31 UTC
For 'distribute', LO uses:

 <style:paragraph-properties fo:text-align="justify" css3t:text-justify="distribute" fo:margin-left="0cm"/>

with namespace xmlns:css3t="http://www.w3.org/TR/css3-text/"
Comment 13 Andreas J. Guelzow 2014-03-12 06:09:16 UTC
It seems to me that if we want to also use the xmlns:css3t="http://www.w3.org/TR/css3-text/" we need to have it added it to 
gsf-opendoc-utils.[ch] in libgsf and depend on a new version of libgsf.
Comment 14 Andreas J. Guelzow 2014-03-12 07:10:02 UTC
We are now exporting DISTRIBUTED alignment so that LO reads it. We don't import LO's version yet since I don't know about changing libgsf.
Comment 15 Andreas J. Guelzow 2014-03-12 07:58:44 UTC
It appears that super/subscript applied to parts of the cell content works fine. 

Files with super/subscript applied to whole cells don't seem to be interpreted correctly by Gnumeric (or LO), but the cell style contains the specification
style:text-position="super 80%"
So this should be a reading problem.
Comment 16 Andreas J. Guelzow 2014-03-12 08:18:08 UTC
subscript/superscript issue should be fixed.
Comment 17 Andreas J. Guelzow 2014-03-12 08:18:31 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.