diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/qa/unit/table.cxx | 14 | ||||
-rw-r--r-- | svx/source/sdr/primitive2d/sdrdecompositiontools.cxx | 13 |
2 files changed, 8 insertions, 19 deletions
diff --git a/svx/qa/unit/table.cxx b/svx/qa/unit/table.cxx index dc3ad1e2bf67..72359dbc7820 100644 --- a/svx/qa/unit/table.cxx +++ b/svx/qa/unit/table.cxx @@ -73,17 +73,15 @@ CPPUNIT_TEST_FIXTURE(Test, testTableShadowBlur) drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence = renderPageToPrimitives(xDrawPage); - // Then make sure that the cell fill part of the shadow is excluded from blurring: + // Then make sure that the cell fill part of the shadow has the expected transparency: drawinglayer::Primitive2dXmlDump aDumper; xmlDocUniquePtr pDocument = aDumper.dumpAndParse(xPrimitiveSequence); // Without the accompanying fix in place, this test would have failed with: - // - number of nodes is incorrect - // - Expected: 1 - // - Actual : 0 - // i.e. the shadow itself was not transparent and that resulted in a non-transparent rendering - // as well, while the rendering transparency should be based on the transparency of the shadow - // itself and the transparency of the cell fill. - assertXPath(pDocument, "//objectinfo/unifiedtransparence[1]", "transparence", "80"); + //- Expected: 0 + //- Actual : 2 + //- In <>, XPath contents of child does not match + // i.e. the shadow's transparency was miscalculated. + assertXPathContent(pDocument, "count(//objectinfo/unifiedtransparence)", "0"); } CPPUNIT_TEST_FIXTURE(Test, testSvxTableControllerSetAttrToSelectedShape) diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx index b5df830d73fe..33e42efc6d23 100644 --- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx +++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx @@ -850,25 +850,16 @@ sal_uInt32 SlideBackgroundFillPrimitive2D::getPrimitive2DID() const Primitive2DContainer aRetval; for (const auto& xChild : rContentForShadow) { - double fChildTransparence = 0.0; - auto pChild = dynamic_cast<BufferedDecompositionPrimitive2D*>(xChild.get()); - if (pChild) - { - fChildTransparence = pChild->getTransparenceForShadow(); - fChildTransparence /= 100; - } aRetval.push_back(Primitive2DReference( new ShadowPrimitive2D(aShadowOffset, rShadow.getColor(), rShadow.getBlur(), Primitive2DContainer({ xChild })))); - if (rShadow.getTransparence() != 0.0 || fChildTransparence != 0.0) + if (rShadow.getTransparence() != 0.0) { Primitive2DContainer aTempContent{ aRetval.back() }; - double fChildAlpha = 1.0 - fChildTransparence; double fShadowAlpha = 1.0 - rShadow.getTransparence(); - double fTransparence = 1.0 - fChildAlpha * fShadowAlpha; aRetval.back() = Primitive2DReference(new UnifiedTransparencePrimitive2D( - std::move(aTempContent), fTransparence)); + std::move(aTempContent), fShadowAlpha)); } } |