summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-06-27 13:46:51 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-06-28 13:10:46 +0200
commit170a3cfa47e2e4ec83ec91d654601894e246b9d2 (patch)
treeeb2c3860b6c12184a314b423b41910d2d15783cc /drawinglayer
parent2283c4b74eac46ff727145da0a7e593bcc3eae3e (diff)
MCGR: tdf#155479 always propagate SVG-flag for sub-content metafiles
For SVG export it is necessary to always propagate the SVG-flag for metafiles in *any* case impDumpToMetaFile is used and a new metafile gets created (aContentMetafile here). This is due to the subContent again may have any combinations of gradients/transparenceGradients that are non-vcl-renderable and need special handling. Change-Id: I7edee8afa81c0b6f3fb0e183d144c50f29c5bb79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153645 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> (cherry picked from commit 3b06c1835e9fcbbcdcd6ce2b207301f4f8bb6388) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153666 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index feb30d33e1ed..e55055024159 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2293,6 +2293,11 @@ void VclMetafileProcessor2D::processUnifiedTransparencePrimitive2D(
// various content, create content-metafile
GDIMetaFile aContentMetafile;
+
+ // tdf#155479 always forward propagate SVG flag for sub-content,
+ // it may contain cannotBeHandledByVCL gradients or transparencyGradients
+ aContentMetafile.setSVG(mpOutputDevice->GetConnectMetaFile()->getSVG());
+
const tools::Rectangle aPrimitiveRectangle(
impDumpToMetaFile(rContent, aContentMetafile));
@@ -2389,8 +2394,7 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
// tdf#155479 Yepp, as already mentionmed above we need to add
// some MCGR infos in case of SVG export, prepare that here
- if (nullptr != mpOutputDevice->GetConnectMetaFile()
- && mpOutputDevice->GetConnectMetaFile()->getSVG())
+ if (mpOutputDevice->GetConnectMetaFile()->getSVG())
{
// for SVG, do not use decompose & prep extra data
bSVGTransparencyColorStops = true;
@@ -2409,11 +2413,9 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
// vcl/metafile, so add it directly. various content, create content-metafile
GDIMetaFile aContentMetafile;
- // tdf#155479 do not forget to forward SVG flag for sub-content
- if (bSVGTransparencyColorStops)
- {
- aContentMetafile.setSVG(true);
- }
+ // tdf#155479 always forward propagate SVG flag for sub-content,
+ // it may contain cannotBeHandledByVCL gradients or transparencyGradients
+ aContentMetafile.setSVG(mpOutputDevice->GetConnectMetaFile()->getSVG());
const tools::Rectangle aPrimitiveRectangle(impDumpToMetaFile(rContent, aContentMetafile));