<div dir="ltr"><div dir="ltr">Hi Regina,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 15, 2023 at 9:43 AM Regina Henschel <<a href="mailto:rb.henschel@t-online.de">rb.henschel@t-online.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Thomaž,<br>
<br>
for my current work on exporting Fontwork shapes to docx I need for a <br>
theme color the string used in OOXML markup. Does already a method <br>
exist, that takes the Type of a theme color and returns that string? I <br>
could not find one.<br></blockquote><div><br></div><div>There is g_aPredefinedClrNames, but that's a bit older code, which relies on array index to correspond to theme color type value. A map would probably be better...<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
With Type I mean the value returned by getType() of XThemeColor or <br>
CharColorTheme or FillColorTheme.<br></blockquote><div><br></div><div>I suggest you always cast the XThemeColor to UnoThemeColor and use wrapped ThemeColor to get the ThemeColorType enum. There are also the transformations that you need to take into account anyway, which aren't covered by the UNO API. <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I'm looking for a method like: getMarkupStringForThemeColorType(3) with <br>
result "tx2".<br></blockquote><div><br></div><div>Well if you expect it to return "tx2" then that's a problem as the same ThemeColorType maps to "dk2" in drawingml, so you need to treat that specially. <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
If it doesn't exist, shall I define one local in my FontworkHelpers only <br>
for me, or do you want to have such method somewhere else?<br>
<br>
If latter, please suggest a location and a name.<br></blockquote><div><br></div><div>I suggest you define one locally for Fontwork, because of the difference of what values it should return (tx1, tx2, bg1, bg2 instead of dk1, dk2, lt1, lt2). We can always refactor afterwards. <br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Kind regards,<br>
Regina<br></blockquote><div><br></div><div>Regards, Tomaž <br></div></div></div>