summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Le Grand (Allotropia) <armin.le.grand.extern@allotropia.de>2021-07-07 11:27:55 +0200
committerArmin Le Grand (Allotropia) <armin.le.grand.extern@allotropia.de>2021-07-07 11:27:55 +0200
commit8c1a2c275b31cbdb3fbec10080851f43c87f7068 (patch)
treef6405c5ec9736580d5e2d376a46c305ab8a4060c
parentDisable PDF-to-PDF embedding on PDF export (hack) (diff)
downloadcore-8c1a2c275b31cbdb3fbec10080851f43c87f7068.tar.gz
core-8c1a2c275b31cbdb3fbec10080851f43c87f7068.zip
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
-rw-r--r--officecfg/registry/data/org/openoffice/Office/Common.xcu3
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs8
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx5
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 @@
<value install:module="unx">false</value>
<value install:module="wnt">true</value>
</prop>
+ <prop oor:name="AllowPdfToPdfEmbedding" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
</node>
<node oor:name="I18N">
<node oor:name="CTL">
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 @@
</info>
<value>false</value>
</prop>
+ <prop oor:name="AllowPdfToPdfEmbedding" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>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.</desc>
+ </info>
+ <value>false</value>
+ </prop>
<prop oor:name="ForceOpenGL" oor:type="xs:boolean" oor:nillable="false">
<info>
<desc>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 <textlineinfo.hxx>
#include <bitmapwriteaccess.hxx>
#include <impglyphitem.hxx>
+#include <officecfg/Office/Common.hxx>
#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();