diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-04-12 20:40:09 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-04-13 20:59:23 +0200 |
commit | 79e19abad98209c0529c4b73ae947c8d1d5b6865 (patch) | |
tree | 65b624aa8836e5146ea01f06ec5744a49b4ca3fc | |
parent | 0e18d4495be0b7945295a29037e60341e347f9aa (diff) |
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 <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
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 { |