From 8c1a2c275b31cbdb3fbec10080851f43c87f7068 Mon Sep 17 00:00:00 2001 From: "Armin Le Grand (Allotropia)" Date: Wed, 7 Jul 2021 11:27:55 +0200 Subject: Disable PDF-to-PDF embedding on PDF export (hack), part II Adapted 899a52b236b81a94367ec8bafdff891a67d818aa to use officecfg::Office::Common::VCL::AllowPdfToPdfEmbedding instead of LIBO_ALLOW_PDF_TO_PDF_EMBEDDING Change-Id: I42e3d9a474400ec488352c081620a9b31cde3562 --- officecfg/registry/data/org/openoffice/Office/Common.xcu | 3 +++ officecfg/registry/schema/org/openoffice/Office/Common.xcs | 8 ++++++++ vcl/source/gdi/pdfwriter_impl.cxx | 5 +++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu index 5f99ddc036bd..ab7986d388b5 100644 --- a/officecfg/registry/data/org/openoffice/Office/Common.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu @@ -60,6 +60,9 @@ false true + + false + diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index cc7fd9f2d85d..b0c738194f25 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -857,6 +857,14 @@ false + + + Specifies if at PDF export it is allowed to embed other PDFs which are + part of the Document in their original form or use another form of graphic + representation, e.g. pixel graphic. + + false + Specifies if OpenGL rendering should be used in VCL backends diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index eadd646cb5d1..9173a94ab0dd 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -80,6 +80,7 @@ #include #include #include +#include #include "pdfwriter_impl.hxx" @@ -9338,7 +9339,7 @@ void PDFWriterImpl::createEmbeddedFile(const Graphic& rGraphic, ReferenceXObject // no pdf data. rEmit.m_nBitmapObject = nBitmapObject; - static bool bAllowPdfToPdf(nullptr != getenv("LIBO_ALLOW_PDF_TO_PDF_EMBEDDING")); + static bool bAllowPdfToPdf(officecfg::Office::Common::VCL::AllowPdfToPdfEmbedding::get()); const bool bHasPdfDFata(bAllowPdfToPdf && rGraphic.hasPdfData()); if (!bHasPdfDFata) return; @@ -9408,7 +9409,7 @@ void PDFWriterImpl::drawJPGBitmap( SvStream& rDCTData, bool bIsTrueColor, const { m_aJPGs.emplace( m_aJPGs.begin() ); JPGEmit& rEmit = m_aJPGs.front(); - static bool bAllowPdfToPdf(nullptr != getenv("LIBO_ALLOW_PDF_TO_PDF_EMBEDDING")); + static bool bAllowPdfToPdf(officecfg::Office::Common::VCL::AllowPdfToPdfEmbedding::get()); const bool bHasPdfDFata(bAllowPdfToPdf && rGraphic.hasPdfData()); if (!bHasPdfDFata || m_aContext.UseReferenceXObject) rEmit.m_nObject = createObject(); -- cgit