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-08 07:23:17 +0200
commit900c3a2a854436fdbacd488ef1da12ea99fbceb0 (patch)
tree6cc0be94d385b8ae64fb3a0275aa6810b1963505 /docmodel
parent7a10187042c1a2b402a9872f66108cfcd8080117 (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>
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"));