summaryrefslogtreecommitdiff
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
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>
-rw-r--r--cui/source/tabpages/tpcolor.cxx8
-rw-r--r--docmodel/Library_docmodel.mk3
-rw-r--r--docmodel/source/color/ComplexColorJSON.cxx (renamed from docmodel/source/theme/ThemeColorJSON.cxx)20
-rw-r--r--docmodel/source/theme/ColorSet.cxx12
-rw-r--r--docmodel/source/uno/UnoThemeColor.cxx40
-rw-r--r--editeng/source/items/textitem.cxx53
-rw-r--r--editeng/source/uno/unotext.cxx2
-rw-r--r--include/docmodel/color/ComplexColor.hxx7
-rw-r--r--include/docmodel/color/ComplexColorJSON.hxx (renamed from include/docmodel/theme/ThemeColorJSON.hxx)9
-rw-r--r--include/docmodel/theme/ColorSet.hxx2
-rw-r--r--include/docmodel/uno/UnoThemeColor.hxx55
-rw-r--r--include/editeng/memberids.h4
-rw-r--r--include/editeng/unoprnms.hxx8
-rw-r--r--include/editeng/unotext.hxx4
-rw-r--r--include/svx/svxids.hrc2
-rw-r--r--include/svx/unoshprp.hxx4
-rw-r--r--include/svx/xcolit.hxx9
-rw-r--r--include/xmloff/txtprmap.hxx2
-rw-r--r--include/xmloff/xmltoken.hxx4
-rw-r--r--include/xmloff/xmltypes.hxx2
-rw-r--r--offapi/UnoApi_offapi.mk1
-rw-r--r--offapi/com/sun/star/util/XThemeColor.idl26
-rw-r--r--oox/inc/drawingml/fontworkhelpers.hxx16
-rw-r--r--oox/qa/unit/drawingml.cxx99
-rw-r--r--oox/qa/unit/shape.cxx15
-rw-r--r--oox/source/drawingml/fillproperties.cxx20
-rw-r--r--oox/source/drawingml/fontworkhelpers.cxx94
-rw-r--r--oox/source/drawingml/lineproperties.cxx21
-rw-r--r--oox/source/drawingml/textcharacterproperties.cxx16
-rw-r--r--oox/source/export/drawingml.cxx38
-rw-r--r--oox/source/token/properties.txt6
-rw-r--r--sc/source/core/data/document.cxx13
-rw-r--r--sd/qa/unit/uiimpress.cxx40
-rw-r--r--sd/source/core/stlsheet.cxx16
-rw-r--r--sd/source/ui/func/fuconstr.cxx2
-rw-r--r--sd/source/ui/view/drviews2.cxx10
-rw-r--r--svx/qa/unit/styles.cxx32
-rw-r--r--svx/qa/unit/xoutdev.cxx33
-rw-r--r--svx/sdi/svxitems.sdi4
-rw-r--r--svx/source/dialog/ThemeColorValueSet.cxx2
-rw-r--r--svx/source/dialog/ThemeDialog.cxx1
-rw-r--r--svx/source/table/cell.cxx23
-rw-r--r--svx/source/tbxctrls/PaletteManager.cxx16
-rw-r--r--svx/source/theme/ThemeColorChanger.cxx52
-rw-r--r--svx/source/unodraw/unoprov.cxx2
-rw-r--r--svx/source/unodraw/unoshap2.cxx2
-rw-r--r--svx/source/unodraw/unoshape.cxx17
-rw-r--r--svx/source/xoutdev/xattr.cxx63
-rw-r--r--sw/qa/core/theme/ThemeTest.cxx11
-rw-r--r--sw/source/core/model/ThemeColorChanger.cxx2
-rw-r--r--sw/source/core/unocore/unomap.cxx4
-rw-r--r--sw/source/core/unocore/unomap1.cxx6
-rw-r--r--sw/source/core/unocore/unomapproperties.hxx6
-rw-r--r--sw/source/filter/xml/xmlfmte.cxx2
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx14
-rw-r--r--writerfilter/source/dmapper/PropertyIds.cxx2
-rw-r--r--writerfilter/source/dmapper/PropertyIds.hxx2
-rw-r--r--writerfilter/source/dmapper/ThemeColorHandler.hxx2
-rw-r--r--xmloff/inc/XMLThemeColorContext.hxx4
-rw-r--r--xmloff/inc/XMLThemeColorHandler.hxx21
-rw-r--r--xmloff/inc/xmlprop.hxx4
-rw-r--r--xmloff/qa/unit/draw.cxx119
-rw-r--r--xmloff/source/core/xmltoken.cxx4
-rw-r--r--xmloff/source/draw/XMLShapePropertySetContext.cxx2
-rw-r--r--xmloff/source/draw/sdpropls.cxx6
-rw-r--r--xmloff/source/text/XMLTextPropertySetContext.cxx2
-rw-r--r--xmloff/source/text/XMLTextShapeStyleContext.cxx2
-rw-r--r--xmloff/source/text/XMLThemeColorContext.cxx8
-rw-r--r--xmloff/source/text/XMLThemeColorExport.cxx19
-rw-r--r--xmloff/source/text/txtexppr.cxx2
-rw-r--r--xmloff/source/text/txtprhdl.cxx4
-rw-r--r--xmloff/source/text/txtprmap.cxx6
72 files changed, 509 insertions, 675 deletions
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 694fce496f96..799f53957678 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -247,16 +247,16 @@ bool SvxColorTabPage::FillItemSet( SfxItemSet* rSet )
model::ThemeColorType eType = model::convertToThemeColorType(aCurrentColor.m_nThemeIndex);
if (eType != model::ThemeColorType::Unknown)
{
- aColorItem.GetThemeColor().setType(eType);
+ aColorItem.getComplexColor().setSchemeColor(eType);
}
- aColorItem.GetThemeColor().clearTransformations();
+ aColorItem.getComplexColor().clearTransformations();
if (aCurrentColor.m_nLumMod != 10000)
{
- aColorItem.GetThemeColor().addTransformation({model::TransformationType::LumMod, aCurrentColor.m_nLumMod});
+ aColorItem.getComplexColor().addTransformation({model::TransformationType::LumMod, aCurrentColor.m_nLumMod});
}
if (aCurrentColor.m_nLumOff != 0)
{
- aColorItem.GetThemeColor().addTransformation({model::TransformationType::LumOff, aCurrentColor.m_nLumOff});
+ aColorItem.getComplexColor().addTransformation({model::TransformationType::LumOff, aCurrentColor.m_nLumOff});
}
rSet->Put( aColorItem );
rSet->Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
diff --git a/docmodel/Library_docmodel.mk b/docmodel/Library_docmodel.mk
index 7f0623bcbeda..2e474eb4f0b8 100644
--- a/docmodel/Library_docmodel.mk
+++ b/docmodel/Library_docmodel.mk
@@ -11,11 +11,10 @@ $(eval $(call gb_Library_Library,docmodel))
$(eval $(call gb_Library_add_exception_objects,docmodel,\
docmodel/source/uno/UnoComplexColor \
- docmodel/source/uno/UnoThemeColor \
docmodel/source/uno/UnoTheme \
docmodel/source/theme/ColorSet \
docmodel/source/theme/Theme \
- docmodel/source/theme/ThemeColorJSON \
+ docmodel/source/color/ComplexColorJSON \
))
$(eval $(call gb_Library_set_include,docmodel,\
diff --git a/docmodel/source/theme/ThemeColorJSON.cxx b/docmodel/source/color/ComplexColorJSON.cxx
index 24b39fc190da..d04e2c1e339b 100644
--- a/docmodel/source/theme/ThemeColorJSON.cxx
+++ b/docmodel/source/color/ComplexColorJSON.cxx
@@ -8,17 +8,17 @@
*
*/
-#include <docmodel/theme/ThemeColorJSON.hxx>
+#include <docmodel/color/ComplexColorJSON.hxx>
#include <sstream>
#include <utility>
#include <sal/log.hxx>
#include <boost/property_tree/json_parser.hpp>
-namespace model::theme
+namespace model::color
{
-bool convertFromJSON(OString const& rJsonString, model::ThemeColor& rThemeColor)
+bool convertFromJSON(OString const& rJsonString, model::ComplexColor& rComplexColor)
{
- model::ThemeColor aThemeColor;
+ model::ComplexColor aComplexColor;
std::stringstream aStream((std::string(rJsonString)));
boost::property_tree::ptree aRootTree;
try
@@ -31,7 +31,7 @@ bool convertFromJSON(OString const& rJsonString, model::ThemeColor& rThemeColor)
}
sal_Int32 nThemeType = aRootTree.get<sal_Int32>("ThemeIndex", -1);
- aThemeColor.setType(model::convertToThemeColorType(nThemeType));
+ aComplexColor.setSchemeColor(model::convertToThemeColorType(nThemeType));
boost::property_tree::ptree aTransformTree = aRootTree.get_child("Transformations");
for (const auto& rEachTransformationNode :
boost::make_iterator_range(aTransformTree.equal_range("")))
@@ -51,19 +51,19 @@ bool convertFromJSON(OString const& rJsonString, model::ThemeColor& rThemeColor)
eType = model::TransformationType::Shade;
if (eType != model::TransformationType::Undefined)
- aThemeColor.addTransformation({ eType, nValue });
+ aComplexColor.addTransformation({ eType, nValue });
}
- rThemeColor = aThemeColor;
+ rComplexColor = aComplexColor;
return true;
}
-OString convertToJSON(model::ThemeColor const& rThemeColor)
+OString convertToJSON(model::ComplexColor const& rComplexColor)
{
boost::property_tree::ptree aTree;
- aTree.put("ThemeIndex", sal_Int16(rThemeColor.getType()));
+ aTree.put("ThemeIndex", sal_Int16(rComplexColor.getSchemeType()));
boost::property_tree::ptree aTransformationsList;
- for (auto const& rTransformation : rThemeColor.getTransformations())
+ for (auto const& rTransformation : rComplexColor.getTransformations())
{
std::string aType;
switch (rTransformation.meType)
diff --git a/docmodel/source/theme/ColorSet.cxx b/docmodel/source/theme/ColorSet.cxx
index 44cd5bdc6c4f..71b928b9f2a7 100644
--- a/docmodel/source/theme/ColorSet.cxx
+++ b/docmodel/source/theme/ColorSet.cxx
@@ -38,18 +38,6 @@ Color ColorSet::getColor(model::ThemeColorType eType) const
return maColors[size_t(eType)];
}
-Color ColorSet::resolveColor(model::ThemeColor const& rThemeColor) const
-{
- auto eType = rThemeColor.getType();
- if (eType == model::ThemeColorType::Unknown)
- {
- SAL_WARN("svx", "ColorSet::resolveColor with ThemeColorType::Unknown");
- return COL_AUTO;
- }
- Color aColor = getColor(eType);
- return rThemeColor.applyTransformations(aColor);
-}
-
Color ColorSet::resolveColor(model::ComplexColor const& rComplexColor) const
{
auto eSchemeType = rComplexColor.meSchemeType;
diff --git a/docmodel/source/uno/UnoThemeColor.cxx b/docmodel/source/uno/UnoThemeColor.cxx
deleted file mode 100644
index f6374b54933b..000000000000
--- a/docmodel/source/uno/UnoThemeColor.cxx
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- */
-
-#include <docmodel/uno/UnoThemeColor.hxx>
-#include <cppuhelper/queryinterface.hxx>
-
-using namespace css;
-
-// css::lang::XUnoTunnel
-UNO3_GETIMPLEMENTATION_IMPL(UnoThemeColor);
-
-sal_Int16 UnoThemeColor::getType() { return sal_uInt16(maThemeColor.getType()); }
-
-namespace model::theme
-{
-uno::Reference<util::XThemeColor> createXThemeColor(model::ThemeColor const& rThemeColor)
-{
- return new UnoThemeColor(rThemeColor);
-}
-
-void setFromXThemeColor(model::ThemeColor& rThemeColor,
- uno::Reference<util::XThemeColor> const& rxColorTheme)
-{
- UnoThemeColor* pUnoThemeColor = comphelper::getFromUnoTunnel<UnoThemeColor>(rxColorTheme);
- if (pUnoThemeColor)
- {
- rThemeColor = pUnoThemeColor->getThemeColor();
- }
-}
-
-} // end model::theme
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 153319ae8e75..1112bcf1a548 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -77,8 +77,9 @@
#include <editeng/charreliefitem.hxx>
#include <editeng/itemtype.hxx>
#include <editeng/eerdll.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
-#include <docmodel/theme/ThemeColorJSON.hxx>
+#include <docmodel/color/ComplexColorJSON.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
+#include <docmodel/color/ComplexColor.hxx>
#include <libxml/xmlwriter.h>
using namespace ::com::sun::star;
@@ -1444,17 +1445,15 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
rVal <<= nValue;
break;
}
- case MID_COLOR_THEME_REFERENCE:
+ case MID_COMPLEX_COLOR_JSON:
{
- model::ThemeColor aThemeColor = maComplexColor.createThemeColor();
- auto xThemeColor = model::theme::createXThemeColor(aThemeColor);
- rVal <<= xThemeColor;
+ rVal <<= OStringToOUString(model::color::convertToJSON(maComplexColor), RTL_TEXTENCODING_UTF8);
break;
}
- case MID_COLOR_THEME_REFERENCE_JSON:
+ case MID_COMPLEX_COLOR:
{
- model::ThemeColor aThemeColor = maComplexColor.createThemeColor();
- rVal <<= OStringToOUString(model::theme::convertToJSON(aThemeColor), RTL_TEXTENCODING_UTF8);
+ auto xComplexColor = model::color::createXComplexColor(maComplexColor);
+ rVal <<= xComplexColor;
break;
}
case MID_COLOR_RGB:
@@ -1532,42 +1531,30 @@ bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
maComplexColor.addTransformation({model::TransformationType::LumOff, nLumOff});
}
break;
- case MID_COLOR_THEME_REFERENCE:
+ case MID_COMPLEX_COLOR_JSON:
{
- css::uno::Reference<css::util::XThemeColor> xThemeColor;
- if (!(rVal >>= xThemeColor))
+ OUString sComplexColorJson;
+ if (!(rVal >>= sComplexColorJson))
return false;
- if (xThemeColor.is())
+ if (sComplexColorJson.isEmpty())
{
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- maComplexColor = model::ComplexColor();
- maComplexColor.setSchemeColor(aThemeColor.getType());
- maComplexColor.setTransformations(aThemeColor.getTransformations());
+ return false;
}
+ OString aJSON = OUStringToOString(sComplexColorJson, RTL_TEXTENCODING_ASCII_US);
+ model::color::convertFromJSON(aJSON, maComplexColor);
}
break;
-
- case MID_COLOR_THEME_REFERENCE_JSON:
+ case MID_COMPLEX_COLOR:
{
- OUString sThemeJson;
- if (!(rVal >>= sThemeJson))
+ css::uno::Reference<css::util::XComplexColor> xComplexColor;
+ if (!(rVal >>= xComplexColor))
return false;
- if (sThemeJson.isEmpty())
- {
- return false;
- }
- OString aJSON = OUStringToOString(sThemeJson, RTL_TEXTENCODING_ASCII_US);
- model::ThemeColor aThemeColor;
- model::theme::convertFromJSON(aJSON, aThemeColor);
- maComplexColor = model::ComplexColor();
- maComplexColor.setSchemeColor(aThemeColor.getType());
- maComplexColor.setTransformations(aThemeColor.getTransformations());
+ if (xComplexColor.is())
+ maComplexColor = model::color::getFromXComplexColor(xComplexColor);
}
break;
-
case MID_COLOR_RGB:
default:
{
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index c6a6732ba414..6f78a4a66878 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1176,7 +1176,7 @@ bool SvxUnoTextRangeBase::_getOnePropertyStates(const SfxItemSet* pSet, const Sf
}
break;
}
- case MID_COLOR_THEME_REFERENCE:
+ case MID_COMPLEX_COLOR:
if (pColor->getComplexColor().meType == model::ColorType::Unused)
{
eItemState = SfxItemState::DEFAULT;
diff --git a/include/docmodel/color/ComplexColor.hxx b/include/docmodel/color/ComplexColor.hxx
index f5dd37c2e901..471c6b30e4d1 100644
--- a/include/docmodel/color/ComplexColor.hxx
+++ b/include/docmodel/color/ComplexColor.hxx
@@ -89,6 +89,11 @@ public:
ThemeColorType meSchemeType = ThemeColorType::Unknown;
std::vector<Transformation> maTransformations;
+public:
+ ColorType getType() const { return meType; }
+
+ ThemeColorType getSchemeType() const { return meSchemeType; }
+
Color getRGBColor() const { return Color(mnComponent1, mnComponent2, mnComponent3); }
std::vector<Transformation> const& getTransformations() const { return maTransformations; }
@@ -112,6 +117,8 @@ public:
maTransformations.end());
}
+ void clearTransformations() { maTransformations.clear(); }
+
void setCRGB(sal_Int32 nR, sal_Int32 nG, sal_Int32 nB)
{
mnComponent1 = nR;
diff --git a/include/docmodel/theme/ThemeColorJSON.hxx b/include/docmodel/color/ComplexColorJSON.hxx
index 008850730e99..bf23e4f0565a 100644
--- a/include/docmodel/theme/ThemeColorJSON.hxx
+++ b/include/docmodel/color/ComplexColorJSON.hxx
@@ -11,12 +11,13 @@
#pragma once
#include <docmodel/dllapi.h>
-#include <docmodel/theme/ThemeColor.hxx>
+#include <docmodel/color/ComplexColor.hxx>
-namespace model::theme
+namespace model::color
{
-DOCMODEL_DLLPUBLIC OString convertToJSON(model::ThemeColor const& rThemeColor);
-DOCMODEL_DLLPUBLIC bool convertFromJSON(OString const& rJsonString, model::ThemeColor& rThemeColor);
+DOCMODEL_DLLPUBLIC OString convertToJSON(model::ComplexColor const& rComplexColor);
+DOCMODEL_DLLPUBLIC bool convertFromJSON(OString const& rJsonString,
+ model::ComplexColor& rComplexColor);
} // end of namespace model
diff --git a/include/docmodel/theme/ColorSet.hxx b/include/docmodel/theme/ColorSet.hxx
index 0b7a8a6efdd6..4309c4719a64 100644
--- a/include/docmodel/theme/ColorSet.hxx
+++ b/include/docmodel/theme/ColorSet.hxx
@@ -36,8 +36,6 @@ public:
const OUString& getName() const { return maName; }
- Color resolveColor(model::ThemeColor const& rThemeColor) const;
-
Color resolveColor(model::ComplexColor const& rComplexColor) const;
Color getColor(model::ThemeColorType eType) const;
diff --git a/include/docmodel/uno/UnoThemeColor.hxx b/include/docmodel/uno/UnoThemeColor.hxx
deleted file mode 100644
index 50063ab981dd..000000000000
--- a/include/docmodel/uno/UnoThemeColor.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#pragma once
-
-#include <cppuhelper/implbase.hxx>
-#include <cppuhelper/supportsservice.hxx>
-#include <comphelper/servicehelper.hxx>
-
-#include <com/sun/star/util/Color.hpp>
-#include <com/sun/star/util/XThemeColor.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-#include <utility>
-#include <docmodel/dllapi.h>
-#include <docmodel/theme/ThemeColor.hxx>
-
-class DOCMODEL_DLLPUBLIC UnoThemeColor final
- : public cppu::WeakImplHelper<css::util::XThemeColor, css::lang::XUnoTunnel>
-{
-private:
- model::ThemeColor maThemeColor;
-
-public:
- UnoThemeColor(model::ThemeColor const& rThemeColor)
- : maThemeColor(rThemeColor)
- {
- }
-
- model::ThemeColor const& getThemeColor() const { return maThemeColor; }
-
- // XThemeColor
- sal_Int16 SAL_CALL getType() override;
-
- UNO3_GETIMPLEMENTATION_DECL(UnoThemeColor)
-};
-
-namespace model::theme
-{
-DOCMODEL_DLLPUBLIC css::uno::Reference<css::util::XThemeColor>
-createXThemeColor(model::ThemeColor const& rThemeColor);
-
-DOCMODEL_DLLPUBLIC void
-setFromXThemeColor(model::ThemeColor& rThemeColor,
- css::uno::Reference<css::util::XThemeColor> const& rxThemeColor);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/editeng/memberids.h b/include/editeng/memberids.h
index 0db3c27d0128..e5f1f075290a 100644
--- a/include/editeng/memberids.h
+++ b/include/editeng/memberids.h
@@ -189,8 +189,8 @@
#define MID_COLOR_TINT_OR_SHADE 5
#define MID_COLOR_LUM_MOD 6
#define MID_COLOR_LUM_OFF 7
-#define MID_COLOR_THEME_REFERENCE 8
-#define MID_COLOR_THEME_REFERENCE_JSON 9
+#define MID_COMPLEX_COLOR_JSON 8
+#define MID_COMPLEX_COLOR 9
#endif
diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index 9c96b29e8681..8859dfe5a4a5 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -23,7 +23,7 @@
inline constexpr OUStringLiteral UNO_NAME_CHAR_COLOR = u"CharColor";
inline constexpr OUStringLiteral UNO_NAME_CHAR_COLOR_THEME = u"CharColorTheme";
inline constexpr OUStringLiteral UNO_NAME_CHAR_COLOR_TINT_OR_SHADE = u"CharColorTintOrShade";
-inline constexpr OUStringLiteral UNO_NAME_CHAR_COLOR_THEME_REFERENCE = u"CharColorThemeReference";
+inline constexpr OUStringLiteral UNO_NAME_CHAR_COMPLEX_COLOR = u"CharComplexColor";
inline constexpr OUStringLiteral UNO_NAME_CHAR_HEIGHT = u"CharHeight";
inline constexpr OUStringLiteral UNO_NAME_CHAR_POSTURE = u"CharPosture";
inline constexpr OUStringLiteral UNO_NAME_CHAR_SHADOWED = u"CharShadowed";
@@ -35,7 +35,7 @@ inline constexpr OUStringLiteral UNO_NAME_FILLCOLOR = u"FillColor";
inline constexpr OUStringLiteral UNO_NAME_FILLCOLOR_THEME = u"FillColorTheme";
inline constexpr OUStringLiteral UNO_NAME_FILLCOLOR_LUM_MOD = u"FillColorLumMod";
inline constexpr OUStringLiteral UNO_NAME_FILLCOLOR_LUM_OFF = u"FillColorLumOff";
-inline constexpr OUStringLiteral UNO_NAME_FILLCOLOR_THEME_REFERENCE = u"FillColorThemeReference";
+inline constexpr OUStringLiteral UNO_NAME_FILL_COMPLEX_COLOR = u"FillComplexColor";
inline constexpr OUStringLiteral UNO_NAME_FILLGRADIENT = u"FillGradient";
inline constexpr OUStringLiteral UNO_NAME_FILLGRADIENTNAME = u"FillGradientName";
inline constexpr OUStringLiteral UNO_NAME_FILLHATCH = u"FillHatch";
@@ -77,7 +77,7 @@ inline constexpr OUStringLiteral UNO_NAME_LINESTYLE = u"LineStyle";
inline constexpr OUStringLiteral UNO_NAME_LINEDASH = u"LineDash";
inline constexpr OUStringLiteral UNO_NAME_LINEWIDTH = u"LineWidth";
inline constexpr OUStringLiteral UNO_NAME_LINECOLOR = u"LineColor";
-inline constexpr OUStringLiteral UNO_NAME_LINECOLOR_THEME_REFERENCE = u"LineColorThemeReference";
+inline constexpr OUStringLiteral UNO_NAME_LINE_COMPLEX_COLOR = u"LineComplexColor";
inline constexpr OUStringLiteral UNO_NAME_LINEJOINT = u"LineJoint";
inline constexpr OUStringLiteral UNO_NAME_LINESTART = u"LineStart";
inline constexpr OUStringLiteral UNO_NAME_LINEEND = u"LineEnd";
@@ -340,7 +340,7 @@ inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_COLOR_THEME = u"CharColorThe
inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_COLOR_TINT_OR_SHADE = u"CharColorTintOrShade";
inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_COLOR_LUM_MOD = u"CharColorLumMod";
inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_COLOR_LUM_OFF = u"CharColorLumOff";
-inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_COLOR_THEME_REFERENCE = u"CharColorThemeReference";
+inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_COMPLEX_COLOR = u"CharComplexColor";
inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_TRANSPARENCE = u"CharTransparence";
inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_CROSSEDOUT = u"CharCrossedOut";
inline constexpr OUStringLiteral UNO_NAME_EDIT_CHAR_STRIKEOUT = u"CharStrikeout";
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 935f6ce1b66b..84dc7d9fdb6f 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -41,7 +41,7 @@
#include <com/sun/star/style/LineSpacing.hpp>
#include <com/sun/star/style/TabStop.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <com/sun/star/util/XThemeColor.hpp>
+#include <com/sun/star/util/XComplexColor.hpp>
#include <comphelper/interfacecontainer4.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/weakagg.hxx>
@@ -92,7 +92,7 @@ struct SfxItemPropertyMapEntry;
{ UNO_NAME_EDIT_CHAR_COLOR_TINT_OR_SHADE, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_TINT_OR_SHADE }, \
{ UNO_NAME_EDIT_CHAR_COLOR_LUM_MOD, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_LUM_MOD }, \
{ UNO_NAME_EDIT_CHAR_COLOR_LUM_OFF, EE_CHAR_COLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_LUM_OFF }, \
- { UNO_NAME_EDIT_CHAR_COLOR_THEME_REFERENCE, EE_CHAR_COLOR, ::cppu::UnoType<css::util::XThemeColor>::get(), 0, MID_COLOR_THEME_REFERENCE }, \
+ { UNO_NAME_EDIT_CHAR_COMPLEX_COLOR, EE_CHAR_COLOR, ::cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_COMPLEX_COLOR }, \
{ u"CharBackColor", EE_CHAR_BKGCOLOR, ::cppu::UnoType<sal_Int32>::get(), 0, 0 }, \
{ u"CharBackTransparent", EE_CHAR_BKGCOLOR, ::cppu::UnoType<bool>::get(), 0, MID_GRAPHIC_TRANSPARENT }, \
{ UNO_NAME_EDIT_CHAR_ESCAPEMENT, EE_CHAR_ESCAPEMENT, ::cppu::UnoType<sal_Int16>::get(), 0, MID_ESC }, \
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index d3da901a09ce..90aae09d2c69 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -449,7 +449,7 @@ class XFillGradientItem;
#define SID_ATTR_TEXTCOLUMNS_NUMBER ( SID_SVX_START + 340 )
#define SID_ATTR_TEXTCOLUMNS_SPACING ( SID_SVX_START + 341 )
-#define SID_ATTR_COLOR_THEME_REFERENCE TypedWhichId<SvxColorItem>( SID_SVX_START + 342 )
+// FREE ( SID_SVX_START + 342 )
#define SID_ATTR_COLOR_THEME_INDEX TypedWhichId<SfxInt16Item>( SID_SVX_START + 343 )
#define SID_ATTR_COLOR_LUM_MOD TypedWhichId<SfxInt16Item>( SID_SVX_START + 344 )
#define SID_ATTR_COLOR_LUM_OFF TypedWhichId<SfxInt16Item>( SID_SVX_START + 345 )
diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx
index 828e02771e4b..6c60eac60933 100644
--- a/include/svx/unoshprp.hxx
+++ b/include/svx/unoshprp.hxx
@@ -237,7 +237,7 @@
#define LINE_PROPERTIES_DEFAULTS\
{ UNO_NAME_LINECAP, XATTR_LINECAP, ::cppu::UnoType<css::drawing::LineCap>::get(), 0, 0}, \
{ UNO_NAME_LINECOLOR, XATTR_LINECOLOR, ::cppu::UnoType<sal_Int32>::get() , 0, 0}, \
- { UNO_NAME_LINECOLOR_THEME_REFERENCE, XATTR_LINECOLOR, ::cppu::UnoType<css::util::XThemeColor>::get() , 0, MID_COLOR_THEME_REFERENCE}, \
+ { UNO_NAME_LINE_COMPLEX_COLOR, XATTR_LINECOLOR, ::cppu::UnoType<css::util::XComplexColor>::get() , 0, MID_COMPLEX_COLOR}, \
{ UNO_NAME_LINEENDCENTER, XATTR_LINEENDCENTER, cppu::UnoType<bool>::get() , 0, 0}, \
{ UNO_NAME_LINEENDWIDTH, XATTR_LINEENDWIDTH, ::cppu::UnoType<sal_Int32>::get() , 0, 0, PropertyMoreFlags::METRIC_ITEM}, \
{ UNO_NAME_LINEJOINT, XATTR_LINEJOINT, ::cppu::UnoType<css::drawing::LineJoint>::get(), 0, 0}, \
@@ -294,7 +294,7 @@
{ UNO_NAME_FILLCOLOR_THEME, XATTR_FILLCOLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_THEME_INDEX}, \
{ UNO_NAME_FILLCOLOR_LUM_MOD, XATTR_FILLCOLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_LUM_MOD}, \
{ UNO_NAME_FILLCOLOR_LUM_OFF, XATTR_FILLCOLOR, ::cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_LUM_OFF}, \
- { UNO_NAME_FILLCOLOR_THEME_REFERENCE, XATTR_FILLCOLOR, ::cppu::UnoType<css::util::XThemeColor>::get(), 0, MID_COLOR_THEME_REFERENCE}, \
+ { UNO_NAME_FILL_COMPLEX_COLOR, XATTR_FILLCOLOR, ::cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_COMPLEX_COLOR}, \
{ UNO_NAME_GRAPHIC_GRAPHICCROP, SDRATTR_GRAFCROP , ::cppu::UnoType<css::text::GraphicCrop>::get(), 0, 0 }, \
{ UNO_NAME_FILLUSESLIDEBACKGROUND, XATTR_FILLUSESLIDEBACKGROUND, cppu::UnoType<bool>::get(), 0, 0},
diff --git a/include/svx/xcolit.hxx b/include/svx/xcolit.hxx
index 3ece0ef3b52b..965d10195146 100644
--- a/include/svx/xcolit.hxx
+++ b/include/svx/xcolit.hxx
@@ -22,7 +22,7 @@
#include <tools/color.hxx>
#include <editeng/colritem.hxx>
-#include <docmodel/theme/ThemeColor.hxx>
+#include <docmodel/color/ComplexColor.hxx>
#include <svx/svxdllapi.h>
#include <svx/xit.hxx>
@@ -32,7 +32,7 @@ class XColorList;
class SVXCORE_DLLPUBLIC XColorItem : public NameOrIndex
{
Color aColor;
- model::ThemeColor maThemeColor;
+ model::ComplexColor maComplexColor;
public:
static SfxPoolItem* CreateDefault();
@@ -50,8 +50,9 @@ public:
const Color& GetColorValue() const;
void SetColorValue(const Color& rNew) { aColor = rNew; Detach(); }
- model::ThemeColor& GetThemeColor() { return maThemeColor; }
- const model::ThemeColor& GetThemeColor() const { return maThemeColor; }
+ void setComplexColor(model::ComplexColor const& rComplexColor) { maComplexColor = rComplexColor; }
+ const model::ComplexColor& getComplexColor() const { return maComplexColor; }
+ model::ComplexColor& getComplexColor() { return maComplexColor; }
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override;
};
diff --git a/include/xmloff/txtprmap.hxx b/include/xmloff/txtprmap.hxx
index 986bbd007d8a..53b2a36edfa0 100644
--- a/include/xmloff/txtprmap.hxx
+++ b/include/xmloff/txtprmap.hxx
@@ -202,7 +202,7 @@
#define CTF_FILLSTYLE (XML_TEXT_CTF_START + 173)
#define CTF_FILLCOLOR (XML_TEXT_CTF_START + 174)
#define CTF_PAGENUMBEROFFSET (XML_TEXT_CTF_START + 175)
-#define CTF_THEME_COLOR (XML_TEXT_CTF_START + 176)
+#define CTF_COMPLEX_COLOR (XML_TEXT_CTF_START + 176)
enum class TextPropMap {
TEXT = 0,
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 7f4f21c15dfc..ad512edb86dc 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -3489,8 +3489,8 @@ namespace xmloff::token {
XML_LINKED_STYLE_NAME,
XML_THEME,
- XML_CHAR_COLOR_THEME_REFERENCE,
- XML_FILL_COLOR_THEME_REFERENCE,
+ XML_CHAR_COMPLEX_COLOR,
+ XML_FILL_COMPLEX_COLOR,
XML_DK1,
XML_LT1,
XML_DK2,
diff --git a/include/xmloff/xmltypes.hxx b/include/xmloff/xmltypes.hxx
index 4dbf2081db1b..8c9b001b061d 100644
--- a/include/xmloff/xmltypes.hxx
+++ b/include/xmloff/xmltypes.hxx
@@ -295,7 +295,7 @@
#define XML_TYPE_GRAPHIC (XML_TEXT_TYPES_START + 127)
#define XML_SW_TYPE_PRESPAGE_BACKSIZE (XML_TEXT_TYPES_START + 128)
#define XML_SW_TYPE_RTLGUTTER (XML_TEXT_TYPES_START + 129)
-#define XML_TYPE_THEME_COLOR (XML_TEXT_TYPES_START + 130)
+#define XML_TYPE_COMPLEX_COLOR (XML_TEXT_TYPES_START + 130)
#endif // INCLUDED_XMLOFF_XMLTYPES_HXX
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 51eed6e3e4cd..7ee71bb984c1 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -4176,7 +4176,6 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/util,\
XCloseable \
XComplexColor \
XTheme \
- XThemeColor \
XDataEditor \
XDataEditorListener \
XFlushListener \
diff --git a/offapi/com/sun/star/util/XThemeColor.idl b/offapi/com/sun/star/util/XThemeColor.idl
deleted file mode 100644
index 7da38c4850a2..000000000000
--- a/offapi/com/sun/star/util/XThemeColor.idl
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-
-module com { module sun { module star { module util {
-
-
-/** Theme Color interface
-
- @since LibreOffice 7.6
-*/
-interface XThemeColor
-{
- /** Type of the theme color */
- short getType();
-};
-
-}; }; }; };
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/drawingml/fontworkhelpers.hxx b/oox/inc/drawingml/fontworkhelpers.hxx
index b7d4c5594854..9a550b00904c 100644
--- a/oox/inc/drawingml/fontworkhelpers.hxx
+++ b/oox/inc/drawingml/fontworkhelpers.hxx
@@ -19,7 +19,7 @@
#pragma once
-#include <docmodel/theme/ThemeColor.hxx>
+#include <docmodel/color/ComplexColor.hxx>
#include <rtl/ustring.hxx>
#include <sal/types.h>
#include <svx/msdffdef.hxx>
@@ -53,7 +53,7 @@ void putCustomShapeIntoTextPathMode(
OString GetVMLFontworkShapetypeMarkup(const MSO_SPT eShapeType);
/** Collects the properties "CharColor", "CharLumMod", "CharLumOff", "CharColorTheme",
- "CharColorThemeReference" and "CharTransparence" from the first non-empty run in rXText and puts
+ "CharComplexColor" and "CharTransparence" from the first non-empty run in rXText and puts
them into rCharPropVec.*/
void collectCharColorProps(const css::uno::Reference<css::text::XText>& rXText,
std::vector<css::beans::PropertyValue>& rCharPropVec);
@@ -64,8 +64,8 @@ void applyPropsToRuns(const std::vector<css::beans::PropertyValue>& rTextPropVec
css::uno::Reference<css::text::XText>& rXText);
/** Generates the properties "CharColor", "CharLumMod", "CharLumOff", "CharColorTheme",
- "CharColorThemeReference" and "CharTransparence" from the shape properties "FillColor",
- "FillColorLumMod, "FillColorLumOff", "FillColorTheme", "FillColorThemeReference" and
+ "CharComplexColor" and "CharTransparence" from the shape properties "FillColor",
+ "FillColorLumMod, "FillColorLumOff", "FillColorTheme", "FillComplexColor" and
"FillTransparence" and puts them into rCharPropVec.*/
void createCharFillPropsFromShape(const css::uno::Reference<css::beans::XPropertySet>& rXPropSet,
std::vector<css::beans::PropertyValue>& rCharPropVec);
@@ -92,11 +92,11 @@ bool createPrstDashFromLineDash(const css::drawing::LineDash& rLineDash,
const css::drawing::LineCap& rLineCap, OUString& rsPrstDash);
/** Returns true if a theme color with other type than model::ThemeColorType::Unknown was found.
- The theme color is then in aThemeColor.
- Returns false otherwise. aThemeColor is then unchanged or its type is
+ The theme color is then in rComplexColor.
+ Returns false otherwise. rComplexColor is then unchanged or its type is
model::ThemeColorType::Unknown */
bool getThemeColorFromShape(const OUString& rPropertyName,
const css::uno::Reference<css::beans::XPropertySet>& xPropertySet,
- model::ThemeColor& aThemeColor);
+ model::ComplexColor& rComplexColor);
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx
index 14e9321562ee..10dc88e4954d 100644
--- a/oox/qa/unit/drawingml.cxx
+++ b/oox/qa/unit/drawingml.cxx
@@ -30,7 +30,7 @@
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/util/XTheme.hpp>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <docmodel/uno/UnoTheme.hxx>
#include <docmodel/theme/Theme.hxx>
@@ -416,18 +416,17 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testPptxTheme)
// Check the theme colors are as expected
{
- uno::Reference<util::XThemeColor> xThemeColor;
- CPPUNIT_ASSERT(xPortion->getPropertyValue("CharColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xPortion->getPropertyValue("CharComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod,
- aThemeColor.getTransformations()[0].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aThemeColor.getTransformations()[0].mnValue);
+ aComplexColor.getTransformations()[0].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aComplexColor.getTransformations()[0].mnValue);
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff,
- aThemeColor.getTransformations()[1].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aThemeColor.getTransformations()[1].mnValue);
+ aComplexColor.getTransformations()[1].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aComplexColor.getTransformations()[1].mnValue);
}
}
@@ -472,28 +471,26 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColorTint_Table)
// check theme color
{
- uno::Reference<util::XThemeColor> xThemeColor;
- CPPUNIT_ASSERT(xA1->getPropertyValue("FillColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xA1->getPropertyValue("FillComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
{
- auto const& rTrans = aThemeColor.getTransformations();
+ auto const& rTrans = aComplexColor.getTransformations();
CPPUNIT_ASSERT_EQUAL(size_t(0), rTrans.size());
}
}
{
- uno::Reference<util::XThemeColor> xThemeColor;
uno::Reference<beans::XPropertySet> xA2(xTable->getCellByPosition(0, 1), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xA2->getPropertyValue("FillColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xA2->getPropertyValue("FillComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
{
- auto const& rTrans = aThemeColor.getTransformations();
+ auto const& rTrans = aComplexColor.getTransformations();
CPPUNIT_ASSERT_EQUAL(size_t(1), rTrans.size());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::Tint, rTrans[0].meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans[0].mnValue);
@@ -514,16 +511,15 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColor_Shape)
// check line and fill theme color of shape1
{
- model::ThemeColor aThemeColor;
- uno::Reference<util::XThemeColor> xThemeColor;
uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
-
- CPPUNIT_ASSERT(xShape->getPropertyValue("FillColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent6, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xShape->getPropertyValue("FillComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
{
- auto const& rTrans = aThemeColor.getTransformations();
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent6, aComplexColor.getSchemeType());
+
+ auto const& rTrans = aComplexColor.getTransformations();
CPPUNIT_ASSERT_EQUAL(size_t(2), rTrans.size());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans[0].meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans[0].mnValue);
@@ -531,12 +527,13 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColor_Shape)
CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans[1].mnValue);
}
- CPPUNIT_ASSERT(xShape->getPropertyValue("LineColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent6, aThemeColor.getType());
+ CPPUNIT_ASSERT(xShape->getPropertyValue("LineComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
{
- auto const& rTrans = aThemeColor.getTransformations();
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent6, aComplexColor.getSchemeType());
+
+ auto const& rTrans = aComplexColor.getTransformations();
CPPUNIT_ASSERT_EQUAL(size_t(1), rTrans.size());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans[0].meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(5000), rTrans[0].mnValue);
@@ -544,25 +541,25 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testThemeColor_Shape)
}
// check line and fill theme color of shape2
{
- model::ThemeColor aThemeColor;
- uno::Reference<util::XThemeColor> xThemeColor;
+ uno::Reference<util::XComplexColor> xComplexColor;
uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(1), uno::UNO_QUERY);
-
- CPPUNIT_ASSERT(xShape->getPropertyValue("FillColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ CPPUNIT_ASSERT(xShape->getPropertyValue("FillComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
{
- auto const& rTrans = aThemeColor.getTransformations();
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
+
+ auto const& rTrans = aComplexColor.getTransformations();
CPPUNIT_ASSERT_EQUAL(size_t(0), rTrans.size());
}
- CPPUNIT_ASSERT(xShape->getPropertyValue("LineColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ CPPUNIT_ASSERT(xShape->getPropertyValue("LineComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
{
- auto const& rTrans = aThemeColor.getTransformations();
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
+
+ auto const& rTrans = aComplexColor.getTransformations();
CPPUNIT_ASSERT_EQUAL(size_t(1), rTrans.size());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans[0].meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(7500), rTrans[0].mnValue);
diff --git a/oox/qa/unit/shape.cxx b/oox/qa/unit/shape.cxx
index e8d4f188b8d3..ad43fb52b4a1 100644
--- a/oox/qa/unit/shape.cxx
+++ b/oox/qa/unit/shape.cxx
@@ -36,7 +36,7 @@
#include <rtl/math.hxx>
#include <svx/svdoashp.hxx>
#include <tools/color.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <basegfx/utils/gradienttools.hxx>
using namespace ::com::sun::star;
@@ -313,15 +313,14 @@ CPPUNIT_TEST_FIXTURE(OoxShapeTest, testTdf54095_SmartArtThemeTextColor)
// - Actual : 16777215 (0xFFFFFF), that is text was white
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x1F497D), nActualColor);
- // clrScheme. For map between name in docx and index from CharColorThemeReference see
+ // clrScheme. For map between name in docx and index from CharComplexColor see
// oox::drawingml::Color::getSchemeColorIndex()
// Without fix the color scheme was "lt1" (1) but should be "dk2" (2).
- uno::Reference<util::XThemeColor> xThemeColor;
- CPPUNIT_ASSERT(xPortion->getPropertyValue("CharColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Dark2, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xPortion->getPropertyValue("CharComplexColor") >>= xComplexColor;
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Dark2, aComplexColor.getSchemeType());
if (!bUseGroup)
{
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 2896ae14fe18..e6cded7e64c7 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -26,7 +26,7 @@
#include <vcl/graph.hxx>
#include <vcl/BitmapFilter.hxx>
#include <vcl/BitmapMonochromeFilter.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <basegfx/utils/gradienttools.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -427,27 +427,27 @@ void FillProperties::pushToPropMap(ShapePropertyMap& rPropMap, const GraphicHelp
if( maFillColor.hasTransparency() )
rPropMap.setProperty( ShapeProperty::FillTransparency, maFillColor.getTransparency() );
- model::ThemeColor aThemeColor;
+ model::ComplexColor aComplexColor;
if (aFillColor == nPhClr)
{
- aThemeColor.setType(model::convertToThemeColorType(nPhClrTheme));
- rPropMap.setProperty(PROP_FillColorThemeReference, model::theme::createXThemeColor(aThemeColor));
+ aComplexColor.setSchemeColor(model::convertToThemeColorType(nPhClrTheme));
+ rPropMap.setProperty(PROP_FillComplexColor, model::color::createXComplexColor(aComplexColor));
}
else
{
- aThemeColor.setType(model::convertToThemeColorType(maFillColor.getSchemeColorIndex()));
+ aComplexColor.setSchemeColor(model::convertToThemeColorType(maFillColor.getSchemeColorIndex()));
if (maFillColor.getLumMod() != 10000)
- aThemeColor.addTransformation({model::TransformationType::LumMod, maFillColor.getLumMod()});
+ aComplexColor.addTransformation({model::TransformationType::LumMod, maFillColor.getLumMod()});
if (maFillColor.getLumOff() != 0)
- aThemeColor.addTransformation({model::TransformationType::LumOff, maFillColor.getLumOff()});
+ aComplexColor.addTransformation({model::TransformationType::LumOff, maFillColor.getLumOff()});
if (maFillColor.getTintOrShade() > 0)
- aThemeColor.addTransformation({model::TransformationType::Tint, maFillColor.getTintOrShade()});
+ aComplexColor.addTransformation({model::TransformationType::Tint, maFillColor.getTintOrShade()});
if (maFillColor.getTintOrShade() < 0)
{
sal_Int16 nShade = o3tl::narrowing<sal_Int16>(-maFillColor.getTintOrShade());
- aThemeColor.addTransformation({model::TransformationType::Shade, nShade});
+ aComplexColor.addTransformation({model::TransformationType::Shade, nShade});
}
- rPropMap.setProperty(PROP_FillColorThemeReference, model::theme::createXThemeColor(aThemeColor));
+ rPropMap.setProperty(PROP_FillComplexColor, model::color::createXComplexColor(aComplexColor));
}
eFillStyle = FillStyle_SOLID;
diff --git a/oox/source/drawingml/fontworkhelpers.cxx b/oox/source/drawingml/fontworkhelpers.cxx
index 547c9382d0a9..3c8d28d634c6 100644
--- a/oox/source/drawingml/fontworkhelpers.cxx
+++ b/oox/source/drawingml/fontworkhelpers.cxx
@@ -23,7 +23,7 @@
#include <comphelper/propertyvalue.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/sequenceashashmap.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <drawingml/customshapeproperties.hxx>
#include <drawingml/presetgeometrynames.hxx>
#include <oox/drawingml/drawingmltypes.hxx>
@@ -51,7 +51,7 @@
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/text/XTextRange.hpp>
-#include <com/sun/star/util/XThemeColor.hpp>
+#include <com/sun/star/util/XComplexColor.hpp>
#include <array>
#include <map>
@@ -849,12 +849,9 @@ void FontworkHelpers::collectCharColorProps(const uno::Reference<text::XText>& r
continue;
// We have found a non-empty run. Collect its simple color properties.
- const std::array<OUString, 6> aNamesArray = { u"CharColor",
- u"CharLumMod",
- u"CharLumOff",
- u"CharColorTheme",
- u"CharColorThemeReference",
- u"CharTransparence" };
+ const std::array<OUString, 6> aNamesArray
+ = { u"CharColor", u"CharLumMod", u"CharLumOff",
+ u"CharColorTheme", u"CharComplexColor", u"CharTransparence" };
for (const auto& propName : aNamesArray)
{
if (xRunPropSetInfo->hasPropertyByName(propName))
@@ -934,10 +931,10 @@ void FontworkHelpers::createCharFillPropsFromShape(
}
const std::array<OUString, 5> aCharPropNames
- = { u"CharColorLumMod", u"CharColorLumOff", u"CharColorTheme", u"CharColorThemeReference",
+ = { u"CharColorLumMod", u"CharColorLumOff", u"CharColorTheme", u"CharComplexColor",
u"CharTransparence" };
const std::array<OUString, 5> aShapePropNames
- = { u"FillColorLumMod", u"FillColorLumOff", u"FillColorTheme", u"FillColorThemeReference",
+ = { u"FillColorLumMod", u"FillColorLumOff", u"FillColorTheme", u"FillComplexColor",
u"FillTransparence" };
for (size_t i = 0; i < 5; i++)
{
@@ -1004,17 +1001,17 @@ bool FontworkHelpers::createPrstDashFromLineDash(const drawing::LineDash& rLineD
bool FontworkHelpers::getThemeColorFromShape(
OUString const& rPropertyName, const uno::Reference<beans::XPropertySet>& xPropertySet,
- model::ThemeColor& aThemeColor)
+ model::ComplexColor& rComplexColor)
{
auto xPropSetInfo = xPropertySet->getPropertySetInfo();
if (!xPropSetInfo.is())
return false;
- uno::Reference<util::XThemeColor> xThemeColor;
+ uno::Reference<util::XComplexColor> xComplexColor;
if (xPropSetInfo->hasPropertyByName(rPropertyName)
- && (xPropertySet->getPropertyValue(rPropertyName) >>= xThemeColor) && xThemeColor.is())
+ && (xPropertySet->getPropertyValue(rPropertyName) >>= xComplexColor) && xComplexColor.is())
{
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- if (aThemeColor.getType() == model::ThemeColorType::Unknown)
+ rComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ if (rComplexColor.getSchemeType() == model::ThemeColorType::Unknown)
return false;
else
return true;
@@ -1030,7 +1027,7 @@ struct GradientStopColor
// RGBColor contains no transformations. In case TTColor has other type than
// ThemeColorType::Unknown, it has precedence. The color transformations in TTColor are used
// for RGBColor as well.
- model::ThemeColor TTColor; // ThemeColorType and color transformations
+ model::ComplexColor TTColor; // ThemeColorType and color transformations
::Color RGBColor;
};
}
@@ -1043,36 +1040,36 @@ typedef std::multimap<sal_Int32, GradientStopColor> ColorMapType;
namespace
{
// Returns the string to be used in w14:schemeClr in case of w14:textOutline or w14:textFill
-OUString lcl_getW14MarkupStringForThemeColor(const model::ThemeColor& rThemeColor)
+OUString lcl_getW14MarkupStringForThemeColor(const model::ComplexColor& rComplexColor)
{
const std::array<OUString, 12> W14ColorNames
= { u"tx1", u"bg1", u"tx2", u"bg2", u"accent1", u"accent2",
u"accent3", u"accent4", u"accent5", u"accent6", u"hlink", u"folHlink" };
const sal_uInt8 nClrNameIndex = std::clamp<sal_uInt8>(
- sal_Int32(rThemeColor.getType()), sal_Int32(model::ThemeColorType::Dark1),
+ sal_Int32(rComplexColor.getSchemeType()), sal_Int32(model::ThemeColorType::Dark1),
sal_Int32(model::ThemeColorType::FollowedHyperlink));
return W14ColorNames[nClrNameIndex];
}
// Returns the string to be used in w:themeColor. It is exported via CharThemeColor.
-OUString lcl_getWMarkupStringForThemeColor(const model::ThemeColor& rThemeColor)
+OUString lcl_getWMarkupStringForThemeColor(const model::ComplexColor& rComplexColor)
{
const std::array<OUString, 12> WColorNames
= { u"text1", u"background1", u"text2", u"background2",
u"accent1", u"accent2", u"accent3", u"accent4",
u"accent5", u"accent6", u"hyperlink", u"followedHyperlink" };
const sal_uInt8 nClrNameIndex = std::clamp<sal_uInt8>(
- sal_Int32(rThemeColor.getType()), sal_Int32(model::ThemeColorType::Dark1),
+ sal_Int32(rComplexColor.getSchemeType()), sal_Int32(model::ThemeColorType::Dark1),
sal_Int32(model::ThemeColorType::FollowedHyperlink));
return WColorNames[nClrNameIndex];
}
-// Puts the value of the first occurrence of rType in rThemeColor into rValue and returns true.
+// Puts the value of the first occurrence of rType in rComplexColor into rValue and returns true.
// If such does not exist, rValue is unchanged and the method returns false.
-bool lcl_getThemeColorTransformationValue(const model::ThemeColor& rThemeColor,
+bool lcl_getThemeColorTransformationValue(const model::ComplexColor& rComplexColor,
const model::TransformationType& rType, sal_Int16& rValue)
{
- const std::vector<model::Transformation> aTransVec(rThemeColor.getTransformations());
+ const std::vector<model::Transformation> aTransVec(rComplexColor.getTransformations());
auto bItemFound
= [rType](const model::Transformation& rTrans) { return rType == rTrans.meType; };
auto pIt = std::find_if(aTransVec.begin(), aTransVec.end(), bItemFound);
@@ -1083,14 +1080,14 @@ bool lcl_getThemeColorTransformationValue(const model::ThemeColor& rThemeColor,
}
// Adds the child elements 'lumMod' and 'lumOff' to 'schemeClr' maCurrentElement of pGrabStack,
-// if such exist in rThemeColor. 'alpha' is contained in the maTransformations of rThemeColor
+// if such exist in rComplexColor. 'alpha' is contained in the maTransformations of rComplexColor
// in case of gradient fill.
-void lcl_addColorTransformationToGrabBagStack(const model::ThemeColor& rThemeColor,
+void lcl_addColorTransformationToGrabBagStack(const model::ComplexColor& rComplexColor,
std::unique_ptr<oox::GrabBagStack>& pGrabBagStack)
{
if (pGrabBagStack == nullptr)
return;
- for (auto const& rColorTransform : rThemeColor.getTransformations())
+ for (auto const& rColorTransform : rComplexColor.getTransformations())
{
switch (rColorTransform.meType)
{
@@ -1215,7 +1212,6 @@ sal_Int16 lcl_getAlphaFromTransparenceGradient(const awt::Gradient& rTransparenc
/ (100.0 - nBorder) * 100 / 255.0);
}
-// GradientStopColor has components ::Color RGBColor and model::ThemeColor TTColor
GradientStopColor
lcl_createGradientStopColor(const uno::Reference<beans::XPropertySet>& rXPropSet,
const uno::Reference<beans::XPropertySetInfo>& rXPropSetInfo,
@@ -1235,7 +1231,6 @@ lcl_createGradientStopColor(const uno::Reference<beans::XPropertySet>& rXPropSet
{
// a color gradient is yet not enabled to use theme colors
aStopColor.RGBColor = lcl_getColorFromColorGradient(rColorGradient, rnPos);
- aStopColor.TTColor.setType(model::ThemeColorType::Unknown);
sal_Int16 nIntensity = lcl_getIntensityFromColorGradient(rColorGradient, rnPos);
if (nIntensity != 100)
aStopColor.TTColor.addTransformation(
@@ -1246,7 +1241,7 @@ lcl_createGradientStopColor(const uno::Reference<beans::XPropertySet>& rXPropSet
else // solid color
{
// fill color might be a theme color
- if (!(FontworkHelpers::getThemeColorFromShape("FillColorThemeReference", rXPropSet,
+ if (!(FontworkHelpers::getThemeColorFromShape("FillComplexColor", rXPropSet,
aStopColor.TTColor)))
{
// no theme color, use FillColor
@@ -1254,7 +1249,7 @@ lcl_createGradientStopColor(const uno::Reference<beans::XPropertySet>& rXPropSet
if (rXPropSetInfo->hasPropertyByName("FillColor"))
rXPropSet->getPropertyValue(u"FillColor") >>= nFillColor;
aStopColor.RGBColor = ::Color(ColorTransparency, nFillColor);
- aStopColor.TTColor.setType(model::ThemeColorType::Unknown);
+ aStopColor.TTColor = model::ComplexColor();
}
}
@@ -1280,7 +1275,7 @@ lcl_createGradientStopColor(const uno::Reference<beans::XPropertySet>& rXPropSet
{
// a color gradient is yet not enabled to use theme colors
aStopColor.RGBColor = lcl_getColorFromColorGradient(rColorGradient, rnPos);
- aStopColor.TTColor.setType(model::ThemeColorType::Unknown);
+ aStopColor.TTColor = model::ComplexColor();
sal_Int16 nIntensity = lcl_getIntensityFromColorGradient(rColorGradient, rnPos);
if (nIntensity != 100)
aStopColor.TTColor.addTransformation(
@@ -1292,7 +1287,7 @@ lcl_createGradientStopColor(const uno::Reference<beans::XPropertySet>& rXPropSet
{
// solid color and solid transparency
SAL_WARN("oox.drawingml", "method should not be called in this case");
- if (!(FontworkHelpers::getThemeColorFromShape("FillColorThemeReference", rXPropSet,
+ if (!(FontworkHelpers::getThemeColorFromShape("FillComplexColor", rXPropSet,
aStopColor.TTColor)))
{
// no theme color, use FillColor
@@ -1300,7 +1295,7 @@ lcl_createGradientStopColor(const uno::Reference<beans::XPropertySet>& rXPropSet
if (rXPropSetInfo->hasPropertyByName(u"FillColor"))
rXPropSet->getPropertyValue(u"FillColor") >>= nFillColor;
aStopColor.RGBColor = ::Color(ColorTransparency, nFillColor);
- aStopColor.TTColor.setType(model::ThemeColorType::Unknown);
+ aStopColor.TTColor = model::ComplexColor();
}
}
@@ -1462,7 +1457,7 @@ void FontworkHelpers::createCharInteropGrabBagUpdatesFromShapeProps(
pGrabBagStack->push("attributes");
pGrabBagStack->addInt32("pos", (*it).first);
pGrabBagStack->pop();
- if ((*it).second.TTColor.getType() == model::ThemeColorType::Unknown)
+ if ((*it).second.TTColor.getSchemeType() == model::ThemeColorType::Unknown)
{
pGrabBagStack->push("srgbClr");
pGrabBagStack->push("attributes");
@@ -1542,16 +1537,16 @@ void FontworkHelpers::createCharInteropGrabBagUpdatesFromShapeProps(
case drawing::FillStyle_SOLID:
{
pGrabBagStack->push("solidFill");
- model::ThemeColor aThemeColor;
+ model::ComplexColor aComplexColor;
// It is either "schemeClr" or "srgbClr".
- if (FontworkHelpers::getThemeColorFromShape("FillColorThemeReference", rXPropSet,
- aThemeColor))
+ if (FontworkHelpers::getThemeColorFromShape("FillComplexColor", rXPropSet,
+ aComplexColor))
{
pGrabBagStack->push("schemeClr");
pGrabBagStack->push("attributes");
- pGrabBagStack->addString("val", lcl_getW14MarkupStringForThemeColor(aThemeColor));
+ pGrabBagStack->addString("val", lcl_getW14MarkupStringForThemeColor(aComplexColor));
pGrabBagStack->pop(); // maCurrentElement:'schemeClr', maPropertyList:'attributes'
- lcl_addColorTransformationToGrabBagStack(aThemeColor, pGrabBagStack);
+ lcl_addColorTransformationToGrabBagStack(aComplexColor, pGrabBagStack);
// maCurrentElement:'schemeClr', maPropertyList:'attributes', maybe 'lumMod' and
// maybe 'lumOff'
}
@@ -1630,15 +1625,14 @@ void FontworkHelpers::createCharInteropGrabBagUpdatesFromShapeProps(
{
pGrabBagStack->push("solidFill");
// It is either "schemeClr" or "srgbClr".
- model::ThemeColor aThemeColor;
- if (FontworkHelpers::getThemeColorFromShape("LineColorThemeReference", rXPropSet,
- aThemeColor))
+ model::ComplexColor aComplexColor;
+ if (FontworkHelpers::getThemeColorFromShape("LineComplexColor", rXPropSet, aComplexColor))
{
pGrabBagStack->push("schemeClr");
pGrabBagStack->push("attributes");
- pGrabBagStack->addString("val", lcl_getW14MarkupStringForThemeColor(aThemeColor));
+ pGrabBagStack->addString("val", lcl_getW14MarkupStringForThemeColor(aComplexColor));
pGrabBagStack->pop();
- lcl_addColorTransformationToGrabBagStack(aThemeColor, pGrabBagStack);
+ lcl_addColorTransformationToGrabBagStack(aComplexColor, pGrabBagStack);
// maCurrentElement:'schemeClr', maPropertylist:'attributes'
}
else // not a theme color
@@ -1725,13 +1719,13 @@ void FontworkHelpers::createCharInteropGrabBagUpdatesFromShapeProps(
// CharThemeOriginalColor, CharThemeColor, and CharThemeColorShade or CharThemeColorTint will be
// used for <w:color> element. That is evaluated by applications, which do not understand w14
// namespace, or if w14:textFill is omitted.
- model::ThemeColor aThemeColor;
- if (FontworkHelpers::getThemeColorFromShape("FillColorThemeReference", rXPropSet, aThemeColor))
+ model::ComplexColor aComplexColor;
+ if (FontworkHelpers::getThemeColorFromShape("FillComplexColor", rXPropSet, aComplexColor))
{
// CharThemeColor
beans::PropertyValue aCharThemeColor;
aCharThemeColor.Name = u"CharThemeColor";
- aCharThemeColor.Value <<= lcl_getWMarkupStringForThemeColor(aThemeColor);
+ aCharThemeColor.Value <<= lcl_getWMarkupStringForThemeColor(aComplexColor);
rUpdatePropVec.push_back(aCharThemeColor);
// CharThemeColorShade or CharThemeColorTint
@@ -1740,12 +1734,12 @@ void FontworkHelpers::createCharInteropGrabBagUpdatesFromShapeProps(
// We made two assumption here: (1) If LumOff exists and is not zero, it is a 'tint'.
// (2) LumMod + LumOff == 10000;
sal_Int16 nLumMod;
- if (lcl_getThemeColorTransformationValue(aThemeColor, model::TransformationType::LumMod,
+ if (lcl_getThemeColorTransformationValue(aComplexColor, model::TransformationType::LumMod,
nLumMod))
{
sal_Int16 nLumOff;
bool bIsTint = lcl_getThemeColorTransformationValue(
- aThemeColor, model::TransformationType::LumOff, nLumOff)
+ aComplexColor, model::TransformationType::LumOff, nLumOff)
&& nLumOff != 0;
sal_uInt8 nValue
= std::clamp<sal_uInt8>(lround(double(nLumMod) * 255.0 / 10000.0), 0, 255);
@@ -1758,7 +1752,7 @@ void FontworkHelpers::createCharInteropGrabBagUpdatesFromShapeProps(
}
}
// ToDo: Are FillColorLumMod, FillColorLumOff and FillColorTheme possible without
- // FillColorThemeReference? If yes, we need an 'else' part here.
+ // FillComplexColor? If yes, we need an 'else' part here.
// CharThemeOriginalColor.
beans::PropertyValue aCharThemeOriginalColor;
diff --git a/oox/source/drawingml/lineproperties.cxx b/oox/source/drawingml/lineproperties.cxx
index 898b5b702161..1372a6b96016 100644
--- a/oox/source/drawingml/lineproperties.cxx
+++ b/oox/source/drawingml/lineproperties.cxx
@@ -34,8 +34,7 @@
#include <oox/helper/graphichelper.hxx>
#include <oox/token/tokens.hxx>
#include <oox/token/properties.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
-
+#include <docmodel/uno/UnoComplexColor.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
@@ -501,28 +500,28 @@ void LineProperties::pushToPropMap( ShapePropertyMap& rPropMap,
if( aLineColor.hasTransparency() )
rPropMap.setProperty( ShapeProperty::LineTransparency, aLineColor.getTransparency() );
- model::ThemeColor aThemeColor;
+ model::ComplexColor aComplexColor;
if (aColor == nPhClr)
{
- aThemeColor.setType(model::convertToThemeColorType(nPhClrTheme));
- rPropMap.setProperty(PROP_LineColorThemeReference, model::theme::createXThemeColor(aThemeColor));
+ aComplexColor.setSchemeColor(model::convertToThemeColorType(nPhClrTheme));
+ rPropMap.setProperty(PROP_LineComplexColor, model::color::createXComplexColor(aComplexColor));
}
else
{
- aThemeColor.setType(model::convertToThemeColorType(aLineColor.getSchemeColorIndex()));
+ aComplexColor.setSchemeColor(model::convertToThemeColorType(aLineColor.getSchemeColorIndex()));
if (aLineColor.getLumMod() != 10000)
- aThemeColor.addTransformation({model::TransformationType::LumMod, aLineColor.getLumMod()});
+ aComplexColor.addTransformation({model::TransformationType::LumMod, aLineColor.getLumMod()});
if (aLineColor.getLumOff() != 0)
- aThemeColor.addTransformation({model::TransformationType::LumOff, aLineColor.getLumOff()});
+ aComplexColor.addTransformation({model::TransformationType::LumOff, aLineColor.getLumOff()});
if (aLineColor.getTintOrShade() > 0)
- aThemeColor.addTransformation({model::TransformationType::Tint, aLineColor.getTintOrShade()});
+ aComplexColor.addTransformation({model::TransformationType::Tint, aLineColor.getTintOrShade()});
if (aLineColor.getTintOrShade() < 0)
{
sal_Int16 nShade = o3tl::narrowing<sal_Int16>(-aLineColor.getTintOrShade());
- aThemeColor.addTransformation({model::TransformationType::Shade, nShade});
+ aComplexColor.addTransformation({model::TransformationType::Shade, nShade});
}
- rPropMap.setProperty(PROP_LineColorThemeReference, model::theme::createXThemeColor(aThemeColor));
+ rPropMap.setProperty(PROP_LineComplexColor, model::color::createXComplexColor(aComplexColor));
}
}
diff --git a/oox/source/drawingml/textcharacterproperties.cxx b/oox/source/drawingml/textcharacterproperties.cxx
index a22606ef106c..7d3dda284680 100644
--- a/oox/source/drawingml/textcharacterproperties.cxx
+++ b/oox/source/drawingml/textcharacterproperties.cxx
@@ -26,7 +26,7 @@
#include <i18nlangtag/languagetag.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <editeng/escapementitem.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <oox/helper/helper.hxx>
#include <oox/helper/propertyset.hxx>
#include <oox/core/xmlfilterbase.hxx>
@@ -136,21 +136,21 @@ void TextCharacterProperties::pushToPropMap( PropertyMap& rPropMap, const XmlFil
rPropMap.setProperty(PROP_CharColor, aColor.getColor(rFilter.getGraphicHelper()));
// set theme color
- model::ThemeColor aThemeColor;
- aThemeColor.setType(model::convertToThemeColorType(aColor.getSchemeColorIndex()));
+ model::ComplexColor aComplexColor;
+ aComplexColor.setSchemeColor(model::convertToThemeColorType(aColor.getSchemeColorIndex()));
if (aColor.getTintOrShade() > 0)
- aThemeColor.addTransformation({model::TransformationType::Tint, aColor.getTintOrShade()});
+ aComplexColor.addTransformation({model::TransformationType::Tint, aColor.getTintOrShade()});
if (aColor.getTintOrShade() < 0)
{
sal_Int16 nShade = o3tl::narrowing<sal_Int16>(-aColor.getTintOrShade());
- aThemeColor.addTransformation({model::TransformationType::Shade, nShade});
+ aComplexColor.addTransformation({model::TransformationType::Shade, nShade});
}
if (aColor.getLumMod() != 10000)
- aThemeColor.addTransformation({model::TransformationType::LumMod, aColor.getLumMod()});
+ aComplexColor.addTransformation({model::TransformationType::LumMod, aColor.getLumMod()});
if (aColor.getLumOff() != 0)
- aThemeColor.addTransformation({model::TransformationType::LumOff, aColor.getLumOff()});
+ aComplexColor.addTransformation({model::TransformationType::LumOff, aColor.getLumOff()});
- rPropMap.setProperty(PROP_CharColorThemeReference, model::theme::createXThemeColor(aThemeColor));
+ rPropMap.setProperty(PROP_CharComplexColor, model::color::createXComplexColor(aComplexColor));
rPropMap.setProperty(PROP_CharContoured, bContoured);
if (aColor.hasTransparency())
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 9f705a20cf9e..fa587d6190bf 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -128,7 +128,7 @@
#include <editeng/flditem.hxx>
#include <editeng/escapementitem.hxx>
#include <editeng/unonrule.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <svx/svdoashp.hxx>
#include <svx/svdomedia.hxx>
#include <svx/svdtrans.hxx>
@@ -516,7 +516,7 @@ void DrawingML::WriteSolidFill( const Reference< XPropertySet >& rXPropSet )
else if ( nFillColor != nOriginalColor )
{
// the user has set a different color for the shape
- if (!WriteSchemeColor(u"FillColorThemeReference", rXPropSet))
+ if (!WriteSchemeColor(u"FillComplexColor", rXPropSet))
{
WriteSolidFill(::Color(ColorTransparency, nFillColor & 0xffffff), nAlpha);
}
@@ -540,19 +540,18 @@ bool DrawingML::WriteSchemeColor(OUString const& rPropertyName, const uno::Refer
if (!xPropertySet->getPropertySetInfo()->hasPropertyByName(rPropertyName))
return false;
- uno::Reference<util::XThemeColor> xThemeColor;
- xPropertySet->getPropertyValue(rPropertyName) >>= xThemeColor;
- if (!xThemeColor.is())
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xPropertySet->getPropertyValue(rPropertyName) >>= xComplexColor;
+ if (!xComplexColor.is())
return false;
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- if (aThemeColor.getType() == model::ThemeColorType::Unknown)
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ if (aComplexColor.getSchemeType() == model::ThemeColorType::Unknown)
return false;
- const char* pColorName = g_aPredefinedClrNames[sal_Int16(aThemeColor.getType())];
+ const char* pColorName = g_aPredefinedClrNames[sal_Int16(aComplexColor.getSchemeType())];
mpFS->startElementNS(XML_a, XML_solidFill);
mpFS->startElementNS(XML_a, XML_schemeClr, XML_val, pColorName);
- for (auto const& rTransform : aThemeColor.getTransformations())
+ for (auto const& rTransform : aComplexColor.getTransformations())
{
switch (rTransform.meType)
{
@@ -574,13 +573,12 @@ bool DrawingML::WriteSchemeColor(OUString const& rPropertyName, const uno::Refer
}
// Alpha is actually not contained in maTransformations although possible (as of Mar 2023).
sal_Int16 nAPITransparency(0);
- if ((rPropertyName == u"FillColorThemeReference"
- && GetProperty(xPropertySet, "FillTransparence"))
- || (rPropertyName == u"LineColorThemeReference"
- && GetProperty(xPropertySet, "LineTransparence"))
- || (rPropertyName == u"CharColorThemeReference"
- && GetProperty(xPropertySet, "CharTransparence")))
+ if ((rPropertyName == u"FillComplexColor" && GetProperty(xPropertySet, "FillTransparence"))
+ || (rPropertyName == u"LineComplexColor" && GetProperty(xPropertySet, "LineTransparence"))
+ || (rPropertyName == u"CharComplexColor" && GetProperty(xPropertySet, "CharTransparence")))
+ {
mAny >>= nAPITransparency;
+ }
if (nAPITransparency != 0)
mpFS->singleElementNS(XML_a, XML_alpha, XML_val,
OString::number(MAX_PERCENT - (PER_PERCENT * nAPITransparency)));
@@ -1145,8 +1143,8 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc
if( nColor != nOriginalColor )
{
// the user has set a different color for the line
- if (!WriteSchemeColor(u"LineColorThemeReference", rXPropSet))
- WriteSolidFill(nColor, nColorAlpha);
+ if (!WriteSchemeColor(u"LineComplexColor", rXPropSet))
+ WriteSolidFill(nColor, nColorAlpha);
}
else if( !sColorFillScheme.isEmpty() )
{
@@ -2673,7 +2671,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
else
{
color.SetAlpha(255);
- if (!WriteSchemeColor(u"CharColorThemeReference", rXPropSet))
+ if (!WriteSchemeColor(u"CharComplexColor", rXPropSet))
WriteSolidFill(color, nTransparency);
}
mpFS->endElementNS(XML_a, XML_ln);
@@ -2686,7 +2684,7 @@ void DrawingML::WriteRunProperties( const Reference< XPropertySet >& rRun, bool
{
color.SetAlpha(255);
// TODO: special handle embossed/engraved
- if (!WriteSchemeColor(u"CharColorThemeReference", rXPropSet))
+ if (!WriteSchemeColor(u"CharComplexColor", rXPropSet))
{
WriteSolidFill(color, nTransparency);
}
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 0b6e5437b883..cf8b8781af23 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -53,12 +53,12 @@ Change
CharBackColor
CharCaseMap
CharColor
-CharColorThemeReference
CharContoured
CharColorTheme
CharColorTintOrShade
CharColorLumMod
CharColorLumOff
+CharComplexColor
CharEscapement
CharEscapementHeight
CharFontCharSet
@@ -177,7 +177,7 @@ FillColor
FillColorTheme
FillColorLumMod
FillColorLumOff
-FillColorThemeReference
+FillComplexColor
FillGradient
FillGradientName
FillHatch
@@ -316,7 +316,7 @@ LeftPageHeaderContent
LegacyFragment
LineCap
LineColor
-LineColorThemeReference
+LineComplexColor
LineCount
LineDash
LineDashName
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index b39dcc8756cb..25d0363c35f4 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -5049,11 +5049,12 @@ void ScDocument::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, bool b
double nPPTX, double nPPTY,
const Fraction& rZoomX, const Fraction& rZoomY )
{
- for (const auto& a : maTabs)
+ for (const auto& rTab : maTabs)
{
- if (a)
- a->StyleSheetChanged
- ( pStyleSheet, bRemoved, pDev, nPPTX, nPPTY, rZoomX, rZoomY );
+ if (rTab)
+ {
+ rTab->StyleSheetChanged(pStyleSheet, bRemoved, pDev, nPPTX, nPPTY, rZoomX, rZoomY);
+ }
}
}
@@ -5075,9 +5076,9 @@ bool ScDocument::IsStyleSheetUsed( const ScStyleSheet& rStyle ) const
bool bIsUsed = false;
- for (const auto& a : maTabs)
+ for (const auto& rTab : maTabs)
{
- if (a && a->IsStyleSheetUsed( rStyle ) )
+ if (rTab && rTab->IsStyleSheetUsed( rStyle ) )
bIsUsed = true;
}
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 00bbd65ef69e..b1614d6eb8ca 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -42,7 +42,7 @@
#include <svl/stritem.hxx>
#include <undo/undomanager.hxx>
#include <vcl/scheduler.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <comphelper/propertyvalue.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <docmodel/uno/UnoTheme.hxx>
@@ -986,18 +986,17 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testCharColorTheme)
uno::Reference<beans::XPropertySet> xPortion(xPara->createEnumeration()->nextElement(),
uno::UNO_QUERY);
{
- uno::Reference<util::XThemeColor> xThemeColor;
- CPPUNIT_ASSERT(xPortion->getPropertyValue("CharColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xPortion->getPropertyValue("CharComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod,
- aThemeColor.getTransformations()[0].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), aThemeColor.getTransformations()[0].mnValue);
+ aComplexColor.getTransformations()[0].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), aComplexColor.getTransformations()[0].mnValue);
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff,
- aThemeColor.getTransformations()[1].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), aThemeColor.getTransformations()[1].mnValue);
+ aComplexColor.getTransformations()[1].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), aComplexColor.getTransformations()[1].mnValue);
}
}
@@ -1025,18 +1024,17 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testFillColorTheme)
// Then make sure the theme index is not lost when the sidebar sets it:
{
- uno::Reference<util::XThemeColor> xThemeColor;
- CPPUNIT_ASSERT(xShape->getPropertyValue("FillColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xShape->getPropertyValue("FillComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod,
- aThemeColor.getTransformations()[0].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aThemeColor.getTransformations()[0].mnValue);
+ aComplexColor.getTransformations()[0].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aComplexColor.getTransformations()[0].mnValue);
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff,
- aThemeColor.getTransformations()[1].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aThemeColor.getTransformations()[1].mnValue);
+ aComplexColor.getTransformations()[1].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aComplexColor.getTransformations()[1].mnValue);
}
}
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 218ec3c3b28f..a544e7f198d3 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -1351,7 +1351,7 @@ PropertyState SAL_CALL SdStyleSheet::getPropertyState( const OUString& PropertyN
if (pEntry->nMemberId == MID_COLOR_THEME_INDEX)
{
const XFillColorItem* pColor = rStyleSet.GetItem<XFillColorItem>(pEntry->nWID);
- if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown)
+ if (pColor->getComplexColor().getSchemeType() == model::ThemeColorType::Unknown)
{
eState = PropertyState_DEFAULT_VALUE;
}
@@ -1360,7 +1360,7 @@ PropertyState SAL_CALL SdStyleSheet::getPropertyState( const OUString& PropertyN
{
const XFillColorItem* pColor = rStyleSet.GetItem<XFillColorItem>(pEntry->nWID);
sal_Int16 nLumMod = 10000;
- for (auto const& rTransform : pColor->GetThemeColor().getTransformations())
+ for (auto const& rTransform : pColor->getComplexColor().getTransformations())
{
if (rTransform.meType == model::TransformationType::LumMod)
nLumMod = rTransform.mnValue;
@@ -1374,7 +1374,7 @@ PropertyState SAL_CALL SdStyleSheet::getPropertyState( const OUString& PropertyN
{
const XFillColorItem* pColor = rStyleSet.GetItem<XFillColorItem>(pEntry->nWID);
sal_Int16 nLumOff = 0;
- for (auto const& rTransform : pColor->GetThemeColor().getTransformations())
+ for (auto const& rTransform : pColor->getComplexColor().getTransformations())
{
if (rTransform.meType == model::TransformationType::LumOff)
nLumOff = rTransform.mnValue;
@@ -1384,20 +1384,20 @@ PropertyState SAL_CALL SdStyleSheet::getPropertyState( const OUString& PropertyN
eState = PropertyState_DEFAULT_VALUE;
}
}
- else if (pEntry->nMemberId == MID_COLOR_THEME_REFERENCE)
+ else if (pEntry->nMemberId == MID_COMPLEX_COLOR)
{
- const XFillColorItem* pColor = rStyleSet.GetItem<XFillColorItem>(pEntry->nWID);
- if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown)
+ auto const* pColor = rStyleSet.GetItem<XFillColorItem>(pEntry->nWID);
+ if (pColor->getComplexColor().getType() == model::ColorType::Unused)
{
eState = PropertyState_DEFAULT_VALUE;
}
}
break;
case XATTR_LINECOLOR:
- if (pEntry->nMemberId == MID_COLOR_THEME_REFERENCE)
+ if (pEntry->nMemberId == MID_COMPLEX_COLOR)
{
auto const* pColor = rStyleSet.GetItem<XLineColorItem>(pEntry->nWID);
- if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown)
+ if (pColor->getComplexColor().getType() == model::ColorType::Unused)
{
eState = PropertyState_DEFAULT_VALUE;
}
diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx
index 3f3085b60d20..4db1f4042dc9 100644
--- a/sd/source/ui/func/fuconstr.cxx
+++ b/sd/source/ui/func/fuconstr.cxx
@@ -393,7 +393,7 @@ void FuConstruct::SetStyleSheet( SfxItemSet& rAttr, SdrObject* pObj,
model::ThemeColorType eColorType = model::ThemeColorType::Accent1;
Color aColor = pTheme->GetColor(eColorType);
XFillColorItem aFillColorItem("", aColor);
- aFillColorItem.GetThemeColor().setType(eColorType);
+ aFillColorItem.getComplexColor().setSchemeColor(eColorType);
aAttr.Put(aFillColorItem);
aAttr.Put(XLineStyleItem(css::drawing::LineStyle_SOLID));
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 84a70eefff7b..7f1b762d6e48 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -575,22 +575,24 @@ public:
if (pColorItem)
{
XFillColorItem aColorItem(*pColorItem);
- aColorItem.GetThemeColor().clearTransformations();
+ model::ComplexColor aComplexColor = aColorItem.getComplexColor();
+
if (pArgs->GetItemState(SID_ATTR_COLOR_THEME_INDEX, false, &pItem) == SfxItemState::SET)
{
auto pIntItem = static_cast<const SfxInt16Item*>(pItem);
- aColorItem.GetThemeColor().setType(model::convertToThemeColorType(pIntItem->GetValue()));
+ aComplexColor.setSchemeColor(model::convertToThemeColorType(pIntItem->GetValue()));
}
if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_MOD, false, &pItem) == SfxItemState::SET)
{
auto pIntItem = static_cast<const SfxInt16Item*>(pItem);
- aColorItem.GetThemeColor().addTransformation({model::TransformationType::LumMod, pIntItem->GetValue()});
+ aComplexColor.addTransformation({model::TransformationType::LumMod, pIntItem->GetValue()});
}
if (pArgs->GetItemState(SID_ATTR_COLOR_LUM_OFF, false, &pItem) == SfxItemState::SET)
{
auto pIntItem = static_cast<const SfxInt16Item*>(pItem);
- aColorItem.GetThemeColor().addTransformation({model::TransformationType::LumOff, pIntItem->GetValue()});
+ aComplexColor.addTransformation({model::TransformationType::LumOff, pIntItem->GetValue()});
}
+ aColorItem.setComplexColor(aComplexColor);
pArgs->Put(aColorItem);
}
}
diff --git a/svx/qa/unit/styles.cxx b/svx/qa/unit/styles.cxx
index d44bf9ac4dc8..05eeb451ba1b 100644
--- a/svx/qa/unit/styles.cxx
+++ b/svx/qa/unit/styles.cxx
@@ -13,7 +13,7 @@
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/drawing/XMasterPageTarget.hpp>
#include <com/sun/star/text/XTextRange.hpp>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
using namespace ::com::sun::star;
@@ -75,30 +75,28 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeChange)
// The theme color of this filled shape is set by the PPTX import:
{
- uno::Reference<util::XThemeColor> xThemeColor;
- CPPUNIT_ASSERT(xShape4->getPropertyValue("FillColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xShape4->getPropertyValue("FillComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
}
uno::Reference<beans::XPropertySet> xShape5(xDrawPageShapes->getByIndex(5), uno::UNO_QUERY);
// Blue, lighter.
CPPUNIT_ASSERT_EQUAL(Color(0xb4c7e7), GetShapeFillColor(xShape5));
// The theme index, and effects (lum mod, lum off) are set by the PPTX import:
{
- uno::Reference<util::XThemeColor> xThemeColor;
- CPPUNIT_ASSERT(xShape5->getPropertyValue("FillColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xShape5->getPropertyValue("FillComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod,
- aThemeColor.getTransformations()[0].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aThemeColor.getTransformations()[0].mnValue);
+ aComplexColor.getTransformations()[0].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aComplexColor.getTransformations()[0].mnValue);
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff,
- aThemeColor.getTransformations()[1].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aThemeColor.getTransformations()[1].mnValue);
+ aComplexColor.getTransformations()[1].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aComplexColor.getTransformations()[1].mnValue);
}
// When changing the master slide of slide 1 to use the theme of the second master slide:
uno::Reference<drawing::XMasterPageTarget> xDrawPage2(
diff --git a/svx/qa/unit/xoutdev.cxx b/svx/qa/unit/xoutdev.cxx
index 6cd68a0c8172..800c709770de 100644
--- a/svx/qa/unit/xoutdev.cxx
+++ b/svx/qa/unit/xoutdev.cxx
@@ -19,7 +19,7 @@
#include <vcl/graphicfilter.hxx>
#include <svx/xoutbmp.hxx>
#include <vcl/filter/PDFiumLibrary.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
using namespace com::sun::star;
@@ -103,28 +103,27 @@ CPPUNIT_TEST_FIXTURE(XOutdevTest, testFillColorThemeUnoApi)
uno::Reference<beans::XPropertySet> xShape(xPage->getByIndex(0), uno::UNO_QUERY);
// Set theme color
{
- model::ThemeColor aThemeColor;
- aThemeColor.setType(model::ThemeColorType::Accent1);
- aThemeColor.addTransformation({ model::TransformationType::LumMod, 2000 });
- aThemeColor.addTransformation({ model::TransformationType::LumOff, 8000 });
- xShape->setPropertyValue("FillColorThemeReference",
- uno::Any(model::theme::createXThemeColor(aThemeColor)));
+ model::ComplexColor aComplexColor;
+ aComplexColor.setSchemeColor(model::ThemeColorType::Accent1);
+ aComplexColor.addTransformation({ model::TransformationType::LumMod, 2000 });
+ aComplexColor.addTransformation({ model::TransformationType::LumOff, 8000 });
+ xShape->setPropertyValue("FillComplexColor",
+ uno::Any(model::color::createXComplexColor(aComplexColor)));
}
// Then make sure the value we read back is the expected one:
{
- uno::Reference<util::XThemeColor> xThemeColor;
- CPPUNIT_ASSERT(xShape->getPropertyValue("FillColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xShape->getPropertyValue("FillComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod,
- aThemeColor.getTransformations()[0].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), aThemeColor.getTransformations()[0].mnValue);
+ aComplexColor.getTransformations()[0].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), aComplexColor.getTransformations()[0].mnValue);
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff,
- aThemeColor.getTransformations()[1].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), aThemeColor.getTransformations()[1].mnValue);
+ aComplexColor.getTransformations()[1].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), aComplexColor.getTransformations()[1].mnValue);
}
}
diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi
index f21f977384c7..eabb753f647a 100644
--- a/svx/sdi/svxitems.sdi
+++ b/svx/sdi/svxitems.sdi
@@ -172,8 +172,8 @@ item BOOL SvxAutoKernItem;
struct SvxColor
{
- INT32 Color MID_COLOR_RGB;
- String ThemeReferenceJSON MID_COLOR_THEME_REFERENCE_JSON;
+ INT32 Color MID_COLOR_RGB;
+ String ComplexColorJSON MID_COMPLEX_COLOR_JSON;
};
item SvxColor SvxColorItem;
diff --git a/svx/source/dialog/ThemeColorValueSet.cxx b/svx/source/dialog/ThemeColorValueSet.cxx
index aa0abe0bad66..d33e2fbc85e1 100644
--- a/svx/source/dialog/ThemeColorValueSet.cxx
+++ b/svx/source/dialog/ThemeColorValueSet.cxx
@@ -8,7 +8,7 @@
*/
#include <svx/dialog/ThemeColorValueSet.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <vcl/event.hxx>
namespace svx
diff --git a/svx/source/dialog/ThemeDialog.cxx b/svx/source/dialog/ThemeDialog.cxx
index 68e2eceeee1c..ce88b2ef4b79 100644
--- a/svx/source/dialog/ThemeDialog.cxx
+++ b/svx/source/dialog/ThemeDialog.cxx
@@ -9,7 +9,6 @@
#include <svx/dialog/ThemeDialog.hxx>
#include <svx/dialog/ThemeColorEditDialog.hxx>
-#include <docmodel/theme/ThemeColor.hxx>
#include <docmodel/theme/ColorSet.hxx>
#include <docmodel/theme/Theme.hxx>
#include <svx/ColorSets.hxx>
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 88381056e572..bbef530c3dd1 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -1423,17 +1423,18 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName )
case XATTR_FILLCOLOR:
if (pMap->nMemberId == MID_COLOR_THEME_INDEX)
{
- const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
- if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown)
+ auto const* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
+ if (pColor->getComplexColor().getType() == model::ColorType::Unused ||
+ pColor->getComplexColor().getSchemeType() == model::ThemeColorType::Unknown)
{
eState = PropertyState_DEFAULT_VALUE;
}
}
else if (pMap->nMemberId == MID_COLOR_LUM_MOD)
{
- const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
+ auto const* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
sal_Int16 nLumMod = 10000;
- for (auto const& rTransform : pColor->GetThemeColor().getTransformations())
+ for (auto const& rTransform : pColor->getComplexColor().getTransformations())
{
if (rTransform.meType == model::TransformationType::LumMod)
nLumMod = rTransform.mnValue;
@@ -1445,9 +1446,9 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName )
}
else if (pMap->nMemberId == MID_COLOR_LUM_OFF)
{
- const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
+ auto const* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
sal_Int16 nLumOff = 0;
- for (auto const& rTransform : pColor->GetThemeColor().getTransformations())
+ for (auto const& rTransform : pColor->getComplexColor().getTransformations())
{
if (rTransform.meType == model::TransformationType::LumOff)
nLumOff = rTransform.mnValue;
@@ -1457,20 +1458,20 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName )
eState = PropertyState_DEFAULT_VALUE;
}
}
- else if (pMap->nMemberId == MID_COLOR_THEME_REFERENCE)
+ else if (pMap->nMemberId == MID_COMPLEX_COLOR)
{
- const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
- if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown)
+ auto const* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
+ if (pColor->getComplexColor().getType() == model::ColorType::Unused)
{
eState = PropertyState_DEFAULT_VALUE;
}
}
break;
case XATTR_LINECOLOR:
- if (pMap->nMemberId == MID_COLOR_THEME_REFERENCE)
+ if (pMap->nMemberId == MID_COMPLEX_COLOR)
{
auto const* pColor = rSet.GetItem<XLineColorItem>(pMap->nWID);
- if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown)
+ if (pColor->getComplexColor().getType() == model::ColorType::Unused)
{
eState = PropertyState_DEFAULT_VALUE;
}
diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx
index 7312ee26f5af..06e14064d8af 100644
--- a/svx/source/tbxctrls/PaletteManager.cxx
+++ b/svx/source/tbxctrls/PaletteManager.cxx
@@ -41,8 +41,8 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
-#include <docmodel/theme/ThemeColor.hxx>
-#include <docmodel/theme/ThemeColorJSON.hxx>
+#include <docmodel/color/ComplexColor.hxx>
+#include <docmodel/color/ComplexColorJSON.hxx>
#include <editeng/colritem.hxx>
#include <editeng/memberids.h>
@@ -445,17 +445,17 @@ void PaletteManager::DispatchColorCommand(const OUString& aCommand, const svx::N
if (rColor.m_nThemeIndex != -1)
{
- model::ThemeColor aThemeColor;
- aThemeColor.setType(model::convertToThemeColorType(rColor.m_nThemeIndex));
+ model::ComplexColor aComplexColor;
+ aComplexColor.setSchemeColor(model::convertToThemeColorType(rColor.m_nThemeIndex));
if (rColor.m_nLumMod != 10000)
- aThemeColor.addTransformation({model::TransformationType::LumMod, rColor.m_nLumMod});
+ aComplexColor.addTransformation({model::TransformationType::LumMod, rColor.m_nLumMod});
if (rColor.m_nLumMod != 0)
- aThemeColor.addTransformation({model::TransformationType::LumOff, rColor.m_nLumOff});
+ aComplexColor.addTransformation({model::TransformationType::LumOff, rColor.m_nLumOff});
uno::Any aAny;
- aAny <<= OStringToOUString(model::theme::convertToJSON(aThemeColor), RTL_TEXTENCODING_UTF8);
+ aAny <<= OStringToOUString(model::color::convertToJSON(aComplexColor), RTL_TEXTENCODING_UTF8);
- aArgs.push_back(comphelper::makePropertyValue(aObj.GetURLPath() + ".ThemeReferenceJSON", aAny));
+ aArgs.push_back(comphelper::makePropertyValue(aObj.GetURLPath() + ".ComplexColorJSON", aAny));
}
URL aTargetURL;
diff --git a/svx/source/theme/ThemeColorChanger.cxx b/svx/source/theme/ThemeColorChanger.cxx
index 792f85d3bda9..06d199cc3896 100644
--- a/svx/source/theme/ThemeColorChanger.cxx
+++ b/svx/source/theme/ThemeColorChanger.cxx
@@ -13,14 +13,14 @@
#include <svx/svdpage.hxx>
#include <svx/svditer.hxx>
#include <editeng/unoprnms.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <docmodel/theme/ColorSet.hxx>
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/util/XThemeColor.hpp>
+#include <com/sun/star/util/XComplexColor.hpp>
using namespace css;
@@ -34,22 +34,22 @@ namespace
void updateTextPortionColorSet(model::ColorSet const& rColorSet,
const uno::Reference<beans::XPropertySet>& xPortion)
{
- if (!xPortion->getPropertySetInfo()->hasPropertyByName(
- UNO_NAME_EDIT_CHAR_COLOR_THEME_REFERENCE))
+ if (!xPortion->getPropertySetInfo()->hasPropertyByName(UNO_NAME_EDIT_CHAR_COMPLEX_COLOR))
+ {
return;
+ }
- uno::Reference<util::XThemeColor> xThemeColor;
- xPortion->getPropertyValue(UNO_NAME_EDIT_CHAR_COLOR_THEME_REFERENCE) >>= xThemeColor;
- if (!xThemeColor.is())
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xPortion->getPropertyValue(UNO_NAME_EDIT_CHAR_COMPLEX_COLOR) >>= xComplexColor;
+ if (!xComplexColor.is())
return;
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
- if (aThemeColor.getType() == model::ThemeColorType::Unknown)
+ if (aComplexColor.getSchemeType() == model::ThemeColorType::Unknown)
return;
- Color aColor = rColorSet.resolveColor(aThemeColor);
+ Color aColor = rColorSet.resolveColor(aComplexColor);
xPortion->setPropertyValue(UNO_NAME_EDIT_CHAR_COLOR, uno::Any(static_cast<sal_Int32>(aColor)));
}
@@ -57,21 +57,20 @@ void updateTextPortionColorSet(model::ColorSet const& rColorSet,
void updateFillColorSet(model::ColorSet const& rColorSet,
const uno::Reference<beans::XPropertySet>& xShape)
{
- if (!xShape->getPropertySetInfo()->hasPropertyByName(UNO_NAME_FILLCOLOR_THEME_REFERENCE))
+ if (!xShape->getPropertySetInfo()->hasPropertyByName(UNO_NAME_FILL_COMPLEX_COLOR))
return;
- uno::Reference<util::XThemeColor> xThemeColor;
- xShape->getPropertyValue(UNO_NAME_FILLCOLOR_THEME_REFERENCE) >>= xThemeColor;
- if (!xThemeColor.is())
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xShape->getPropertyValue(UNO_NAME_FILL_COMPLEX_COLOR) >>= xComplexColor;
+ if (!xComplexColor.is())
return;
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
- if (aThemeColor.getType() == model::ThemeColorType::Unknown)
+ if (aComplexColor.getSchemeType() == model::ThemeColorType::Unknown)
return;
- Color aColor = rColorSet.resolveColor(aThemeColor);
+ Color aColor = rColorSet.resolveColor(aComplexColor);
xShape->setPropertyValue(UNO_NAME_FILLCOLOR, uno::Any(static_cast<sal_Int32>(aColor)));
}
@@ -79,21 +78,20 @@ void updateFillColorSet(model::ColorSet const& rColorSet,
void updateLineColorSet(model::ColorSet const& rColorSet,
const uno::Reference<beans::XPropertySet>& xShape)
{
- if (!xShape->getPropertySetInfo()->hasPropertyByName(UNO_NAME_LINECOLOR_THEME_REFERENCE))
+ if (!xShape->getPropertySetInfo()->hasPropertyByName(UNO_NAME_LINE_COMPLEX_COLOR))
return;
- uno::Reference<util::XThemeColor> xThemeColor;
- xShape->getPropertyValue(UNO_NAME_LINECOLOR_THEME_REFERENCE) >>= xThemeColor;
- if (!xThemeColor.is())
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xShape->getPropertyValue(UNO_NAME_LINE_COMPLEX_COLOR) >>= xComplexColor;
+ if (!xComplexColor.is())
return;
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
- if (aThemeColor.getType() == model::ThemeColorType::Unknown)
+ if (aComplexColor.getSchemeType() == model::ThemeColorType::Unknown)
return;
- Color aColor = rColorSet.resolveColor(aThemeColor);
+ Color aColor = rColorSet.resolveColor(aComplexColor);
xShape->setPropertyValue(UNO_NAME_LINECOLOR, uno::Any(static_cast<sal_Int32>(aColor)));
}
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 08c7f5ba6933..0022cb77f4f5 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -566,7 +566,7 @@ static o3tl::span<SfxItemPropertyMapEntry const> ImplGetSvxControlShapePropertyM
{ UNO_NAME_EDIT_CHAR_COLOR, 0, cppu::UnoType<sal_Int32>::get(), 0, MID_COLOR_RGB },
{ UNO_NAME_EDIT_CHAR_COLOR_THEME, 0, cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_THEME_INDEX },
{ UNO_NAME_EDIT_CHAR_COLOR_TINT_OR_SHADE, 0, cppu::UnoType<sal_Int16>::get(), 0, MID_COLOR_TINT_OR_SHADE },
- { UNO_NAME_EDIT_CHAR_COLOR_THEME_REFERENCE, 0, cppu::UnoType<css::util::XThemeColor>::get(), 0, MID_COLOR_THEME_REFERENCE },
+ { UNO_NAME_EDIT_CHAR_COMPLEX_COLOR, 0, cppu::UnoType<css::util::XComplexColor>::get(), 0, MID_COMPLEX_COLOR },
{ u"CharBackColor", 0, cppu::UnoType<sal_Int32>::get(), 0, 0 },
{ u"CharBackTransparent", 0, cppu::UnoType<bool>::get(), 0, 0 },
{ u"CharRelief", 0, cppu::UnoType<sal_Int16>::get(), 0, 0 },
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index 9e180684fbe5..b6dd018e6474 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -608,7 +608,7 @@ const SvxShapeControlPropertyMapping[] =
{ "CharCaseMap", "CharCaseMap" },
{ "CharColorTheme", "CharColorTheme" },
{ "CharColorTintOrShade", "CharColorTintOrShade" },
- { UNO_NAME_EDIT_CHAR_COLOR_THEME_REFERENCE, "CharColorThemeReference" },
+ { UNO_NAME_EDIT_CHAR_COMPLEX_COLOR, "CharComplexColor" },
};
namespace
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 85cd6045a234..f46727299cef 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1964,7 +1964,8 @@ beans::PropertyState SvxShape::_getPropertyState( const OUString& PropertyName )
if (pMap->nMemberId == MID_COLOR_THEME_INDEX)
{
const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
- if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown)
+ if (pColor->getComplexColor().getType() == model::ColorType::Unused ||
+ pColor->getComplexColor().getSchemeType() == model::ThemeColorType::Unknown)
{
eState = beans::PropertyState_DEFAULT_VALUE;
}
@@ -1973,7 +1974,7 @@ beans::PropertyState SvxShape::_getPropertyState( const OUString& PropertyName )
{
const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
sal_Int16 nLumMod = 10000;
- for (auto const& rTransform : pColor->GetThemeColor().getTransformations())
+ for (auto const& rTransform : pColor->getComplexColor().getTransformations())
{
if (rTransform.meType == model::TransformationType::LumMod)
nLumMod = rTransform.mnValue;
@@ -1987,7 +1988,7 @@ beans::PropertyState SvxShape::_getPropertyState( const OUString& PropertyName )
{
const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
sal_Int16 nLumOff = 0;
- for (auto const& rTransform : pColor->GetThemeColor().getTransformations())
+ for (auto const& rTransform : pColor->getComplexColor().getTransformations())
{
if (rTransform.meType == model::TransformationType::LumOff)
nLumOff = rTransform.mnValue;
@@ -1997,20 +1998,20 @@ beans::PropertyState SvxShape::_getPropertyState( const OUString& PropertyName )
eState = beans::PropertyState_DEFAULT_VALUE;
}
}
- else if (pMap->nMemberId == MID_COLOR_THEME_REFERENCE)
+ else if (pMap->nMemberId == MID_COMPLEX_COLOR)
{
- const XFillColorItem* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
- if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown)
+ auto const* pColor = rSet.GetItem<XFillColorItem>(pMap->nWID);
+ if (pColor->getComplexColor().getType() == model::ColorType::Unused)
{
eState = beans::PropertyState_DEFAULT_VALUE;
}
}
break;
case XATTR_LINECOLOR:
- if (pMap->nMemberId == MID_COLOR_THEME_REFERENCE)
+ if (pMap->nMemberId == MID_COMPLEX_COLOR)
{
auto const* pColor = rSet.GetItem<XLineColorItem>(pMap->nWID);
- if (pColor->GetThemeColor().getType() == model::ThemeColorType::Unknown)
+ if (pColor->getComplexColor().getType() == model::ColorType::Unused)
{
eState = beans::PropertyState_DEFAULT_VALUE;
}
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 42822d72649b..3b31b852a835 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -36,7 +36,7 @@
#include <o3tl/any.hxx>
#include <svl/itempool.hxx>
#include <editeng/memberids.h>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <tools/mapunit.hxx>
#include <tools/UnitConversion.hxx>
#include <osl/diagnose.h>
@@ -282,7 +282,7 @@ XColorItem::XColorItem(TypedWhichId<XColorItem> _nWhich, const Color& rTheColor)
XColorItem::XColorItem(const XColorItem& rItem) :
NameOrIndex(rItem),
aColor(rItem.aColor),
- maThemeColor(rItem.maThemeColor)
+ maComplexColor(rItem.maComplexColor)
{
}
@@ -295,7 +295,7 @@ bool XColorItem::operator==(const SfxPoolItem& rItem) const
{
return ( NameOrIndex::operator==(rItem) &&
static_cast<const XColorItem&>(rItem).aColor == aColor ) &&
- static_cast<const XColorItem&>(rItem).maThemeColor == maThemeColor;
+ static_cast<const XColorItem&>(rItem).maComplexColor == maComplexColor;
}
const Color& XColorItem::GetColorValue() const
@@ -336,12 +336,12 @@ void XColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const
NameOrIndex::dumpAsXml(pWriter);
- (void)xmlTextWriterStartElement(pWriter, BAD_CAST("theme-color"));
+ (void)xmlTextWriterStartElement(pWriter, BAD_CAST("complex-color"));
- (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("theme-index"),
- BAD_CAST(OString::number(sal_Int16(maThemeColor.getType())).getStr()));
+ (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("scheme-index"),
+ BAD_CAST(OString::number(sal_Int16(maComplexColor.getSchemeType())).getStr()));
- for (auto const& rTransform : maThemeColor.getTransformations())
+ for (auto const& rTransform : maComplexColor.getTransformations())
{
(void)xmlTextWriterStartElement(pWriter, BAD_CAST("transformation"));
(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("type"),
@@ -996,10 +996,10 @@ bool XLineColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId) const
nMemberId &= ~CONVERT_TWIPS;
switch (nMemberId)
{
- case MID_COLOR_THEME_REFERENCE:
+ case MID_COMPLEX_COLOR:
{
- auto xThemeColor = model::theme::createXThemeColor(GetThemeColor());
- rVal <<= xThemeColor;
+ auto xComplexColor = model::color::createXComplexColor(getComplexColor());
+ rVal <<= xComplexColor;
break;
}
default:
@@ -1016,12 +1016,12 @@ bool XLineColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId)
nMemberId &= ~CONVERT_TWIPS;
switch(nMemberId)
{
- case MID_COLOR_THEME_REFERENCE:
+ case MID_COMPLEX_COLOR:
{
- css::uno::Reference<css::util::XThemeColor> xThemeColor;
- if (!(rVal >>= xThemeColor))
+ css::uno::Reference<css::util::XComplexColor> xComplexColor;
+ if (!(rVal >>= xComplexColor))
return false;
- model::theme::setFromXThemeColor(GetThemeColor(), xThemeColor);
+ setComplexColor(model::color::getFromXComplexColor(xComplexColor));
}
break;
default:
@@ -1954,13 +1954,13 @@ bool XFillColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons
{
case MID_COLOR_THEME_INDEX:
{
- rVal <<= sal_Int16(GetThemeColor().getType());
+ rVal <<= sal_Int16(getComplexColor().getSchemeType());
break;
}
case MID_COLOR_LUM_MOD:
{
sal_Int16 nValue = 10000;
- for (auto const& rTransform : GetThemeColor().getTransformations())
+ for (auto const& rTransform : getComplexColor().getTransformations())
{
if (rTransform.meType == model::TransformationType::LumMod)
nValue = rTransform.mnValue;
@@ -1971,7 +1971,7 @@ bool XFillColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons
case MID_COLOR_LUM_OFF:
{
sal_Int16 nValue = 0;
- for (auto const& rTransform : GetThemeColor().getTransformations())
+ for (auto const& rTransform : getComplexColor().getTransformations())
{
if (rTransform.meType == model::TransformationType::LumOff)
nValue = rTransform.mnValue;
@@ -1979,10 +1979,10 @@ bool XFillColorItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons
rVal <<= nValue;
break;
}
- case MID_COLOR_THEME_REFERENCE:
+ case MID_COMPLEX_COLOR:
{
- auto xThemeColor = model::theme::createXThemeColor(GetThemeColor());
- rVal <<= xThemeColor;
+ auto xComplexColor = model::color::createXComplexColor(getComplexColor());
+ rVal <<= xComplexColor;
break;
}
default:
@@ -2005,16 +2005,16 @@ bool XFillColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
sal_Int16 nIndex = -1;
if (!(rVal >>= nIndex))
return false;
- GetThemeColor().setType(model::convertToThemeColorType(nIndex));
- break;
+ getComplexColor().setSchemeColor(model::convertToThemeColorType(nIndex));
}
+ break;
case MID_COLOR_LUM_MOD:
{
sal_Int16 nLumMod = 10000;
if (!(rVal >>= nLumMod))
return false;
- GetThemeColor().removeTransformations(model::TransformationType::LumMod);
- GetThemeColor().addTransformation({model::TransformationType::LumMod, nLumMod});
+ getComplexColor().removeTransformations(model::TransformationType::LumMod);
+ getComplexColor().addTransformation({model::TransformationType::LumMod, nLumMod});
}
break;
case MID_COLOR_LUM_OFF:
@@ -2022,16 +2022,16 @@ bool XFillColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
sal_Int16 nLumOff = 0;
if (!(rVal >>= nLumOff))
return false;
- GetThemeColor().removeTransformations(model::TransformationType::LumOff);
- GetThemeColor().addTransformation({model::TransformationType::LumOff, nLumOff});
+ getComplexColor().removeTransformations(model::TransformationType::LumOff);
+ getComplexColor().addTransformation({model::TransformationType::LumOff, nLumOff});
}
break;
- case MID_COLOR_THEME_REFERENCE:
+ case MID_COMPLEX_COLOR:
{
- css::uno::Reference<css::util::XThemeColor> xThemeColor;
- if (!(rVal >>= xThemeColor))
+ css::uno::Reference<css::util::XComplexColor> xComplexColor;
+ if (!(rVal >>= xComplexColor))
return false;
- model::theme::setFromXThemeColor(GetThemeColor(), xThemeColor);
+ setComplexColor(model::color::getFromXComplexColor(xComplexColor));
}
break;
default:
@@ -2041,8 +2041,9 @@ bool XFillColorItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
return false;
SetColorValue( nValue );
- break;
+
}
+ break;
}
return true;
}
diff --git a/sw/qa/core/theme/ThemeTest.cxx b/sw/qa/core/theme/ThemeTest.cxx
index f76460eb6b98..832dc11dc267 100644
--- a/sw/qa/core/theme/ThemeTest.cxx
+++ b/sw/qa/core/theme/ThemeTest.cxx
@@ -16,7 +16,7 @@
#include <drawdoc.hxx>
#include <IDocumentDrawModelAccess.hxx>
#include <svx/svdpage.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <docmodel/theme/Theme.hxx>
#include <ThemeColorChanger.hxx>
#include <svx/ColorSets.hxx>
@@ -40,11 +40,10 @@ CPPUNIT_TEST_FIXTURE(SwCoreThemeTest, testThemeColorInHeading)
SwDoc* pDoc = getSwDoc();
CPPUNIT_ASSERT(pDoc);
- auto xThemeColor = getProperty<uno::Reference<util::XThemeColor>>(getParagraph(1),
- "CharColorThemeReference");
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ auto xComplexColor
+ = getProperty<uno::Reference<util::XComplexColor>>(getParagraph(1), "CharComplexColor");
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
}
void checkFillStyles(std::vector<model::FillStyle> const& rStyleList)
diff --git a/sw/source/core/model/ThemeColorChanger.cxx b/sw/source/core/model/ThemeColorChanger.cxx
index 9f973d80aaf2..4edf802f3309 100644
--- a/sw/source/core/model/ThemeColorChanger.cxx
+++ b/sw/source/core/model/ThemeColorChanger.cxx
@@ -26,7 +26,7 @@
#include <sal/config.h>
#include <svx/svdpage.hxx>
#include <svx/svditer.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <docmodel/theme/Theme.hxx>
#include <editeng/unoprnms.hxx>
#include <com/sun/star/text/XTextRange.hpp>
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 68565eadaf6f..ce1321006c1e 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -46,7 +46,7 @@
#include <com/sun/star/util/Date.hpp>
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/XTheme.hpp>
-#include <com/sun/star/util/XThemeColor.hpp>
+#include <com/sun/star/util/XComplexColor.hpp>
#include <com/sun/star/view/PaperOrientation.hpp>
#include <com/sun/star/script/XLibraryContainer.hpp>
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
@@ -1470,7 +1470,7 @@ o3tl::span<const SfxItemPropertyMapEntry> SwUnoPropertyMapProvider::GetPropertyM
{ UNO_NAME_CHAR_COLOR, RES_CHRATR_COLOR, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 0 },
{ UNO_NAME_CHAR_COLOR_THEME, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_THEME_INDEX },
{ UNO_NAME_CHAR_COLOR_TINT_OR_SHADE, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_TINT_OR_SHADE },
- { UNO_NAME_CHAR_COLOR_THEME_REFERENCE, RES_CHRATR_COLOR, cppu::UnoType<css::util::XThemeColor>::get(), PROPERTY_NONE, MID_COLOR_THEME_REFERENCE },
+ { UNO_NAME_CHAR_COMPLEX_COLOR, RES_CHRATR_COLOR, cppu::UnoType<css::util::XComplexColor>::get(), PROPERTY_NONE, MID_COMPLEX_COLOR },
// SvxShadowedItem
{ UNO_NAME_CHAR_SHADOWED, RES_CHRATR_SHADOWED, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 },
// SvxContouredItem
diff --git a/sw/source/core/unocore/unomap1.cxx b/sw/source/core/unocore/unomap1.cxx
index 343060c0e7ec..36ecc6cd7b57 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -69,7 +69,7 @@
#include <com/sun/star/text/XTextSection.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/util/DateTime.hpp>
-#include <com/sun/star/util/XThemeColor.hpp>
+#include <com/sun/star/util/XComplexColor.hpp>
#include <unomap.hxx>
#include <unoprnms.hxx>
#include <unomid.h>
@@ -182,7 +182,7 @@ o3tl::span<const SfxItemPropertyMapEntry> SwUnoPropertyMapProvider::GetCharStyle
{ UNO_NAME_CHAR_COLOR, RES_CHRATR_COLOR, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 0 },
{ UNO_NAME_CHAR_COLOR_THEME, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_THEME_INDEX },
{ UNO_NAME_CHAR_COLOR_TINT_OR_SHADE, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_TINT_OR_SHADE },
- { UNO_NAME_CHAR_COLOR_THEME_REFERENCE, RES_CHRATR_COLOR, cppu::UnoType<css::util::XThemeColor>::get(), PROPERTY_NONE, MID_COLOR_THEME_REFERENCE },
+ { UNO_NAME_CHAR_COMPLEX_COLOR, RES_CHRATR_COLOR, cppu::UnoType<css::util::XComplexColor>::get(), PROPERTY_NONE, MID_COMPLEX_COLOR },
{ UNO_NAME_CHAR_TRANSPARENCE, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_ALPHA},
{ UNO_NAME_CHAR_STRIKEOUT, RES_CHRATR_CROSSEDOUT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_CROSS_OUT},
{ UNO_NAME_CHAR_CROSSED_OUT, RES_CHRATR_CROSSEDOUT, cppu::UnoType<bool>::get() , PROPERTY_NONE, 0},
@@ -247,7 +247,7 @@ o3tl::span<const SfxItemPropertyMapEntry> SwUnoPropertyMapProvider::GetAutoChar
{ UNO_NAME_CHAR_COLOR, RES_CHRATR_COLOR, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 0},
{ UNO_NAME_CHAR_COLOR_THEME, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_THEME_INDEX },
{ UNO_NAME_CHAR_COLOR_TINT_OR_SHADE, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_TINT_OR_SHADE },
- { UNO_NAME_CHAR_COLOR_THEME_REFERENCE, RES_CHRATR_COLOR, cppu::UnoType<css::util::XThemeColor>::get(), PROPERTY_NONE, MID_COLOR_THEME_REFERENCE },
+ { UNO_NAME_CHAR_COMPLEX_COLOR, RES_CHRATR_COLOR, cppu::UnoType<css::util::XComplexColor>::get(), PROPERTY_NONE, MID_COMPLEX_COLOR },
{ UNO_NAME_CHAR_TRANSPARENCE, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_ALPHA},
{ UNO_NAME_CHAR_STRIKEOUT, RES_CHRATR_CROSSEDOUT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_CROSS_OUT},
{ UNO_NAME_CHAR_CROSSED_OUT, RES_CHRATR_CROSSEDOUT, cppu::UnoType<bool>::get() , PROPERTY_NONE, 0},
diff --git a/sw/source/core/unocore/unomapproperties.hxx b/sw/source/core/unocore/unomapproperties.hxx
index d88c55c9b96e..1b7a4bfc280a 100644
--- a/sw/source/core/unocore/unomapproperties.hxx
+++ b/sw/source/core/unocore/unomapproperties.hxx
@@ -128,7 +128,7 @@
{ UNO_NAME_CHAR_COLOR, RES_CHRATR_COLOR, cppu::UnoType<sal_Int32>::get(), PropertyAttribute::MAYBEVOID, 0 }, \
{ UNO_NAME_CHAR_COLOR_THEME, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_COLOR_THEME_INDEX }, \
{ UNO_NAME_CHAR_COLOR_TINT_OR_SHADE, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_COLOR_TINT_OR_SHADE }, \
- { UNO_NAME_CHAR_COLOR_THEME_REFERENCE, RES_CHRATR_COLOR, cppu::UnoType<css::util::XThemeColor>::get(), PropertyAttribute::MAYBEVOID, MID_COLOR_THEME_REFERENCE }, \
+ { UNO_NAME_CHAR_COMPLEX_COLOR , RES_CHRATR_COLOR, cppu::UnoType<css::util::XComplexColor>::get(), PropertyAttribute::MAYBEVOID, MID_COMPLEX_COLOR }, \
{ UNO_NAME_CHAR_TRANSPARENCE, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_COLOR_ALPHA }, \
{ UNO_NAME_CHAR_STRIKEOUT, RES_CHRATR_CROSSEDOUT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_CROSS_OUT }, \
{ UNO_NAME_CHAR_CROSSED_OUT, RES_CHRATR_CROSSEDOUT, cppu::UnoType<bool>::get(), PropertyAttribute::MAYBEVOID, MID_CROSSED_OUT }, \
@@ -375,7 +375,7 @@
{ UNO_NAME_CHAR_COLOR, RES_CHRATR_COLOR, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 0},\
{ UNO_NAME_CHAR_COLOR_THEME, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_THEME_INDEX }, \
{ UNO_NAME_CHAR_COLOR_TINT_OR_SHADE, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_TINT_OR_SHADE }, \
- { UNO_NAME_CHAR_COLOR_THEME_REFERENCE, RES_CHRATR_COLOR, cppu::UnoType<css::util::XThemeColor>::get(), PropertyAttribute::MAYBEVOID, MID_COLOR_THEME_REFERENCE }, \
+ { UNO_NAME_CHAR_COMPLEX_COLOR, RES_CHRATR_COLOR, cppu::UnoType<css::util::XComplexColor>::get(), PropertyAttribute::MAYBEVOID, MID_COMPLEX_COLOR }, \
{ UNO_NAME_CHAR_TRANSPARENCE, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_ALPHA},\
{ UNO_NAME_CHAR_STRIKEOUT, RES_CHRATR_CROSSEDOUT, cppu::UnoType<sal_Int16>::get(), PropertyAttribute::MAYBEVOID, MID_CROSS_OUT},\
{ UNO_NAME_CHAR_CROSSED_OUT, RES_CHRATR_CROSSEDOUT, cppu::UnoType<bool>::get() , PROPERTY_NONE, 0},\
@@ -488,7 +488,7 @@
{ UNO_NAME_CHAR_COLOR, RES_CHRATR_COLOR, cppu::UnoType<sal_Int32>::get(), PROPERTY_NONE, 0}, \
{ UNO_NAME_CHAR_COLOR_THEME, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_THEME_INDEX }, \
{ UNO_NAME_CHAR_COLOR_TINT_OR_SHADE, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_TINT_OR_SHADE }, \
- { UNO_NAME_CHAR_COLOR_THEME_REFERENCE, RES_CHRATR_COLOR, cppu::UnoType<css::util::XThemeColor>::get(), PropertyAttribute::MAYBEVOID, MID_COLOR_THEME_REFERENCE }, \
+ { UNO_NAME_CHAR_COMPLEX_COLOR, RES_CHRATR_COLOR, cppu::UnoType<css::util::XComplexColor>::get(), PropertyAttribute::MAYBEVOID, MID_COMPLEX_COLOR }, \
{ UNO_NAME_CHAR_TRANSPARENCE, RES_CHRATR_COLOR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_COLOR_ALPHA }, \
{ UNO_NAME_CHAR_CONTOURED, RES_CHRATR_CONTOUR, cppu::UnoType<bool>::get() , PROPERTY_NONE, 0}, \
{ UNO_NAME_CHAR_EMPHASIS, RES_CHRATR_EMPHASIS_MARK, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, MID_EMPHASIS}, \
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index 6d13af48fc98..e341c135d3e1 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -45,7 +45,7 @@
#include <o3tl/enumrange.hxx>
#include <svx/unoapi.hxx>
#include <svx/svdpage.hxx>
-#include <docmodel/theme/ThemeColor.hxx>
+#include <docmodel/theme/ThemeColorType.hxx>
#include <docmodel/theme/Theme.hxx>
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 3db5c2970705..06bd0dd10ed1 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -69,7 +69,7 @@
#include <com/sun/star/text/FontEmphasis.hpp>
#include <com/sun/star/awt/CharSet.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/util/XThemeColor.hpp>
+#include <com/sun/star/util/XComplexColor.hpp>
#include <comphelper/types.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/sequence.hxx>
@@ -2217,22 +2217,22 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
auto eType = TDefTableHandler::getThemeColorTypeIndex(pThemeColorHandler->mnIndex);
if (eType != model::ThemeColorType::Unknown)
{
- model::ThemeColor aThemeColor;
- aThemeColor.setType(eType);
+ model::ComplexColor aComplexColor;
+ aComplexColor.setSchemeColor(eType);
if (pThemeColorHandler->mnTint > 0 )
{
sal_Int16 nTint = sal_Int16((256 - pThemeColorHandler->mnTint) * 10000 / 256);
- aThemeColor.addTransformation({model::TransformationType::Tint, nTint});
+ aComplexColor.addTransformation({model::TransformationType::Tint, nTint});
}
if (pThemeColorHandler->mnShade > 0)
{
sal_Int16 nShade = sal_Int16((256 - pThemeColorHandler->mnShade) * 10000 / 256);
- aThemeColor.addTransformation({model::TransformationType::Shade, nShade});
+ aComplexColor.addTransformation({model::TransformationType::Shade, nShade});
}
- auto xThemeColor = model::theme::createXThemeColor(aThemeColor);
- m_pImpl->GetTopContext()->Insert(PROP_CHAR_COLOR_THEME_REFERENCE, uno::Any(xThemeColor));
+ auto xComplexColor = model::color::createXComplexColor(aComplexColor);
+ m_pImpl->GetTopContext()->Insert(PROP_CHAR_COMPLEX_COLOR, uno::Any(xComplexColor));
}
uno::Any aColorAny(msfilter::util::ConvertColorOU(Color(ColorTransparency, pThemeColorHandler->mnColor)));
diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx
index 98525149fcf9..31151ac6c229 100644
--- a/writerfilter/source/dmapper/PropertyIds.cxx
+++ b/writerfilter/source/dmapper/PropertyIds.cxx
@@ -32,7 +32,7 @@ OUString getPropertyName( PropertyIds eId )
case PROP_CHAR_SHADOWED: sName = "CharShadowed"; break;
case PROP_CHAR_CASE_MAP: sName = "CharCaseMap"; break;
case PROP_CHAR_COLOR: sName = "CharColor"; break;
- case PROP_CHAR_COLOR_THEME_REFERENCE: sName = "CharColorThemeReference"; break;
+ case PROP_CHAR_COMPLEX_COLOR: sName = "CharComplexColor"; break;
case PROP_CHAR_RELIEF: sName = "CharRelief"; break;
case PROP_CHAR_UNDERLINE: sName = "CharUnderline"; break;
case PROP_CHAR_UNDERLINE_COLOR: sName = "CharUnderlineColor"; break;
diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx
index 52b989bf41c9..0aaf9a5d893d 100644
--- a/writerfilter/source/dmapper/PropertyIds.hxx
+++ b/writerfilter/source/dmapper/PropertyIds.hxx
@@ -54,7 +54,7 @@ enum PropertyIds
,PROP_CHAR_CASE_MAP
,PROP_CHAR_CHAR_KERNING
,PROP_CHAR_COLOR
- ,PROP_CHAR_COLOR_THEME_REFERENCE
+ ,PROP_CHAR_COMPLEX_COLOR
,PROP_CHAR_COMBINE_IS_ON
,PROP_CHAR_COMBINE_PREFIX
,PROP_CHAR_COMBINE_SUFFIX
diff --git a/writerfilter/source/dmapper/ThemeColorHandler.hxx b/writerfilter/source/dmapper/ThemeColorHandler.hxx
index 88ae0cfaf418..012b4ee3472f 100644
--- a/writerfilter/source/dmapper/ThemeColorHandler.hxx
+++ b/writerfilter/source/dmapper/ThemeColorHandler.hxx
@@ -17,7 +17,7 @@
#include "PropertyIds.hxx"
#include <oox/helper/grabbagstack.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <memory>
#include <optional>
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";
diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx
index e412a13c2833..716a1ad1cc7c 100644
--- a/xmloff/qa/unit/draw.cxx
+++ b/xmloff/qa/unit/draw.cxx
@@ -28,7 +28,7 @@
#include <svx/unopage.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdomedia.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <docmodel/uno/UnoTheme.hxx>
#include <docmodel/theme/Theme.hxx>
@@ -292,17 +292,16 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColorExportImport)
uno::Reference<drawing::XShape> xShape(getShape(0));
CPPUNIT_ASSERT(xShape.is());
uno::Reference<beans::XPropertySet> xShapeProperties(xShape, uno::UNO_QUERY);
- uno::Reference<util::XThemeColor> xThemeColor;
- xShapeProperties->getPropertyValue("FillColorThemeReference") >>= xThemeColor;
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent2, aThemeColor.getType());
- CPPUNIT_ASSERT_EQUAL(size_t(2), aThemeColor.getTransformations().size());
- auto const& rTrans1 = aThemeColor.getTransformations()[0];
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xShapeProperties->getPropertyValue("FillComplexColor") >>= xComplexColor;
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent2, aComplexColor.getSchemeType());
+ CPPUNIT_ASSERT_EQUAL(size_t(2), aComplexColor.getTransformations().size());
+ auto const& rTrans1 = aComplexColor.getTransformations()[0];
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), rTrans1.mnValue);
- auto const& rTrans2 = aThemeColor.getTransformations()[1];
+ auto const& rTrans2 = aComplexColor.getTransformations()[1];
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), rTrans2.mnValue);
}
@@ -310,17 +309,16 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColorExportImport)
uno::Reference<drawing::XShape> xShape(getShape(1));
CPPUNIT_ASSERT(xShape.is());
uno::Reference<beans::XPropertySet> xShapeProperties(xShape, uno::UNO_QUERY);
- uno::Reference<util::XThemeColor> xThemeColor;
- xShapeProperties->getPropertyValue("FillColorThemeReference") >>= xThemeColor;
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent2, aThemeColor.getType());
- CPPUNIT_ASSERT_EQUAL(size_t(2), aThemeColor.getTransformations().size());
- auto const& rTrans1 = aThemeColor.getTransformations()[0];
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xShapeProperties->getPropertyValue("FillComplexColor") >>= xComplexColor;
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent2, aComplexColor.getSchemeType());
+ CPPUNIT_ASSERT_EQUAL(size_t(2), aComplexColor.getTransformations().size());
+ auto const& rTrans1 = aComplexColor.getTransformations()[0];
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans1.mnValue);
- auto const& rTrans2 = aThemeColor.getTransformations()[1];
+ auto const& rTrans2 = aComplexColor.getTransformations()[1];
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans2.mnValue);
}
@@ -328,14 +326,13 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColorExportImport)
uno::Reference<drawing::XShape> xShape(getShape(2));
CPPUNIT_ASSERT(xShape.is());
uno::Reference<beans::XPropertySet> xShapeProperties(xShape, uno::UNO_QUERY);
- uno::Reference<util::XThemeColor> xThemeColor;
- xShapeProperties->getPropertyValue("FillColorThemeReference") >>= xThemeColor;
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent2, aThemeColor.getType());
- CPPUNIT_ASSERT_EQUAL(size_t(1), aThemeColor.getTransformations().size());
- auto const& rTrans1 = aThemeColor.getTransformations()[0];
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xShapeProperties->getPropertyValue("FillComplexColor") >>= xComplexColor;
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent2, aComplexColor.getSchemeType());
+ CPPUNIT_ASSERT_EQUAL(size_t(1), aComplexColor.getTransformations().size());
+ auto const& rTrans1 = aComplexColor.getTransformations()[0];
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(5000), rTrans1.mnValue);
}
@@ -348,17 +345,17 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColorExportImport)
CPPUNIT_ASSERT(xShape.is());
uno::Reference<beans::XPropertySet> xPortion = getShapeTextPortion(0, xShape);
CPPUNIT_ASSERT(xPortion.is());
- uno::Reference<util::XThemeColor> xThemeColor;
- xPortion->getPropertyValue("CharColorThemeReference") >>= xThemeColor;
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent3, aThemeColor.getType());
- CPPUNIT_ASSERT_EQUAL(size_t(2), aThemeColor.getTransformations().size());
- auto const& rTrans1 = aThemeColor.getTransformations()[0];
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xPortion->getPropertyValue("CharComplexColor") >>= xComplexColor;
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent3, aComplexColor.getSchemeType());
+ auto const& rTransforms = aComplexColor.getTransformations();
+ CPPUNIT_ASSERT_EQUAL(size_t(2), rTransforms.size());
+ auto const& rTrans1 = rTransforms[0];
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), rTrans1.mnValue);
- auto const& rTrans2 = aThemeColor.getTransformations()[1];
+ auto const& rTrans2 = rTransforms[1];
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), rTrans2.mnValue);
}
@@ -369,17 +366,17 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColorExportImport)
CPPUNIT_ASSERT(xShape.is());
uno::Reference<beans::XPropertySet> xPortion = getShapeTextPortion(0, xShape);
CPPUNIT_ASSERT(xPortion.is());
- uno::Reference<util::XThemeColor> xThemeColor;
- xPortion->getPropertyValue("CharColorThemeReference") >>= xThemeColor;
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent3, aThemeColor.getType());
- CPPUNIT_ASSERT_EQUAL(size_t(2), aThemeColor.getTransformations().size());
- auto const& rTrans1 = aThemeColor.getTransformations()[0];
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xPortion->getPropertyValue("CharComplexColor") >>= xComplexColor;
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent3, aComplexColor.getSchemeType());
+ auto const& rTransforms = aComplexColor.getTransformations();
+ CPPUNIT_ASSERT_EQUAL(size_t(2), rTransforms.size());
+ auto const& rTrans1 = rTransforms[0];
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), rTrans1.mnValue);
- auto const& rTrans2 = aThemeColor.getTransformations()[1];
+ auto const& rTrans2 = rTransforms[1];
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff, rTrans2.meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), rTrans2.mnValue);
}
@@ -390,14 +387,13 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColorExportImport)
CPPUNIT_ASSERT(xShape.is());
uno::Reference<beans::XPropertySet> xPortion = getShapeTextPortion(0, xShape);
CPPUNIT_ASSERT(xPortion.is());
- uno::Reference<util::XThemeColor> xThemeColor;
- xPortion->getPropertyValue("CharColorThemeReference") >>= xThemeColor;
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent3, aThemeColor.getType());
- CPPUNIT_ASSERT_EQUAL(size_t(1), aThemeColor.getTransformations().size());
- auto const& rTrans1 = aThemeColor.getTransformations()[0];
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xPortion->getPropertyValue("CharComplexColor") >>= xComplexColor;
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent3, aComplexColor.getSchemeType());
+ CPPUNIT_ASSERT_EQUAL(size_t(1), aComplexColor.getTransformations().size());
+ auto const& rTrans1 = aComplexColor.getTransformations()[0];
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod, rTrans1.meType);
CPPUNIT_ASSERT_EQUAL(sal_Int16(5000), rTrans1.mnValue);
}
@@ -414,16 +410,15 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeColor_ShapeFill)
uno::Reference<drawing::XShape> xShape(getShape(0));
CPPUNIT_ASSERT(xShape.is());
uno::Reference<beans::XPropertySet> xShapeProperties(xShape, uno::UNO_QUERY);
- uno::Reference<util::XThemeColor> xThemeColor;
- xShapeProperties->getPropertyValue("FillColorThemeReference") >>= xThemeColor;
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent6, aThemeColor.getType());
- CPPUNIT_ASSERT_EQUAL(size_t(1), aThemeColor.getTransformations().size());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ xShapeProperties->getPropertyValue("FillComplexColor") >>= xComplexColor;
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent6, aComplexColor.getSchemeType());
+ CPPUNIT_ASSERT_EQUAL(size_t(1), aComplexColor.getTransformations().size());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod,
- aThemeColor.getTransformations()[0].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(7500), aThemeColor.getTransformations()[0].mnValue);
+ aComplexColor.getTransformations()[0].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(7500), aComplexColor.getTransformations()[0].mnValue);
}
CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testTableInShape)
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index b35fa86b9ef3..bca1d6eccc0f 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3492,8 +3492,8 @@ namespace xmloff::token {
TOKEN("linked-style-name", XML_LINKED_STYLE_NAME ),
TOKEN("theme", XML_THEME ),
- TOKEN("char-color-theme-reference", XML_CHAR_COLOR_THEME_REFERENCE),
- TOKEN("fill-color-theme-reference", XML_FILL_COLOR_THEME_REFERENCE),
+ TOKEN("char-color-theme-reference", XML_CHAR_COMPLEX_COLOR),
+ TOKEN("fill-color-theme-reference", XML_FILL_COMPLEX_COLOR),
TOKEN("dk1", XML_DK1 ),
TOKEN("lt1", XML_LT1 ),
TOKEN("dk2", XML_DK2 ),
diff --git a/xmloff/source/draw/XMLShapePropertySetContext.cxx b/xmloff/source/draw/XMLShapePropertySetContext.cxx
index 471a22d2a098..9db7cac43464 100644
--- a/xmloff/source/draw/XMLShapePropertySetContext.cxx
+++ b/xmloff/source/draw/XMLShapePropertySetContext.cxx
@@ -83,7 +83,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLShapePropertySetCon
case CTF_TEXTCOLUMNS:
return new XMLTextColumnsContext(GetImport(), nElement, xAttrList, rProp, rProperties);
- case CTF_THEME_COLOR:
+ case CTF_COMPLEX_COLOR:
return new XMLThemeColorContext(GetImport(), nElement, xAttrList, rProp, rProperties);
}
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 03e37c97bc2e..0555914f09a0 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -109,7 +109,7 @@ const XMLPropertyMapEntry aXMLSDProperties[] =
GMAP( PROP_FillStyle, XML_NAMESPACE_DRAW, XML_FILL, XML_SD_TYPE_FILLSTYLE, CTF_FILLSTYLE ),
GMAP_D(PROP_FillColor, XML_NAMESPACE_DRAW, XML_FILL_COLOR, XML_TYPE_COLOR, CTF_FILLCOLOR ),
GMAP_D(PROP_FillColor2, XML_NAMESPACE_DRAW, XML_SECONDARY_FILL_COLOR, XML_TYPE_COLOR, 0),
- GMAPV( PROP_FillColorThemeReference, XML_NAMESPACE_LO_EXT, XML_FILL_COLOR_THEME_REFERENCE, XML_TYPE_THEME_COLOR|MID_FLAG_ELEMENT_ITEM, CTF_THEME_COLOR, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED),
+ GMAPV( PROP_FillComplexColor, XML_NAMESPACE_LO_EXT, XML_FILL_COMPLEX_COLOR, XML_TYPE_COMPLEX_COLOR|MID_FLAG_ELEMENT_ITEM, CTF_COMPLEX_COLOR, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED),
GMAP( PROP_FillGradientName, XML_NAMESPACE_DRAW, XML_FILL_GRADIENT_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_FILLGRADIENTNAME ),
GMAP( PROP_FillGradientStepCount, XML_NAMESPACE_DRAW, XML_GRADIENT_STEP_COUNT, XML_TYPE_NUMBER16, 0 ),
GMAP( PROP_FillHatchName, XML_NAMESPACE_DRAW, XML_FILL_HATCH_NAME, XML_TYPE_STYLENAME|MID_FLAG_NO_PROPERTY_IMPORT, CTF_FILLHATCHNAME ),
@@ -1307,8 +1307,8 @@ const XMLPropertyHandler* XMLSdPropHdlFactory::GetPropertyHandler( sal_Int32 nTy
case XML_TYPE_TEXT_COLUMNS:
pHdl = new XMLTextColumnsPropertyHandler;
break;
- case XML_TYPE_THEME_COLOR:
- pHdl = new XMLThemeColorHandler;
+ case XML_TYPE_COMPLEX_COLOR:
+ pHdl = new XMLComplexColorHandler;
break;
}
diff --git a/xmloff/source/text/XMLTextPropertySetContext.cxx b/xmloff/source/text/XMLTextPropertySetContext.cxx
index fd87f837dbf7..2f8398b76cf2 100644
--- a/xmloff/source/text/XMLTextPropertySetContext.cxx
+++ b/xmloff/source/text/XMLTextPropertySetContext.cxx
@@ -69,7 +69,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTextPropertySetCont
rProperties );
break;
- case CTF_THEME_COLOR:
+ case CTF_COMPLEX_COLOR:
return new XMLThemeColorContext(GetImport(), nElement, xAttrList, rProp, rProperties);
break;
diff --git a/xmloff/source/text/XMLTextShapeStyleContext.cxx b/xmloff/source/text/XMLTextShapeStyleContext.cxx
index eeda57a558a8..b0ece39a2d82 100644
--- a/xmloff/source/text/XMLTextShapeStyleContext.cxx
+++ b/xmloff/source/text/XMLTextShapeStyleContext.cxx
@@ -90,7 +90,7 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > XMLTextShapePropertySe
rProperties );
break;
- case CTF_THEME_COLOR:
+ case CTF_COMPLEX_COLOR:
return new XMLThemeColorContext(GetImport(), nElement, xAttrList, rProp, rProperties);
case CTF_BACKGROUND_URL:
diff --git a/xmloff/source/text/XMLThemeColorContext.cxx b/xmloff/source/text/XMLThemeColorContext.cxx
index c2cdd6cd35ce..aeea540bbdf3 100644
--- a/xmloff/source/text/XMLThemeColorContext.cxx
+++ b/xmloff/source/text/XMLThemeColorContext.cxx
@@ -45,7 +45,7 @@ XMLThemeColorContext::XMLThemeColorContext(
sal_Int16 nValue = -1;
if (SvXMLUnitConverter::convertEnum(nValue, aIter.toView(), pXML_ThemeColor_Enum))
{
- aThemeColor.setType(model::convertToThemeColorType(nValue));
+ maComplexColor.setSchemeColor(model::convertToThemeColorType(nValue));
}
break;
}
@@ -93,7 +93,7 @@ XMLThemeColorContext::createFastChildContext(
break;
}
}
- aThemeColor.addTransformation({ eTransformationType, nTransformationValue });
+ maComplexColor.addTransformation({ eTransformationType, nTransformationValue });
return this;
}
XMLOFF_WARN_UNKNOWN_ELEMENT("xmloff", nElement);
@@ -104,9 +104,9 @@ void XMLThemeColorContext::endFastElement(sal_Int32 nElement)
{
if (nElement == mnRootElement)
{
- if (aThemeColor.getType() != model::ThemeColorType::Unknown)
+ if (maComplexColor.getSchemeType() != model::ThemeColorType::Unknown)
{
- aProp.maValue <<= model::theme::createXThemeColor(aThemeColor);
+ aProp.maValue <<= model::color::createXComplexColor(maComplexColor);
SetInsert(true);
}
}
diff --git a/xmloff/source/text/XMLThemeColorExport.cxx b/xmloff/source/text/XMLThemeColorExport.cxx
index 2f90e74ffbcf..9a48faf63546 100644
--- a/xmloff/source/text/XMLThemeColorExport.cxx
+++ b/xmloff/source/text/XMLThemeColorExport.cxx
@@ -11,7 +11,7 @@
#include <sal/config.h>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmluconv.hxx>
@@ -37,21 +37,20 @@ constexpr const std::array<XMLTokenEnum, 12> constThemeColorTypeToToken{
void XMLThemeColorExport::exportXML(const uno::Any& rAny, sal_uInt16 nPrefix,
const OUString& rLocalName)
{
- uno::Reference<util::XThemeColor> xThemeColor;
- rAny >>= xThemeColor;
- if (!xThemeColor.is())
+ uno::Reference<util::XComplexColor> xComplexColor;
+ rAny >>= xComplexColor;
+ if (!xComplexColor.is())
return;
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- if (aThemeColor.getType() == model::ThemeColorType::Unknown)
+ model::ComplexColor aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ if (aComplexColor.getSchemeType() == model::ThemeColorType::Unknown)
return;
- XMLTokenEnum nToken = constThemeColorTypeToToken[sal_Int16(aThemeColor.getType())];
+ XMLTokenEnum nToken = constThemeColorTypeToToken[sal_Int16(aComplexColor.getSchemeType())];
mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_TYPE, nToken);
- SvXMLElementExport aThemeColorElement(mrExport, nPrefix, rLocalName, true, true);
+ SvXMLElementExport aComplexColorElement(mrExport, nPrefix, rLocalName, true, true);
- for (auto const& rTransform : aThemeColor.getTransformations())
+ for (auto const& rTransform : aComplexColor.getTransformations())
{
OUString aType;
switch (rTransform.meType)
diff --git a/xmloff/source/text/txtexppr.cxx b/xmloff/source/text/txtexppr.cxx
index a5e0d94b74cd..67f742b69b46 100644
--- a/xmloff/source/text/txtexppr.cxx
+++ b/xmloff/source/text/txtexppr.cxx
@@ -72,7 +72,7 @@ void XMLTextExportPropertySetMapper::handleElementItem(
pThis->maTextColumnsExport.exportXML( rProperty.maValue );
break;
- case CTF_THEME_COLOR:
+ case CTF_COMPLEX_COLOR:
pThis->maThemeColorExport.exportXML(rProperty.maValue,
getPropertySetMapper()->GetEntryNameSpace(rProperty.mnIndex),
getPropertySetMapper()->GetEntryXMLName(rProperty.mnIndex));
diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx
index 56d9642631b5..0755810efa4e 100644
--- a/xmloff/source/text/txtprhdl.cxx
+++ b/xmloff/source/text/txtprhdl.cxx
@@ -1412,8 +1412,8 @@ static const XMLPropertyHandler *GetPropertyHandler
case XML_TYPE_GRAPHIC:
pHdl = new XMLGraphicPropertyHandler;
break;
- case XML_TYPE_THEME_COLOR:
- pHdl = new XMLThemeColorHandler;
+ case XML_TYPE_COMPLEX_COLOR:
+ pHdl = new XMLComplexColorHandler;
break;
default:
{
diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx
index 1151eef64575..5d8ef1d3471e 100644
--- a/xmloff/source/text/txtprmap.cxx
+++ b/xmloff/source/text/txtprmap.cxx
@@ -139,7 +139,7 @@ XMLPropertyMapEntry constexpr aXMLParaPropMap[] =
MT_ED( PROP_CharColor, STYLE, USE_WINDOW_FONT_COLOR, XML_TYPE_ISAUTOCOLOR|MID_FLAG_MERGE_PROPERTY, 0 ),
MAP_EXT_I( PROP_CharTransparence, XML_NAMESPACE_DRAW, XML_OPACITY, XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0),
MAP_EXT( PROP_CharTransparence, XML_NAMESPACE_LO_EXT, XML_OPACITY, XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0),
- MAP_EXT( PROP_CharColorThemeReference, XML_NAMESPACE_LO_EXT, XML_CHAR_COLOR_THEME_REFERENCE, XML_TYPE_THEME_COLOR|XML_TYPE_PROP_TEXT|MID_FLAG_ELEMENT_ITEM, CTF_THEME_COLOR),
+ MAP_EXT( PROP_CharComplexColor, XML_NAMESPACE_LO_EXT, XML_CHAR_COMPLEX_COLOR, XML_TYPE_COMPLEX_COLOR|XML_TYPE_PROP_TEXT|MID_FLAG_ELEMENT_ITEM, CTF_COMPLEX_COLOR),
// RES_CHRATR_CONTOUR
MT_E( PROP_CharContoured, STYLE, TEXT_OUTLINE, XML_TYPE_BOOL, 0 ),
// RES_CHRATR_CROSSEDOUT
@@ -490,7 +490,7 @@ XMLPropertyMapEntry constexpr aXMLTextPropMap[] =
MT_ED( PROP_CharColor, STYLE, USE_WINDOW_FONT_COLOR, XML_TYPE_ISAUTOCOLOR|MID_FLAG_MERGE_PROPERTY, 0 ),
MAP_EXT_I( PROP_CharTransparence, XML_NAMESPACE_DRAW, XML_OPACITY, XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0),
MAP_EXT( PROP_CharTransparence, XML_NAMESPACE_LO_EXT, XML_OPACITY, XML_TYPE_NEG_PERCENT16 | XML_TYPE_PROP_TEXT, 0),
- MAP_EXT( PROP_CharColorThemeReference, XML_NAMESPACE_LO_EXT, XML_CHAR_COLOR_THEME_REFERENCE, XML_TYPE_THEME_COLOR|XML_TYPE_PROP_TEXT|MID_FLAG_ELEMENT_ITEM, CTF_THEME_COLOR),
+ MAP_EXT( PROP_CharComplexColor, XML_NAMESPACE_LO_EXT, XML_CHAR_COMPLEX_COLOR, XML_TYPE_COMPLEX_COLOR|XML_TYPE_PROP_TEXT|MID_FLAG_ELEMENT_ITEM, CTF_COMPLEX_COLOR),
// RES_CHRATR_CONTOUR
MT_E( PROP_CharContoured, STYLE, TEXT_OUTLINE, XML_TYPE_BOOL, 0 ),
// RES_CHRATR_CROSSEDOUT
@@ -1038,7 +1038,7 @@ XMLPropertyMapEntry constexpr aXMLCellPropMap[] =
// text properties
MT_ED( PROP_CharColor, FO, COLOR, XML_TYPE_COLORAUTO|MID_FLAG_MERGE_PROPERTY, 0 ),
MT_ED( PROP_CharColor, STYLE, USE_WINDOW_FONT_COLOR, XML_TYPE_ISAUTOCOLOR|MID_FLAG_MERGE_PROPERTY, 0 ),
- MAP_EXT( PROP_CharColorThemeReference, XML_NAMESPACE_LO_EXT, XML_CHAR_COLOR_THEME_REFERENCE, XML_TYPE_THEME_COLOR|XML_TYPE_PROP_TEXT|MID_FLAG_ELEMENT_ITEM, CTF_THEME_COLOR),
+ MAP_EXT( PROP_CharComplexColor, XML_NAMESPACE_LO_EXT, XML_CHAR_COMPLEX_COLOR, XML_TYPE_COMPLEX_COLOR|XML_TYPE_PROP_TEXT|MID_FLAG_ELEMENT_ITEM, CTF_COMPLEX_COLOR),
MT_E( PROP_CharShadowed, FO, TEXT_SHADOW, XML_TYPE_TEXT_SHADOWED, 0 ),
MT_E( PROP_CharContoured, STYLE, TEXT_OUTLINE, XML_TYPE_BOOL, 0 ),
MT_E( PROP_CharStrikeout, STYLE, TEXT_LINE_THROUGH_STYLE, XML_TYPE_TEXT_CROSSEDOUT_STYLE|MID_FLAG_MERGE_PROPERTY, 0 ),