filter/source/pdf/pdfexport.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 79e19abad98209c0529c4b73ae947c8d1d5b6865
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Apr 12 20:40:09 2021 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Apr 13 20:59:23 2021 +0200

    tdf#134736 RemoveTransparenciesFromMetaFile ruins PDFExtOutDevData groups
    
    During pdf export PageSyncData::PushAction can be called to associate
    extra data with a given MetaFile MetaAction position. But
    RemoveTransparenciesFromMetaFile replaces that metafile with a rewriten
    one while the PageSyncData actions remain at the positions of the original
    metafile.
    
    So, if the metafile was replaced throw away the PageSyncData data
    as it's now useless.
    
    Maybe we should try and repair the PDFExtOutDevData by e.g. clearing
    the mActions and adding back the ones associated with a MetaAction
    that is passed through from the original to the copy ?
    
    Change-Id: Ie62e4e2d2ad29670764ce570033034724a005474
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114019
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index d3452998c7bd..87cd58578db7 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -1078,6 +1078,12 @@ void PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, 
vcl::PDFExtOutDevData&
         aCtx.m_bTransparenciesWereRemoved = rWriter.GetReferenceDevice()->
             RemoveTransparenciesFromMetaFile( rMtf, aMtf, 
mnMaxImageResolution, mnMaxImageResolution,
                                               false, true, 
mbReduceImageResolution );
+        // tdf#134736 if the metafile was replaced then rPDFExtOutDevData's 
PageSyncData mActions
+        // all still point to MetaAction indexes in the original metafile that 
are now invalid.
+        // Throw them all way in the absence of a way to reposition them to 
new positions of
+        // their replacements.
+        if (aCtx.m_bTransparenciesWereRemoved)
+            rPDFExtOutDevData.ResetSyncData();
     }
     else
     {
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to