GNOME Bugzilla – Bug 644496
Gradient cell backgrounds not imported from XLSX
Last modified: 2018-05-22 13:42:06 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.
To create a link to the file in question we need to use the right keyword: bug #643873
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
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.
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
It's not that one, sorry, the file is http://www.autoobserver.com/car-data-center/assets/2011-03%20Sales.xlsx
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.
localc seems to show the same colors than excel.
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?
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)
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.
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.
Created attachment 189935 [details] By Andreas request, top left part of the http://www.autoobserver.com/car-data-center/assets/2011-03%20Sales.xlsx
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.
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.
-- 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.