drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |   16 +++++++------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 3b06c1835e9fcbbcdcd6ce2b207301f4f8bb6388
Author:     Armin Le Grand (allotropia) <armin.le.grand.ext...@allotropia.de>
AuthorDate: Tue Jun 27 13:46:51 2023 +0200
Commit:     Armin Le Grand <armin.le.gr...@me.com>
CommitDate: Tue Jun 27 18:37:16 2023 +0200

    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.gr...@me.com>

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));
 

Reply via email to