summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-10-10 12:15:37 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-10-10 16:33:11 +0200
commitc50bca0fc298973bbeda697072528e3dfc887ac5 (patch)
treeed6cc9bc0e437a2bcfa641fc9286655b1d06814f /filter
parentb9fee0f1bb22555f321c8c071e6171ad2664b297 (diff)
tdf#157182 vcl,filter: PDF/A export: fix crash due to SE ID mismatch
The SE IDs in PDFExtOutDevData and PDFWriterImpl are supposed to match. If PDF/A-1 is exported then RemoveTransparenciesFromMetaFile() is called and that does unspeakable things to the Metafile and then we just throw away the PDF related data for the page in PDFExtOutDevData::ResetSyncData(). This means that then EnsureStructureElement are called on PDFExtOutDevData but not on PDFWriterImpl, so on the next page the IDs will no longer match, which is noticed if there is no transparency to be removed on that page. pdfextoutdevdata.cxx:347: bool vcl::PageSyncData::PlaySyncPageAct(): Assertion `id == -1 || id == mParaInts.front()' failed. Guess the easiest way to deal with this is to have the premature ResetSyncData() replay only the EnsureStructureElement actions, which is only possible because they don't really require any extra data stored in the ridiculous vectors in PageSyncData; PDFWriterImpl will eventually remove the elements as they are never initialised. (regression from commit 07d790ca473cd6e71f0343419b819fa6b485dc01) Change-Id: I8eb295504067edff00608e28fd86b0c86d547083 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157748 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/pdf/pdfexport.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index bfa67aea1787..940d6145ceb6 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -1186,7 +1186,7 @@ void PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData&
// Throw them all away in the absence of a way to reposition them to new positions of
// their replacements.
if (aCtx.m_bTransparenciesWereRemoved)
- rPDFExtOutDevData.ResetSyncData();
+ rPDFExtOutDevData.ResetSyncData(&rWriter);
}
else
{
@@ -1202,7 +1202,7 @@ void PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData&
rWriter.PlayMetafile( aMtf, aCtx, &rPDFExtOutDevData );
- rPDFExtOutDevData.ResetSyncData();
+ rPDFExtOutDevData.ResetSyncData(nullptr);
if (!msWatermark.isEmpty())
{