From bd0f526f2d3e1ffe43a74672485815768eee6e9e Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Wed, 28 Dec 2022 09:43:46 +0900 Subject: introduce docmodel comp., model::ThemeColor, use it in SvxColorItem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- svx/source/styles/ColorSets.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'svx/source/styles') diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx index 5511253f3d03..00ffdae3b031 100644 --- a/svx/source/styles/ColorSets.cxx +++ b/svx/source/styles/ColorSets.cxx @@ -39,9 +39,9 @@ void UpdateTextPortionColorSet(const uno::Reference& xPorti { sal_Int16 nCharColorTheme = -1; xPortion->getPropertyValue(UNO_NAME_EDIT_CHAR_COLOR_THEME) >>= nCharColorTheme; - svx::ThemeColorType eColorThemeType = svx::convertToThemeColorType(nCharColorTheme); + model::ThemeColorType eColorThemeType = model::convertToThemeColorType(nCharColorTheme); - if (eColorThemeType == svx::ThemeColorType::Unknown) + if (eColorThemeType == model::ThemeColorType::Unknown) return; Color aColor = rColorSet.getColor(eColorThemeType); @@ -74,8 +74,8 @@ void UpdateFillColorSet(const uno::Reference& xShape, const sal_Int16 nFillColorTheme = -1; xShape->getPropertyValue(UNO_NAME_FILLCOLOR_THEME) >>= nFillColorTheme; - svx::ThemeColorType eColorThemeType = svx::convertToThemeColorType(nFillColorTheme); - if (eColorThemeType == svx::ThemeColorType::Unknown) + model::ThemeColorType eColorThemeType = model::convertToThemeColorType(nFillColorTheme); + if (eColorThemeType == model::ThemeColorType::Unknown) return; Color aColor = rColorSet.getColor(eColorThemeType); @@ -281,7 +281,7 @@ void Theme::ToAny(css::uno::Any& rVal) const if (mpColorSet) { std::vector aColorScheme; - for (auto eThemeColorType : o3tl::enumrange()) + for (auto eThemeColorType : o3tl::enumrange()) { Color aColor = mpColorSet->getColor(eThemeColorType); aColorScheme.push_back(sal_Int32(aColor)); @@ -362,14 +362,14 @@ std::vector Theme::GetColors() const return {}; std::vector aColors; - for (auto eThemeColorType : o3tl::enumrange()) + for (auto eThemeColorType : o3tl::enumrange()) { aColors.push_back(mpColorSet->getColor(eThemeColorType)); } return aColors; } -Color Theme::GetColor(ThemeColorType eType) const +Color Theme::GetColor(model::ThemeColorType eType) const { if (!mpColorSet) return {}; -- cgit LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff