Bug 166249 - Certain XLSX opened and saved in Calc fails to open in Excel due to wrong color value
Summary: Certain XLSX opened and saved in Calc fails to open in Excel due to wrong col...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
25.2.2.2 release
Hardware: All All
: medium normal
Assignee: Balázs Varga (allotropia)
URL:
Whiteboard: target:25.8.0 target:25.2.4
Keywords: bibisected, bisected, regression
Depends on:
Blocks: OOXML-Chart XLSX-Corrupted
  Show dependency treegraph
 
Reported: 2025-04-19 04:23 UTC by Aron Budea
Modified: 2025-05-02 12:01 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
forum-mso-de-123568.xlsx (83.21 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2025-04-19 04:23 UTC, Aron Budea
Details
forum-mso-de-123568.xlsx (somewhat cut version) (42.33 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2025-04-19 04:25 UTC, Aron Budea
Details
forum-mso-en4-166325.xlsx (268.19 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2025-04-19 16:32 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2025-04-19 04:23:32 UTC
Created attachment 200405 [details]
forum-mso-de-123568.xlsx

Open and save the attached XLSX, forum-mso-de-123568.xlsx in Calc, then try opening it in Excel.

-> Excel complains of a problem, when attempting repair, the error message is like this:
"Removed Part: /xl/drawings/drawing2.xml part.  (Drawing shape)"

The problem is in one of the chart XMLs:
<a:solidFill>
  <a:srgbClr val="7fffffff"/>
</a:solidFill>

"srgbClr" attribute is supposed to be RGB.

This is a regression between 24.2 and 25.2. Bibisecting the issue was a bit difficult, because the bugdoc was also affected by bug 165503, which was only fixed recently. I'm also attaching a somewhat cut down version of the bugdoc, which only exhibited this issue and not bug 165503, this is the one that could be used for bibisecting.
The issue started with the following commit in 25.8 (and in 25.2 by its backport):
https://git.libreoffice.org/core/commit/1916957d0750b5471f23f17b2867a907e0e9e0e2
author		Mohit Marathe <mohit.marathe.extern@allotropia.de>	Wed Feb 19 12:21:19 2025 +0530
committer	Sarper Akdemir <sarper.akdemir@allotropia.de>	Sun Feb 23 16:24:43 2025 +0100

tdf#164936 oox: modify getColor method to include alpha
Comment 1 Aron Budea 2025-04-19 04:25:16 UTC
Created attachment 200406 [details]
forum-mso-de-123568.xlsx (somewhat cut version)
Comment 2 Aron Budea 2025-04-19 16:32:10 UTC
Created attachment 200408 [details]
forum-mso-en4-166325.xlsx

Another sample, here you will find that the color turns negative:
<a:srgbClr val="-40194648"/>
Comment 3 Commit Notification 2025-04-24 12:46:28 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e2035e017e2942fcb46109d02d83cd8990554474

tdf#166249 - ooxml export: fix incorrect color exports in chartexport

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2025-05-02 12:01:59 UTC
Balazs Varga committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/40e67b0f312730f4850e1fdfe532efda92f319c3

tdf#166249 - ooxml export: fix incorrect color exports in chartexport

It will be available in 25.2.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.