diff options
author | Armin Le Grand (Allotropia) <armin.le.grand@me.com> | 2021-11-01 16:00:44 +0100 |
---|---|---|
committer | Armin Le Grand (Allotropia) <armin.le.grand@me.com> | 2021-11-01 16:00:44 +0100 |
commit | 907e8435184995535d2d99c116b35af445281bea (patch) | |
tree | 554ddf9da05eec24eb4799744b859e222e303f65 | |
parent | Disable PDF-to-PDF embedding on PDF export (hack), part II (diff) | |
download | core-907e8435184995535d2d99c116b35af445281bea.tar.gz core-907e8435184995535d2d99c116b35af445281bea.zip |
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
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
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(); } |