diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-08-18 22:28:33 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-08-28 12:44:46 +0200 |
commit | 431f9322863d0002b67469741a967b408d301905 (patch) | |
tree | 88135a74fa9894979c45c7a8390fed799aa6736c /cui | |
parent | 151e55ba811a4fddcefe26601c26447f7085b359 (diff) |
cui: use common menthod to get the complex color from a NamedColor
NamedColor implements a getComplexColor method, which creates the
ComplexColor from the NamedColor attributes. We don't need to do
this ourselves.
Change-Id: If2629d49b7b2e561b85b93314f56a95492cafd93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155863
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit 3f7e9b2ea67a8de9ad9dd819ec2eb91e8180af95)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156166
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/chardlg.cxx | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 325b7925fb66..716e193af45e 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -1594,18 +1594,7 @@ bool SvxCharEffectsPage::FillItemSetColor_Impl( SfxItemSet& rSet ) if (bChanged) { - SvxColorItem aItem( aSelectedColor.m_aColor, nWhich ); - - // The color was picked from the theme palette, remember its index. - model::ThemeColorType eType = model::convertToThemeColorType(aSelectedColor.m_nThemeIndex); - if (eType != model::ThemeColorType::Unknown) - { - auto aComplexColor = model::ComplexColor::Theme(eType); - aComplexColor.addTransformation({model::TransformationType::LumMod, aSelectedColor.m_nLumMod}); - aComplexColor.addTransformation({model::TransformationType::LumOff, aSelectedColor.m_nLumOff}); - aItem.setComplexColor(aComplexColor); - } - + SvxColorItem aItem(aSelectedColor.m_aColor, aSelectedColor.getComplexColor(), nWhich); rSet.Put(aItem); } else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) ) |