From 00fa364a2403dc23a786d3f91fde06e10b3a4a9a Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 23 Sep 2021 16:55:19 +0200 Subject: Related: tdf#144091 svx: fix interaction of transp cell fill and transp shadow This is a follow-up to commit 37a52d30bbfcf1d073779b50139c4dafa507be4b (tdf#144091 svx: fix unwanted blur of shadow from table cell fill, 2021-09-20), where it turned out that the original bugdoc was just a special case of almost full transparency (80%), that's why avoiding the blur fixed the problem. A more general approach instead is to multiply the alpha or the cell fill of table shapes and the alpha of the shadow itself. The end result is the same (80% transparency) for the first bugdoc, but this gives back the blur on the second bugdoc. Change-Id: I63560e3a73473c70157ecee8365ec7154217f269 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122532 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- svx/source/table/viewcontactoftableobj.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'svx/source/table/viewcontactoftableobj.cxx') diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index ae5b9ef9313c..39762d727089 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "tablelayouter.hxx" @@ -325,14 +326,21 @@ namespace sdr::contact aRetval.append(xCellReference); } - // Create cell primitive without text and blur. + // Create cell primitive without text. aAttribute = drawinglayer::primitive2d::createNewSdrFillTextAttribute( rCellItemSet, nullptr); rtl::Reference pCellReference = new drawinglayer::primitive2d::SdrCellPrimitive2D( aCellMatrix, aAttribute); - pCellReference->setExcludeFromBlur(true); + + sal_uInt16 nTransparence( + rCellItemSet.Get(XATTR_FILLTRANSPARENCE).GetValue()); + if (nTransparence != 0) + { + pCellReference->setTransparenceForShadow(nTransparence); + } + const drawinglayer::primitive2d::Primitive2DReference xCellReference(pCellReference); aRetvalForShadow.append(xCellReference); @@ -384,8 +392,7 @@ namespace sdr::contact aTransform, drawinglayer::primitive2d::Primitive2DContainer(aCellBorderPrimitives))); - // Borders are always the same for shadow as well, and implicitly included - // in blur. + // Borders are always the same for shadow as well. aRetvalForShadow.append(new drawinglayer::primitive2d::TransformPrimitive2D( aTransform, std::move(aCellBorderPrimitives))); } -- cgit