diff options
Diffstat (limited to 'svgio/source')
-rw-r--r-- | svgio/source/svgreader/svganode.cxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgcirclenode.cxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgellipsenode.cxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svggnode.cxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgimagenode.cxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svglinenode.cxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgpathnode.cxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgpolynode.cxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgrectnode.cxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgstyleattributes.cxx | 46 | ||||
-rw-r--r-- | svgio/source/svgreader/svgtextnode.cxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgusenode.cxx | 2 |
12 files changed, 32 insertions, 36 deletions
diff --git a/svgio/source/svgreader/svganode.cxx b/svgio/source/svgreader/svganode.cxx index 83dd7c50175e..e700574c5a40 100644 --- a/svgio/source/svgreader/svganode.cxx +++ b/svgio/source/svgreader/svganode.cxx @@ -94,7 +94,7 @@ namespace svgio::svgreader if(!aContent.empty()) { - pStyle->add_postProcess(rTarget, std::move(aContent), getTransform(), true); + pStyle->add_postProcess(rTarget, std::move(aContent), getTransform()); } } } diff --git a/svgio/source/svgreader/svgcirclenode.cxx b/svgio/source/svgreader/svgcirclenode.cxx index 363e85d111ab..513c128cf272 100644 --- a/svgio/source/svgreader/svgcirclenode.cxx +++ b/svgio/source/svgreader/svgcirclenode.cxx @@ -135,7 +135,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform(), true); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } // end of namespace svgio::svgreader diff --git a/svgio/source/svgreader/svgellipsenode.cxx b/svgio/source/svgreader/svgellipsenode.cxx index a822ef7134f0..8f203fc49869 100644 --- a/svgio/source/svgreader/svgellipsenode.cxx +++ b/svgio/source/svgreader/svgellipsenode.cxx @@ -150,7 +150,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform(), true); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } // end of namespace svgio::svgreader diff --git a/svgio/source/svgreader/svggnode.cxx b/svgio/source/svgreader/svggnode.cxx index e59db2972e13..d833a6fa92c4 100644 --- a/svgio/source/svgreader/svggnode.cxx +++ b/svgio/source/svgreader/svggnode.cxx @@ -97,7 +97,7 @@ namespace svgio::svgreader if(!aContent.empty()) { - pStyle->add_postProcess(rTarget, std::move(aContent), getTransform(), false); + pStyle->add_postProcess(rTarget, std::move(aContent), getTransform()); } } } diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index fa7cbe675a13..2ce6ce4c8038 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -340,7 +340,7 @@ namespace svgio::svgreader } // embed and add to rTarget, take local extra-transform into account - pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform(), true); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } // end of namespace svgio::svgreader diff --git a/svgio/source/svgreader/svglinenode.cxx b/svgio/source/svgreader/svglinenode.cxx index 7f433c7f6fc1..ea1ab343ff53 100644 --- a/svgio/source/svgreader/svglinenode.cxx +++ b/svgio/source/svgreader/svglinenode.cxx @@ -145,7 +145,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform(), true); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } // end of namespace svgio::svgreader diff --git a/svgio/source/svgreader/svgpathnode.cxx b/svgio/source/svgreader/svgpathnode.cxx index f34d4d3198c8..d52114aa6da8 100644 --- a/svgio/source/svgreader/svgpathnode.cxx +++ b/svgio/source/svgreader/svgpathnode.cxx @@ -108,7 +108,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform(), true); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } diff --git a/svgio/source/svgreader/svgpolynode.cxx b/svgio/source/svgreader/svgpolynode.cxx index 38a908a18756..74cd722915e4 100644 --- a/svgio/source/svgreader/svgpolynode.cxx +++ b/svgio/source/svgreader/svgpolynode.cxx @@ -105,7 +105,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform(), true); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } diff --git a/svgio/source/svgreader/svgrectnode.cxx b/svgio/source/svgreader/svgrectnode.cxx index 782887be9f35..291d8540912f 100644 --- a/svgio/source/svgreader/svgrectnode.cxx +++ b/svgio/source/svgreader/svgrectnode.cxx @@ -207,7 +207,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform(), true); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } } // end of namespace svgio::svgreader diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index 91c27aeff637..fd4482057f17 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -1163,8 +1163,7 @@ namespace svgio::svgreader void SvgStyleAttributes::add_postProcess( drawinglayer::primitive2d::Primitive2DContainer& rTarget, drawinglayer::primitive2d::Primitive2DContainer&& rSource, - const std::optional<basegfx::B2DHomMatrix>& pTransform, - bool bIsPrimitive) const + const std::optional<basegfx::B2DHomMatrix>& pTransform) const { const double fOpacity(getOpacity().solve(mrOwner)); @@ -1175,20 +1174,15 @@ namespace svgio::svgreader drawinglayer::primitive2d::Primitive2DContainer aSource(std::move(rSource)); - // tdf#97717: only apply opacity when it's a primitive, otherwise, it might be - // applied more than once, since getOpacity() checks the parents - if (bIsPrimitive) + if(basegfx::fTools::less(fOpacity, 1.0)) { - if(basegfx::fTools::less(fOpacity, 1.0)) - { - // embed in UnifiedTransparencePrimitive2D - const drawinglayer::primitive2d::Primitive2DReference xRef( - new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( - std::move(aSource), - 1.0 - fOpacity)); + // embed in UnifiedTransparencePrimitive2D + const drawinglayer::primitive2d::Primitive2DReference xRef( + new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D( + std::move(aSource), + 1.0 - fOpacity)); - aSource = drawinglayer::primitive2d::Primitive2DContainer { xRef }; - } + aSource = drawinglayer::primitive2d::Primitive2DContainer { xRef }; } if(pTransform) @@ -1291,7 +1285,7 @@ namespace svgio::svgreader maClipRule(FillRule::notset), maBaselineShift(BaselineShift::Baseline), maBaselineShiftNumber(0), - maResolvingParent(30, 0), + maResolvingParent(29, 0), mbIsClipPathContent(SVGToken::ClipPathNode == mrOwner.getType()), mbStrokeDasharraySet(false) { @@ -2282,14 +2276,16 @@ namespace svgio::svgreader return maOpacity; } - const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle(); - - if (pSvgStyleAttributes && maResolvingParent[8] < nStyleDepthLimit) + // This is called from add_postProcess so only check the parent style + // if it has a local css style, because it's the first in the stack + if(mrOwner.hasLocalCssStyle()) { - ++maResolvingParent[8]; - auto ret = pSvgStyleAttributes->getOpacity(); - --maResolvingParent[8]; - return ret; + const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle(); + + if (pSvgStyleAttributes && pSvgStyleAttributes->maOpacity.isSet()) + { + return pSvgStyleAttributes->maOpacity; + } } // default is 1 @@ -3051,11 +3047,11 @@ namespace svgio::svgreader { const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle(); - if (pSvgStyleAttributes && maResolvingParent[29] < nStyleDepthLimit) + if (pSvgStyleAttributes && maResolvingParent[8] < nStyleDepthLimit) { - ++maResolvingParent[29]; + ++maResolvingParent[8]; const SvgNumber aParentNumber = pSvgStyleAttributes->getBaselineShiftNumber(); - --maResolvingParent[29]; + --maResolvingParent[8]; return SvgNumber( aParentNumber.getNumber() * maBaselineShiftNumber.getNumber() * 0.01, diff --git a/svgio/source/svgreader/svgtextnode.cxx b/svgio/source/svgreader/svgtextnode.cxx index 35e130a097de..5b8cc3187070 100644 --- a/svgio/source/svgreader/svgtextnode.cxx +++ b/svgio/source/svgreader/svgtextnode.cxx @@ -251,7 +251,7 @@ namespace svgio::svgreader if(!aNewTarget.empty()) { - pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform(), true); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } diff --git a/svgio/source/svgreader/svgusenode.cxx b/svgio/source/svgreader/svgusenode.cxx index b0fed16c73eb..312f8152b058 100644 --- a/svgio/source/svgreader/svgusenode.cxx +++ b/svgio/source/svgreader/svgusenode.cxx @@ -172,7 +172,7 @@ namespace svgio::svgreader if(fOpacity > 0.0 && Display::None != getDisplay()) { - pStyle->add_postProcess(rTarget, std::move(aNewTarget), aTransform, false); + pStyle->add_postProcess(rTarget, std::move(aNewTarget), aTransform); } } } |