diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-04-04 09:50:26 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-04-08 18:46:38 +0200 |
commit | 14bfb0933073e5bf8ce4f810c38e91125066257a (patch) | |
tree | 8e975fc5759de67106faf8357f2b0a744a5176e6 /filter | |
parent | 881cfbf77567194f5016a961d1c3db869734d68b (diff) |
allow to override the generator/producer string in output documents
Add a (non-gui) setting GeneratorOverride that, if set, is used
for odt/docx/pdf generator string identifying the application that
has written it instead of the normal productname etc. string.
Change-Id: Ibe12a063e7e6b5a09c69cdf66cba073793650d62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132495
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/pdf/pdfexport.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index d6f451f8392d..9b07ae1a9306 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -38,6 +38,7 @@ #include <unotools/configmgr.hxx> #include <cppuhelper/compbase.hxx> #include <cppuhelper/basemutex.hxx> +#include <officecfg/Office/Common.hxx> #include "pdfexport.hxx" #include <strings.hrc> @@ -479,10 +480,15 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& } } // getting the string for the producer - aContext.DocumentInfo.Producer = - utl::ConfigManager::getProductName() + - " " + - utl::ConfigManager::getProductVersion(); + OUString aProducerOverride = officecfg::Office::Common::Save::Document::GeneratorOverride::get(); + if( !aProducerOverride.isEmpty()) + aContext.DocumentInfo.Producer = aProducerOverride; + else + aContext.DocumentInfo.Producer = + utl::ConfigManager::getProductName() + + " " + + utl::ConfigManager::getProductVersion(); + aContext.DocumentInfo.Creator = aCreator; OUString aSignCertificateSubjectName; |