From ed8a0ebfc1d6cfebc45db69064b56c7215638654 Mon Sep 17 00:00:00 2001 From: Octavio Alvarez Date: Thu, 1 Feb 2024 07:55:21 +0000 Subject: [PATCH 16/18] Add minor version / OS to PDF producer metadata. Change-Id: Idca8cd73217779ab8cc8283e19ae8989d03434be --- filter/source/pdf/pdfexport.cxx | 13 ++++++++++++- vcl/qa/cppunit/pdfexport/pdfexport2.cxx | 1 - 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 7d07f8182bdc..b6ff5fc7a95e 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -65,6 +65,8 @@ #include +#include + using namespace ::com::sun::star; using namespace ::com::sun::star::io; using namespace ::com::sun::star::uno; @@ -505,10 +507,19 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& if (!aProducerOverride.isEmpty()) aContext.DocumentInfo.Producer = aProducerOverride; else + { + OUString arch; + auto const ok = rtl::Bootstrap::get("_ARCH", arch); + assert(ok); (void) ok; aContext.DocumentInfo.Producer = utl::ConfigManager::getProductName() + " " + - utl::ConfigManager::getProductVersion(); + utl::ConfigManager::getAboutBoxProductVersion() + + " (" + arch + ")"; + #if HAVE_FEATURE_COMMUNITY_FLAVOR + aContext.DocumentInfo.Producer += " / LibreOffice Community"; + #endif + } } aContext.DocumentInfo.Creator = aCreator; diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index d2811f32fbd4..4d6c06c40057 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -4311,7 +4311,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testPdfImageEncryption) aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); uno::Sequence aFilterData = { comphelper::makePropertyValue("EncryptFile", true), - comphelper::makePropertyValue("DocumentOpenPassword", OUString("secret")), }; aMediaDescriptor["FilterData"] <<= aFilterData; xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); -- 2.39.2