Bug 137362

Summary: XLS Import Wrong Colors
Product: LibreOffice Reporter: SheetJS <dev>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: CLOSED DUPLICATE    
Severity: normal CC: aron.budea, xiscofauli
Priority: medium    
Version: Inherited From OOo   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Cell A1 has the built-in "Bad" style
Comparison MSO 2010 and LibreOffice 7.1 master

Description SheetJS 2020-10-09 07:20:29 UTC
Description:
LibreOffice does not match colors with Excel "Bad" style

Steps to Reproduce:
1. Create an XLS file in Excel where a cell has the "Bad" style (sample attached)
2. Open in LibreOffice

Actual Results:
background color hex FF99CC, text color 800080

Expected Results:
background color hex FFC7CE, text color 9C0006


Reproducible: Always


User Profile Reset: Yes



Additional Info:
XLS files use the XF record [1] to record cell style info.  However, Excel 97-2004 XLS also supports extensions to the cell style, stored in XFExt records [2].  When present and intended to override, the relevant formatting should be pulled from there.

LibreOffice appears to be reading the formatting info from the XF correctly, but it seems to be skipping the XFExt records.

This also affects "Good", "Neutral" and other common styles from the Styles portion of the Home tab in the Ribbon in Excel.


 [1] https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/993d15c4-ec04-43e9-ba36-594dfb336c6d

 [2] https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-xls/8a198485-3609-4bcb-87e7-41894d48b76a
Comment 1 SheetJS 2020-10-09 07:21:08 UTC
Created attachment 166223 [details]
Cell A1 has the built-in "Bad" style
Comment 2 SheetJS 2020-10-09 17:14:59 UTC
This might have been present in OpenOffice as well: https://bz.apache.org/ooo/show_bug.cgi?id=110667

The first test case "colored.original.xls" looks different in Excel and LibreOffice.
Comment 3 Xisco FaulĂ­ 2020-10-12 16:54:58 UTC
Created attachment 166312 [details]
Comparison MSO 2010 and LibreOffice 7.1 master
Comment 4 Xisco FaulĂ­ 2020-10-12 16:56:24 UTC
Reproduced in

Version: 7.1.0.0.alpha0+
Build ID: a9976a958b2857e308c6598532151878615bfd9f
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Version: 5.2.0.0.alpha1+
Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8)

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 5 Joe Cool 2020-10-13 04:07:57 UTC
FYI the python "xlrd" package has this same bug.
Comment 6 Aron Budea 2021-07-13 00:51:04 UTC
Looks like a duplicate of bug 106734.

*** This bug has been marked as a duplicate of bug 106734 ***
Comment 7 picopa88 2021-07-13 04:01:39 UTC Comment hidden (spam)