diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-08-03 10:14:40 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-08-15 20:58:13 +0200 |
commit | 9d5a7d9257db78eb3f4d77c39eae1affe877ea6b (patch) | |
tree | e5efa2d17c68055125eb24fe1761c6e77caab4db /editeng | |
parent | 918cd8cbf383e0099d80db2e12a1071a0bc4f200 (diff) |
ComplexColor various clean-up and (trivial) refactorings
Don't allow access to member variables of ComplexColor and makes
them private. Needs a lot of changes.
Change "scheme" to "theme" to be more consistent. In LO we usually
call the "theme color" what is usually refered to as "scheme color"
in OOXML, where it is sometimes refered to as "scheme" and other times
as theme color.
Remove ThemeColor class which was replaced with CmplexColor some
time ago.
Remove un-needed includes and un-needed components.
Use isValidThemeColor in many places where we check that the
ComplexColor is of "Theme" type and that ThemeColorType is set to
a valid value.
Change-Id: I325595fa65b8e56a4707e9d22acc6330aac28961
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155359
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/items/textitem.cxx | 6 | ||||
-rw-r--r-- | editeng/source/uno/unotext.cxx | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 546918197a34..77f95f6de9ee 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -1424,7 +1424,7 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const } case MID_COLOR_THEME_INDEX: { - rVal <<= sal_Int16(maComplexColor.meSchemeType); + rVal <<= sal_Int16(maComplexColor.getThemeColorType()); break; } case MID_COLOR_TINT_OR_SHADE: @@ -1509,7 +1509,7 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) sal_Int16 nIndex = -1; if (!(rVal >>= nIndex)) return false; - maComplexColor.setSchemeColor(model::convertToThemeColorType(nIndex)); + maComplexColor.setThemeColor(model::convertToThemeColorType(nIndex)); } break; case MID_COLOR_TINT_OR_SHADE: @@ -1617,7 +1617,7 @@ void SvxColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const (void)xmlTextWriterStartElement(pWriter, BAD_CAST("complex-color")); (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"), - BAD_CAST(OString::number(sal_Int16(maComplexColor.meType)).getStr())); + BAD_CAST(OString::number(sal_Int16(maComplexColor.getType())).getStr())); for (auto const& rTransform : maComplexColor.getTransformations()) { diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index ee66097f7ec9..df4d615f0979 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -1182,7 +1182,7 @@ bool SvxUnoTextRangeBase::_getOnePropertyStates(const SfxItemSet* pSet, const Sf switch (pMap->nMemberId) { case MID_COLOR_THEME_INDEX: - if (pColor->getComplexColor().meSchemeType == model::ThemeColorType::Unknown) + if (!pColor->getComplexColor().isValidThemeType()) { eItemState = SfxItemState::DEFAULT; } @@ -1216,7 +1216,7 @@ bool SvxUnoTextRangeBase::_getOnePropertyStates(const SfxItemSet* pSet, const Sf break; } case MID_COMPLEX_COLOR: - if (pColor->getComplexColor().meType == model::ColorType::Unused) + if (pColor->getComplexColor().getType() == model::ColorType::Unused) { eItemState = SfxItemState::DEFAULT; } |