diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-12-28 09:43:46 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-01-16 08:03:14 +0000 |
commit | 5be810bca2e5701d8451b4bf4e9e88e3f7b3a56d (patch) | |
tree | 8e646f4c7a7023e00a3570ef57c93f27ec315ac7 /svx/source/table/cell.cxx | |
parent | 7169596baf030d89d95db63bd78d55dc8072d22b (diff) |
introduce docmodel comp., model::ThemeColor, use it in SvxColorItem
Added a new component docmodel, that has the document model types,
which only depend on other basic components. This is needed so the
types can be used in every relevant component - xmloff, oox, svx,
editeng,...
Introduces model::ThemeColor, which is a class used to store the
theme color data, including transformations (svx::Transformation).
For UNO use XThemeColor is added, and the implementation UnoThemeColor
which wraps svx::ThemeColor, so it can be tranported around.
Reactor all the code and tests to accomodate for this change.
Change-Id: I7ce6752cdfaf5e4d3b8e4d90314afa469dd65cfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144847
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
(cherry picked from commit bd0f526f2d3e1ffe43a74672485815768eee6e9e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145528
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'svx/source/table/cell.cxx')
-rw-r--r-- | svx/source/table/cell.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index a156174f56d6..99f53a7c127f 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -1444,10 +1444,11 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) } break; case XATTR_FILLCOLOR: + if (pMap->nMemberId == MID_COLOR_THEME_INDEX) { const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID); - if (pColor->GetThemeColor().GetThemeIndex() == -1) + if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown) { eState = PropertyState_DEFAULT_VALUE; } @@ -1455,7 +1456,13 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) else if (pMap->nMemberId == MID_COLOR_LUM_MOD) { const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID); - if (pColor->GetThemeColor().GetLumMod() == 10000) + sal_Int16 nLumMod = 10000; + for (auto const& rTransform : pColor->GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumMod) + nLumMod = rTransform.mnValue; + } + if (nLumMod == 10000) { eState = PropertyState_DEFAULT_VALUE; } @@ -1463,7 +1470,13 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) else if (pMap->nMemberId == MID_COLOR_LUM_OFF) { const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID); - if (pColor->GetThemeColor().GetLumOff() == 0) + sal_Int16 nLumOff = 0; + for (auto const& rTransform : pColor->GetThemeColor().getTransformations()) + { + if (rTransform.meType == model::TransformationType::LumOff) + nLumOff = rTransform.mnValue; + } + if (nLumOff == 0) { eState = PropertyState_DEFAULT_VALUE; } |