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 644496 - Gradient cell backgrounds not imported from XLSX
Gradient cell backgrounds not imported from XLSX
Status: RESOLVED OBSOLETE
Product: Gnumeric
Classification: Applications
Component: import/export MS Excel (tm)
git master
Other Linux
: Normal enhancement
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2011-03-11 13:45 UTC by Jean Bréfort
Modified: 2018-05-22 13:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample file created in localc (6.39 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2011-06-14 16:54 UTC, Andreas J. Guelzow
Details
By Andreas request, top left part of the http://www.autoobserver.com/car-data-center/assets/2011-03%20Sales.xlsx (15.37 KB, image/png)
2011-06-14 19:20 UTC, frob
Details

Description Jean Bréfort 2011-03-11 13:45:48 UTC
In file attached to #643873, the background of some cells has a wrong color. Cell A7 in poth sheets should be black and is white instead. As the font color is (correctly) white, the content is hardly visible.
Comment 1 Andreas J. Guelzow 2011-04-11 02:48:13 UTC
To create a link to the file in question we need to use the right keyword: bug #643873
Comment 2 Andreas J. Guelzow 2011-04-11 02:52:52 UTC
Which file are you talking about? bug #643873 has four attachments: 2 patches, 1 image and 1 xlsx file. The xlsx file has three sheets and A7 is empty
Comment 3 Jean Bréfort 2011-04-11 07:11:49 UTC
A7 is not empty in the xlsx file, just white text on white background. White is correct for the next, not for the background, if you open with localc or xl, you'll see the difference.
Comment 4 Andreas J. Guelzow 2011-04-11 07:49:58 UTC
Jean, I may not be looking at the right file. Perhaps the bug number is wrong? The file I am looking at is Barchart.xlsx
Comment 5 Jean Bréfort 2011-04-11 07:59:33 UTC
It's not that one, sorry, the file is http://www.autoobserver.com/car-data-center/assets/2011-03%20Sales.xlsx
Comment 6 Morten Welinder 2011-04-11 13:24:32 UTC
Excel (2003) claims we should have A7 shown centered across columns A-Q,
black background, white text "Sales by Manufacturer".

Further, the background of A8:Q8 and A29:Q29 should match A9:A28.  Excel has
a darker grey than we do, but that may not mean anything.
Comment 7 Jean Bréfort 2011-04-11 13:41:14 UTC
localc seems to show the same colors than excel.
Comment 8 Andreas J. Guelzow 2011-06-13 21:05:45 UTC
In a smaller example, we are setting the cell style to:
	Color.Back: ff:ff:ff
	Color.Pattern: 0:0:0
	Border.Top: 0
	Border.Bottom: 0
	Border.Left: 0
	Border.Right: 0
	Border.RevDiagonal: 0
	Border.Diagonal: 0
	pattern 0
	Color.Fore: 0:0:0
	name 'Arial'
	not bold
	not italic
	no underline
	no strikethrough
	no super or sub
	size 10.000000
	format 'GENERAL'
	valign 2
	halign 1
	indent 0
	rotation 0
	text dir 0
	wrap text 0
	shrink to fit 0
	locked 0
	hidden 0
	validation (nil)
	hlink (nil)
	input msg (nil)
	conditions (nil)

Is this white writing on black background?
Comment 9 Andreas J. Guelzow 2011-06-13 21:49:49 UTC
Please ignore comment #8 a pasted the wrong style info. It should have been:
	Color.Back: 0:0:0
	Color.Pattern: 0:33:0
	Border.Top: 0
	Border.Bottom: 0
	Border.Left: 0
	Border.Right: 0
	Border.RevDiagonal: 0
	Border.Diagonal: 0
	pattern 1
	Color.Fore: ff:ff:ff
	name 'Arial'
	not bold
	not italic
	no underline
	no strikethrough
	no super or sub
	size 10.000000
	format 'GENERAL'
	valign 2
	halign 1
	indent 0
	rotation 0
	text dir 0
	wrap text 0
	shrink to fit 0
	locked 0
	hidden 0
	validation (nil)
	hlink (nil)
	input msg (nil)
	conditions (nil)
Comment 10 Andreas J. Guelzow 2011-06-14 16:54:37 UTC
Created attachment 189928 [details]
sample file created in localc

In an attempt to fix this I created a smaller sample file (attached) in LOCalc. This file has a single spanned cell A1 with black background and white text.

As in the original file this did not show in Gnumeric. The above style info comes from loading that file. It turns out that the reason that file does not show the background is that all colours in the LOCalc generated file have alpha=0. IF one changes that during loading of the file the background appears just fine.

It appears to me that this is a bug in LOCalc but it would be nice to know how Excel handles this.

This original file for this bug specifies colours with alpha=0xff so the lOCalc aplha issue turns out to be unrelated to the issue at hand.
Comment 11 Andreas J. Guelzow 2011-06-14 17:50:18 UTC
Excel ignores the alpha when reading the solid background colour and the font colour (and possibly at other times). So I have committed a change so that GNumeric also ignores the alpha for solid background colour and font colour. We are now displaying the LibreOffice generated test file like Excel.
Comment 12 frob 2011-06-14 19:20:55 UTC
Created attachment 189935 [details]
By Andreas request, top left part of the http://www.autoobserver.com/car-data-center/assets/2011-03%20Sales.xlsx
Comment 13 Andreas J. Guelzow 2011-06-14 19:25:43 UTC
A7, B8 and others in the file http://www.autoobserver.com/car-data-center/assets/2011-03%20Sales.xlsx are in fact not solid background but gradient fills.

A7: <fill><gradientFill degree="90"><stop position="0"><color rgb="FF555555"/></stop><stop position="1"><color rgb="FF333333"/></stop></gradientFill></fill>

B8: <fill><gradientFill degree="90"><stop position="0"><color rgb="FFF2F2F2"/></stop><stop position="1"><color rgb="FFCCCCCC"/></stop></gradientFill></fill>

And we are currently not importing gradient fills so we end up with white background.
Comment 14 Andreas J. Guelzow 2011-06-14 20:37:16 UTC
We are now using the last dolour specified in teh radient as a solid fill. There is no way of importing the true gradient until we support gradient cell back grounds.
Comment 15 GNOME Infrastructure Team 2018-05-22 13:42:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnumeric/issues/154.