Bug 151882 - Theme color does not work for docx -> odt ->docx
Summary: Theme color does not work for docx -> odt ->docx
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: OOXML-Doc-Themes
  Show dependency treegraph
 
Reported: 2022-11-03 23:13 UTC by Regina Henschel
Modified: 2023-06-19 11:55 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
SmartArt 'Venn diagram' with theme colors (24.35 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-11-03 23:13 UTC, Regina Henschel
Details
File with shapes with theme color (17.14 KB, application/vnd.oasis.opendocument.text)
2023-02-16 22:17 UTC, Regina Henschel
Details
Screenshot comparing left Writer with right Word (61.05 KB, image/png)
2023-02-16 22:18 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2022-11-03 23:13:01 UTC
Created attachment 183398 [details]
SmartArt 'Venn diagram' with theme colors

The commits 0c13e476 and 1868dea8 have introduced theme colors (Miklos Vajna). But using them produces a regression in Writer.

Make sure option "SmartArt to LibreOffice shapes or reverse" is enabled in 'Microsoft Office' in 'Load/Save' in Tools>Options.

Open attached docx file. It contains a SmartArt shape.
Save it to ODF 1.3extended.
Reopen the saved file. You have no longer a SmartArt but a group. That is OK. The colors are OK.
Save that file to docx format.
Open the saved docx file in Word. The colors are missing. Instead a single blue is used.

Problem is, that the shapes get a reference to the theme in their fill attribute, but the folder 'Theme' is missing.

That is a regression compared to LO 7.3, which has no support for themes but sets the correct fill colors directly in the shape attributes and so the colors were correct in Word.

If a solution with generating the needed 'Theme' folder is not possible for LO 7.4, then the old way with direct colors should be used.

For LO 7.5 a solution with generating the needed 'Theme' folder would be nice. But if that will not be possible in time, for 7.5 too the old way with direct colors should be used for odt->docx.
Comment 1 Dieter 2022-11-23 07:31:45 UTC
I confirm it with

Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 55cd20e6228a06836285c14ca6726adb1bb4ffcb
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (de_DE); UI: en-GB
Calc: CL threaded

But you can see a problem also in LO

Steps:
(see above)
...
Save as docx and reload

Actual result: Colors are missing. Instead a single black is used.

Miklos, can you have a look at it?
Comment 2 Miklos Vajna 2022-11-23 07:59:39 UTC
This never worked, full handling of the theme itself is only there in Impress. Although Tomaz is now looking at this for Writer (and ideally also for Calc later), so CC Tomaz.
Comment 3 Regina Henschel 2023-02-16 22:17:22 UTC
Created attachment 185413 [details]
File with shapes with theme color

The missing theme-folder is still a problem in Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9d44236a62bf59d120dda89924d0d1407b2bd52b
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

It affects not only SmartArt but ordinary shapes too. We now have loext:theme for odt and that works for odt in the main. Exporting such file to docx produces the correct attributes with 'schemeClr' in the markup of the shapes. But the 'theme' folder is still missing and therefore Word uses its default theme.
Comment 4 Regina Henschel 2023-02-16 22:18:09 UTC
Created attachment 185414 [details]
Screenshot comparing left Writer with right Word
Comment 5 Tomaz Vajngerl 2023-06-19 07:10:13 UTC
@Regina can you recheck? I think this is fine now. ODT doesn't work as the element names have changed.
Comment 6 Regina Henschel 2023-06-19 11:55:43 UTC
It still doesn't work. The theme is now exported to odt and later exported to docx. So that part is correct now.

But there is the additional error, that the color transformations are lost. The ellipses in the diagram all have 'accent5' as a:schemeClr and that is read and exported. But actual color has to consider the color transformations, which is not the case yet.
I see these color transformations in the drawing1.xml in the diagram in the original docx file:
<a:hueOff val="0"/><a:satOff val="0"/><a:lumOff val="0"/>
<a:hueOff val="-3311292"/><a:satOff val="13270"/><a:lumOff val="2876"/>
<a:hueOff val="-6622584"/><a:satOff val="26541"/><a:lumOff val="5752"/>
<a:hueOff val="-9933876"/><a:satOff val="39811"/><a:lumOff val="8628"/>


I have tested it with a build Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 8da305acc9bc1fa0a31cd61d5da632e6bb4ae48c
CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: default; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: threaded