summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-07-29 15:48:35 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2023-08-28 12:41:14 +0200
commitfce4cd66c7544ab1202ebf2b732c29e40272ef8a (patch)
tree7465770191d3f97be87f0528953ca0e04c027b31
parent2f9385f184f39d70d55c301a1173dc5eedd60979 (diff)
set finalColor of the ComplexColor in BorderLine and BrushItem
The final color is stored inside the ComplexColor and is used to represent the final computed color from theme color and/or transforms. Change-Id: I405615bba144bfe876b75c565746d9eebc88e973 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155111 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 614dfb98cd4705b63bf1e525d3d34df9ce950ebb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156104 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--include/editeng/borderline.hxx4
-rw-r--r--include/editeng/brushitem.hxx2
-rw-r--r--include/svx/Palette.hxx11
3 files changed, 13 insertions, 4 deletions
diff --git a/include/editeng/borderline.hxx b/include/editeng/borderline.hxx
index eb7d2f0f4f8e..596b8b59f413 100644
--- a/include/editeng/borderline.hxx
+++ b/include/editeng/borderline.hxx
@@ -172,8 +172,11 @@ public:
model::ComplexColor const& getComplexColor() const
{
+ auto pUnConst = const_cast<SvxBorderLine*>(this);
+ pUnConst->m_aComplexColor.setFinalColor(GetColor());
return m_aComplexColor;
}
+
void setComplexColor(model::ComplexColor const& rComplexColor)
{
m_aComplexColor = rComplexColor;
@@ -258,4 +261,3 @@ EDITENG_DLLPUBLIC bool operator!=( const SvxBorderLine& rLeft, const SvxBorderLi
} // namespace editeng
#endif
-
diff --git a/include/editeng/brushitem.hxx b/include/editeng/brushitem.hxx
index b995c7fa0637..617aa43a4f24 100644
--- a/include/editeng/brushitem.hxx
+++ b/include/editeng/brushitem.hxx
@@ -93,6 +93,8 @@ public:
model::ComplexColor getComplexColor() const
{
+ auto pUnConst = const_cast<SvxBrushItem*>(this);
+ pUnConst->maComplexColor.setFinalColor(GetColor());
return maComplexColor;
}
diff --git a/include/svx/Palette.hxx b/include/svx/Palette.hxx
index 4858b47140c4..2778ff24c3fe 100644
--- a/include/svx/Palette.hxx
+++ b/include/svx/Palette.hxx
@@ -45,7 +45,8 @@ struct SVXCORE_DLLPUBLIC NamedColor
NamedColor(Color const& rColor, OUString const& rName)
: m_aColor(rColor)
, m_aName(rName)
- {}
+ {
+ }
model::ComplexColor getComplexColor()
{
@@ -58,10 +59,14 @@ struct SVXCORE_DLLPUBLIC NamedColor
aComplexColor.setSchemeColor(eThemeColorType);
if (m_nLumMod != 10000)
- aComplexColor.addTransformation({model::TransformationType::LumMod, m_nLumMod});
+ aComplexColor.addTransformation({ model::TransformationType::LumMod, m_nLumMod });
if (m_nLumMod != 0)
- aComplexColor.addTransformation({model::TransformationType::LumOff, m_nLumOff});
+ aComplexColor.addTransformation({ model::TransformationType::LumOff, m_nLumOff });
+ }
+ else
+ {
+ aComplexColor.setColor(m_aColor);
}
aComplexColor.setFinalColor(m_aColor);