vcl/source/gdi/pdfwriter_impl.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
New commits: commit 907e8435184995535d2d99c116b35af445281bea Author: Armin Le Grand (Allotropia) <armin.le.gr...@me.com> AuthorDate: Mon Nov 1 16:00:44 2021 +0100 Commit: Armin Le Grand (Allotropia) <armin.le.gr...@me.com> CommitDate: Mon Nov 1 16:00:44 2021 +0100 Disable PDF-to-PDF embedding on PDF export (hack), part III Corrected creation of PDF export for Bitmap/BitmapEx which needs a createObject call in createBitmapEmit in all cases where no embedded PDF is written Change-Id: Ic0da0139d99b273f61c0164ac3615e288986bc94 diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 9173a94ab0dd..4e67d8846d02 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9517,8 +9517,15 @@ const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx m_aBitmaps.push_front( BitmapEmit() ); m_aBitmaps.front().m_aID = aID; m_aBitmaps.front().m_aBitmap = aBitmap; - if (!rGraphic.hasPdfData() || m_aContext.UseReferenceXObject) - m_aBitmaps.front().m_nObject = createObject(); + + static bool bAllowPdfToPdf(officecfg::Office::Common::VCL::AllowPdfToPdfEmbedding::get()); + const bool bHasPdfDFata(bAllowPdfToPdf && rGraphic.hasPdfData()); + + if (!bHasPdfDFata || m_aContext.UseReferenceXObject) + { + m_aBitmaps.front().m_nObject = createObject(); + } + createEmbeddedFile(rGraphic, m_aBitmaps.front().m_aReferenceXObject, m_aBitmaps.front().m_nObject); it = m_aBitmaps.begin(); }