Trouble with theme color in docx

Regina Henschel rb.henschel at t-online.de
Sun Jan 1 21:43:17 UTC 2023


Hi Miklos, hi Tomaž, hi all,

Tomaž, I have put you in CC because you are currently heavily working on 
theme colors.

I come across the problem, that my import in 
https://gerrit.libreoffice.org/c/core/+/143615 does not get the correct 
color, if theme colors other than 'accent1'..'accent6' are used.

Colored text in shapes in PowerPoint and fill and stroke of shapes in 
Word use e.g.:
<a:rPr> <a:solidFill> <a:schemeClr val="bg1">
But colored text in shapes in Word uses e.g.:
<w:rPr> <w:color w:themeColor="background1">

The themeColor attribute uses ST_ThemeColor (ISO 17.18.97) and that are 
the long variants of the color keys, e.g:
background1, dark1, light1

<schemeClr> uses the ST_SchemeColorVal enumeration (ISO 20.1.10.54). 
That one has the same items as the elements in <clrScheme> in 
<themeElements> but with the additional items 'bg1', 'bg2', 'tx1', 'tx2'.
The ClrScheme::getColor() method maps these additional items to 'lt1', 
'lt2', 'dk1' and 'dk2' respectively before searching the color. But it 
does not catch the keys used with themeColor attribute.

The only kind of mapping with the long variants that I have found at all 
is TDefTableHandler::getThemeColorTypeIndex and those assignments look 
wrong to me (e.g. using 0 for background1 and for dark1).

VML import/export is likely effected too, because it uses <w:color 
w:themeColor=".."> too.

Where to fix it?

Kind regards,
Regina





More information about the LibreOffice mailing list