diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-05-01 10:19:06 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-05-08 07:23:17 +0200 |
commit | 900c3a2a854436fdbacd488ef1da12ea99fbceb0 (patch) | |
tree | 6cc0be94d385b8ae64fb3a0275aa6810b1963505 /sd/source | |
parent | 7a10187042c1a2b402a9872f66108cfcd8080117 (diff) |
svx: use ComplexColor in SvxColorItem instead of the ThemeColor
ComplexColor includes everything a ThemeColor has and in addition
also can have various other representations that are supported by
OOXML. This is important for compatibility reasons to preserve the
color information.
Change-Id: I677775a96511dc1742c75b1949e002eaa8c622e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151226
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/drtxtob1.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 7fba8728d991..f6301ba1b592 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -780,20 +780,21 @@ void TextObjectBar::Execute( SfxRequest &rReq ) if (nSlot == SID_ATTR_CHAR_COLOR) { pColorItem = std::make_unique<SvxColorItem>(pNewArgs->Get(EE_CHAR_COLOR)); - pColorItem->GetThemeColor().clearTransformations(); + model::ComplexColor aComplexColor; if (const SfxInt16Item* pIntItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_THEME_INDEX, false)) { - pColorItem->GetThemeColor().setType(model::convertToThemeColorType(pIntItem->GetValue())); + aComplexColor.setSchemeColor(model::convertToThemeColorType(pIntItem->GetValue())); } if (const SfxInt16Item* pIntItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_LUM_MOD, false)) { - pColorItem->GetThemeColor().addTransformation({model::TransformationType::LumMod, pIntItem->GetValue()}); + aComplexColor.addTransformation({model::TransformationType::LumMod, pIntItem->GetValue()}); } if (const SfxInt16Item* pIntItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_LUM_OFF, false)) { - pColorItem->GetThemeColor().addTransformation({model::TransformationType::LumOff, pIntItem->GetValue()}); + aComplexColor.addTransformation({model::TransformationType::LumOff, pIntItem->GetValue()}); } + pColorItem->setComplexColor(aComplexColor); pNewArgs->Put(std::move(pColorItem)); } |