Bug 137362 - XLS Import Wrong Colors
Summary: XLS Import Wrong Colors
Status: CLOSED DUPLICATE of bug 106734
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-09 07:20 UTC by SheetJS
Modified: 2021-07-13 12:57 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Cell A1 has the built-in "Bad" style (25.00 KB, application/x-ole-storage)
2020-10-09 07:21 UTC, SheetJS
Details
Comparison MSO 2010 and LibreOffice 7.1 master (40.36 KB, image/png)
2020-10-12 16:54 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
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)