Re: method to get string from theme color Type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tomaž,

thank you for your advise. I'll keep things in FontworkHelpers.

Kind regards,
Regina

Tomaž Vajngerl schrieb am 15.02.2023 um 14:33:
Hi Regina,

On Wed, Feb 15, 2023 at 9:43 AM Regina Henschel <rb.henschel@xxxxxxxxxxx <mailto:rb.henschel@xxxxxxxxxxx>> wrote:

    Hi Thomaž,

    for my current work on exporting Fontwork shapes to docx I need for a
    theme color the string used in OOXML markup. Does already a method
    exist, that takes the Type of a theme color and returns that string? I
    could not find one.


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...


    With Type I mean the value returned by getType() of XThemeColor or
    CharColorTheme or FillColorTheme.


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.

    I'm looking for a method like: getMarkupStringForThemeColorType(3) with
    result "tx2".


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.

    If it doesn't exist, shall I define one local in my FontworkHelpers
    only
    for me, or do you want to have such method somewhere else?

    If latter, please suggest a location and a name.


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.

    Kind regards,
    Regina


Regards, Tomaž




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux