summaryrefslogtreecommitdiff
path: root/xmloff/inc
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-05-08 14:09:00 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-05-12 05:00:28 +0200
commit1df0565fb92972bd410e7db85eef1e4bec3fcc31 (patch)
tree863c5cf54a5941ca84e2d76b68c4e895159d78de /xmloff/inc
parent99a88c9e55872214ce01d89447d18708e47e956b (diff)
use ComplexColor instead of ThemeColor for better OOXML compat.
In OOXML a color definition includes more represenations, one of which is scheme color (which is what is implemented in ThemeColor currently), but it supports other representations too (RGB, HSL, System,..). ComplexColor includes all the representations, so to have a better compatibility with OOXML, this changes all uses of ThemeColor to ComplexColor. In many cases the usage of ComplexColor isn't the same as the usage of ThemeColors, but this cases will need to be changed in a later commit. Change-Id: I9cc8acee2ac0a1998fe9b98247bcf4a96273149a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151492 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'xmloff/inc')
-rw-r--r--xmloff/inc/XMLThemeColorContext.hxx4
-rw-r--r--xmloff/inc/XMLThemeColorHandler.hxx21
-rw-r--r--xmloff/inc/xmlprop.hxx4
3 files changed, 13 insertions, 16 deletions
diff --git a/xmloff/inc/XMLThemeColorContext.hxx b/xmloff/inc/XMLThemeColorContext.hxx
index 444de3b15588..8bab725c44a6 100644
--- a/xmloff/inc/XMLThemeColorContext.hxx
+++ b/xmloff/inc/XMLThemeColorContext.hxx
@@ -11,11 +11,11 @@
#include <memory>
#include "XMLElementPropertyContext.hxx"
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
class XMLThemeColorContext final : public XMLElementPropertyContext
{
- model::ThemeColor aThemeColor;
+ model::ComplexColor maComplexColor;
sal_Int32 mnRootElement;
public:
diff --git a/xmloff/inc/XMLThemeColorHandler.hxx b/xmloff/inc/XMLThemeColorHandler.hxx
index 2ede6f182048..052b0db6c1d4 100644
--- a/xmloff/inc/XMLThemeColorHandler.hxx
+++ b/xmloff/inc/XMLThemeColorHandler.hxx
@@ -9,12 +9,12 @@
#pragma once
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
using namespace ::xmloff::token;
using namespace css;
-class XMLThemeColorHandler : public XMLPropertyHandler
+class XMLComplexColorHandler : public XMLPropertyHandler
{
public:
bool importXML(const OUString& /*rStrImpValue*/, css::uno::Any& /*rValue*/,
@@ -31,16 +31,13 @@ public:
bool equals(const css::uno::Any& rAny1, const css::uno::Any& rAny2) const override
{
- uno::Reference<util::XThemeColor> xThemeColor1;
- uno::Reference<util::XThemeColor> xThemeColor2;
- rAny1 >>= xThemeColor1;
- rAny2 >>= xThemeColor2;
- model::ThemeColor aThemeColor1;
- model::ThemeColor aThemeColor2;
- model::theme::setFromXThemeColor(aThemeColor1, xThemeColor1);
- model::theme::setFromXThemeColor(aThemeColor2, xThemeColor2);
-
- return aThemeColor1 == aThemeColor2;
+ uno::Reference<util::XComplexColor> xComplexColor1;
+ uno::Reference<util::XComplexColor> xComplexColor2;
+ rAny1 >>= xComplexColor1;
+ rAny2 >>= xComplexColor2;
+ model::ComplexColor aComplexColor1 = model::color::getFromXComplexColor(xComplexColor1);
+ model::ComplexColor aComplexColor2 = model::color::getFromXComplexColor(xComplexColor2);
+ return aComplexColor1 == aComplexColor2;
}
};
diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx
index e2968b688e2c..14da0a3ad36d 100644
--- a/xmloff/inc/xmlprop.hxx
+++ b/xmloff/inc/xmlprop.hxx
@@ -56,7 +56,7 @@ inline constexpr OUStringLiteral PROP_CharBottomBorder = u"CharBottomBorder";
inline constexpr OUStringLiteral PROP_CharBottomBorderDistance = u"CharBottomBorderDistance";
inline constexpr OUStringLiteral PROP_CharCaseMap = u"CharCaseMap";
inline constexpr OUStringLiteral PROP_CharColor = u"CharColor";
-inline constexpr OUStringLiteral PROP_CharColorThemeReference = u"CharColorThemeReference";
+inline constexpr OUStringLiteral PROP_CharComplexColor = u"CharComplexColor";
inline constexpr OUStringLiteral PROP_CharCombineIsOn = u"CharCombineIsOn";
inline constexpr OUStringLiteral PROP_CharCombinePrefix = u"CharCombinePrefix";
inline constexpr OUStringLiteral PROP_CharCombineSuffix = u"CharCombineSuffix";
@@ -208,7 +208,7 @@ inline constexpr OUStringLiteral PROP_FillBitmapSizeX = u"FillBitmapSizeX";
inline constexpr OUStringLiteral PROP_FillBitmapSizeY = u"FillBitmapSizeY";
inline constexpr OUStringLiteral PROP_FillColor = u"FillColor";
inline constexpr OUStringLiteral PROP_FillColor2 = u"FillColor2";
-inline constexpr OUStringLiteral PROP_FillColorThemeReference = u"FillColorThemeReference";
+inline constexpr OUStringLiteral PROP_FillComplexColor = u"FillComplexColor";
inline constexpr OUStringLiteral PROP_FillGradientName = u"FillGradientName";
inline constexpr OUStringLiteral PROP_FillGradientStepCount = u"FillGradientStepCount";
inline constexpr OUStringLiteral PROP_FillHatchName = u"FillHatchName";