1. Use system dark mode on Windows 2. Open chart2/qa/extras/xshape/data/xls/tdf150832.xls => the chart is shown on dark background, even though the cell grid background is white 3. Export to PDF => the chart background there is also dark, unlike when using light mode 4. Run the respective unit test: > make CppunitTest_chart2_xshape CPPUNIT_TEST_NAME=Chart2XShapeTest::testTdf150832 => error: > C:/lo/src/core/test/source/diff/diff.cxx(265) : error : Assertion > Test name: Chart2XShapeTest::testTdf150832 > double equality assertion failed > - Expected: nan > - Actual : 202020 > - Delta : 1e-08 > - Reference: C:/lo/src/core/chart2/qa/extras/xshape/data/reference/tdf150832.xml > - Node: /XShapes/XShape[1] > - Attr: fillColor
confirmed. I think this is coming from sc/source/filter/excel/xichart.cxx:509 with aAreaFmt.maPattColor = ... rRoot.GetPalette().GetColor( rFmtInfo.mnAutoPattColorIdx ) ending up with sc/source/filter/excel/xlstyle.cxx:154 and we use the system background color for the chart
https://gerrit.libreoffice.org/c/core/+/142383 if we wanted to just always have the same colors for imported-from-excel charts
Caolán McNamara committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f8ad054de38a6592b60ab850e938e6e81ec4cc0d tdf#151610 chart colors should be the same regardless of the desktop theme It will be available in 7.5.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.
Caolán McNamara committed a patch related to this issue. It has been pushed to "libreoffice-7-4": https://git.libreoffice.org/core/commit/ba9780ab214b725122b211b5a9545ba0f8d5b430 tdf#151610 chart colors should be the same regardless of the desktop theme It will be available in 7.4.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.