summaryrefslogtreecommitdiff
path: root/docmodel
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-05-01 10:19:06 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-05-25 02:18:16 +0200
commite21f2c8710b6116b9b17f065b1482d057e7842ff (patch)
treea2e85cf82acc1e64172114b09d2a8b5ce3dd6fed /docmodel
parentc2bcd7b5bbb91fcd9375361ca6ab9e1c486a5dea (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> (cherry picked from commit 900c3a2a854436fdbacd488ef1da12ea99fbceb0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152231 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'docmodel')
-rw-r--r--docmodel/source/theme/ColorSet.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/docmodel/source/theme/ColorSet.cxx b/docmodel/source/theme/ColorSet.cxx
index 55c03dadba8c..44cd5bdc6c4f 100644
--- a/docmodel/source/theme/ColorSet.cxx
+++ b/docmodel/source/theme/ColorSet.cxx
@@ -50,6 +50,18 @@ Color ColorSet::resolveColor(model::ThemeColor const& rThemeColor) const
return rThemeColor.applyTransformations(aColor);
}
+Color ColorSet::resolveColor(model::ComplexColor const& rComplexColor) const
+{
+ auto eSchemeType = rComplexColor.meSchemeType;
+ if (eSchemeType == model::ThemeColorType::Unknown)
+ {
+ SAL_WARN("svx", "ColorSet::resolveColor with ThemeColorType::Unknown");
+ return COL_AUTO;
+ }
+ Color aColor = getColor(eSchemeType);
+ return rComplexColor.applyTransformations(aColor);
+}
+
void ColorSet::dumpAsXml(xmlTextWriterPtr pWriter) const
{
(void)xmlTextWriterStartElement(pWriter, BAD_CAST("ColorSet"));