summaryrefslogtreecommitdiff
path: root/filter/source/msfilter/escherex.cxx
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-01-15 14:49:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-16 10:07:07 +0100
commit63a68064bb33f180b8a231f7524d99405d910226 (patch)
tree7ecf05b057c5ca4d80a48af045998a4b34484561 /filter/source/msfilter/escherex.cxx
parentd534a4c7b45ff254b339e806c6a11f13d9ff0043 (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 'filter/source/msfilter/escherex.cxx')
-rw-r--r--filter/source/msfilter/escherex.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 5df267f3f954..31d382796f43 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -376,12 +376,12 @@ sal_uInt32 EscherPropertyContainer::GetGradientColor(
if ( nStartColor & 1 )
{
nIntensity = pGradient->StartIntensity;
- aColor = Color(pGradient->StartColor);
+ aColor = Color(ColorTransparency, pGradient->StartColor);
}
else
{
nIntensity = pGradient->EndIntensity;
- aColor = Color(pGradient->EndColor);
+ aColor = Color(ColorTransparency, pGradient->EndColor);
}
}
sal_uInt32 nRed = ( aColor.GetRed() * nIntensity ) / 100;
@@ -1452,7 +1452,7 @@ Graphic lclDrawHatch( const drawing::Hatch& rHatch, const Color& rBackColor, boo
pVDev->SetLineColor();
pVDev->SetFillColor(bFillBackground ? rBackColor : COL_TRANSPARENT);
pVDev->DrawRect(rRect);
- pVDev->DrawHatch(tools::PolyPolygon(rRect), Hatch(static_cast<HatchStyle>(rHatch.Style), Color(rHatch.Color), rHatch.Distance,
+ pVDev->DrawHatch(tools::PolyPolygon(rRect), Hatch(static_cast<HatchStyle>(rHatch.Style), Color(ColorTransparency, rHatch.Color), rHatch.Distance,
Degree10(rHatch.Angle)));
aMtf.Stop();
aMtf.WindStart();
@@ -1547,7 +1547,7 @@ bool EscherPropertyContainer::CreateGraphicProperties(const uno::Reference<beans
Color aBackColor;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "FillColor" ) )
{
- aBackColor = Color(ImplGetColor( *o3tl::doAccess<sal_uInt32>(aAny), false ));
+ aBackColor = Color(ColorTransparency, ImplGetColor( *o3tl::doAccess<sal_uInt32>(aAny), false ));
}
bool bFillBackground = false;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "FillBackground", true ) )