summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-06-27 13:46:51 +0200
committerArmin Le Grand <Armin.Le.Grand@me.com>2023-06-27 18:37:16 +0200
commit3b06c1835e9fcbbcdcd6ce2b207301f4f8bb6388 (patch)
tree5b1e78a4a9cb6360969f30d63cbd74daef42d030
parent983644d061e1415c7c5554dd6fd51fe1043e9b9a (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>
-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 b774848cc3a4..eae5980bf56c 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2295,6 +2295,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));
@@ -2391,8 +2396,7 @@ void VclMetafileProcessor2D::processTransparencePrimitive2D(
// tdf#155479 Yepp, as already mentioned 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;
@@ -2411,11 +2415,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));