diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-29 14:24:02 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-03-29 15:24:50 +0000 |
commit | 30102ded91b9ecfea172ffc6443154230ee37cbd (patch) | |
tree | 8a80f07410a55c32465e369a4e385c1029036bef /vcl/source/gdi | |
parent | 71af22ce8c75d8b161b1bdbb26d0469572c393d0 (diff) |
vcl PDF export, norefxobj: avoid replacement bitmap
The whole point of "no reference XObjects" is knowing this vector markup
is supported everywhere, so no need to provide a fallback bitmap.
It was already unreferenced, but now it's not even written to the file,
making the PDF export result smaller.
Change-Id: Idf766c8eeded4235ebea49d13698a13c6b60f014
Reviewed-on: https://gerrit.libreoffice.org/35841
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 3b3a6d706a6d..fd44f5d10e1b 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -10780,6 +10780,12 @@ bool PDFWriterImpl::writeGradientFunction( GradientEmit& rObject ) void PDFWriterImpl::writeJPG( JPGEmit& rObject ) { + if (rObject.m_aReferenceXObject.m_aPDFData.hasElements() && !m_aContext.UseReferenceXObject) + { + writeReferenceXObject(rObject.m_aReferenceXObject); + return; + } + CHECK_RETURN2( rObject.m_pStream ); CHECK_RETURN2( updateObject( rObject.m_nObject ) ); @@ -11241,6 +11247,12 @@ namespace bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) { + if (rObject.m_aReferenceXObject.m_aPDFData.hasElements() && !m_aContext.UseReferenceXObject) + { + writeReferenceXObject(rObject.m_aReferenceXObject); + return true; + } + CHECK_RETURN( updateObject( rObject.m_nObject ) ); Bitmap aBitmap; @@ -11713,7 +11725,8 @@ const PDFWriterImpl::BitmapEmit& PDFWriterImpl::createBitmapEmit( const BitmapEx m_aBitmaps.push_front( BitmapEmit() ); m_aBitmaps.front().m_aID = aID; m_aBitmaps.front().m_aBitmap = aBitmap; - m_aBitmaps.front().m_nObject = createObject(); + if (!rGraphic.getPdfData().hasElements() || 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(); } |