diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-01-15 14:49:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-16 10:07:07 +0100 |
commit | 63a68064bb33f180b8a231f7524d99405d910226 (patch) | |
tree | 7ecf05b057c5ca4d80a48af045998a4b34484561 /svtools/source/config | |
parent | d534a4c7b45ff254b339e806c6a11f13d9ff0043 (diff) |
make the Color constructors explicitly specify transparency
to reduce the churn, we leave the existing constructor in place,
and add a clang plugin to detect when the value passed to the
existing constructor may contain transparency/alpha data.
i.e. we leave expressions like Color(0xffffff) alone, but
warn about any non-constant expression, and any expression
like Color(0xff000000)
Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source/config')
-rw-r--r-- | svtools/source/config/colorcfg.cxx | 4 | ||||
-rw-r--r-- | svtools/source/config/optionsdrawinglayer.cxx | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index bbb2f3ba1cfc..6a17045de74a 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -225,9 +225,9 @@ void ColorConfig_Impl::Load(const OUString& rScheme) { if(pColors[nIndex].hasValue()) { - sal_Int32 nTmp(0); + Color nTmp; pColors[nIndex] >>= nTmp; - m_aConfigValues[i].nColor = Color(nTmp); + m_aConfigValues[i].nColor = nTmp; } else m_aConfigValues[i].nColor = COL_AUTO; diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx index 18a2ab4a00a7..f975ee9fc8af 100644 --- a/svtools/source/config/optionsdrawinglayer.cxx +++ b/svtools/source/config/optionsdrawinglayer.cxx @@ -332,18 +332,18 @@ SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() : case PROPERTYHANDLE_STRIPE_COLOR_A: { DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorA\"?" ); - sal_Int32 nValue = 0; + Color nValue; seqValues[nProperty] >>= nValue; - m_bStripeColorA = Color(nValue); + m_bStripeColorA = nValue; } break; case PROPERTYHANDLE_STRIPE_COLOR_B: { DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorB\"?" ); - sal_Int32 nValue = 0; + Color nValue; seqValues[nProperty] >>= nValue; - m_bStripeColorB = Color(nValue); + m_bStripeColorB = nValue; } break; |