summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2020-06-14 19:21:22 +0300
committerAndras Timar <andras.timar@collabora.com>2020-06-17 18:05:11 +0200
commit32eb3a73843ef2eb46e88a71e8864f48fde05790 (patch)
tree944dc6f3c4d90c304083360b77f98052f5d25630 /sfx2/source
parent4001186a00cf0cf7f17048818ccbc6fd10a2fcf6 (diff)
Add an option to send email encrypted PDF files via mailmerge.
Change-Id: I002e054b685bd3367c4183014adc1dbd0843a365 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96303 Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Tested-by: Gülşah Köse <gulsah.kose@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96535 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/doc/objstor.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 1ec0039c2a7c..66ec9a8d16f6 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2816,7 +2816,35 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString&
// set filter; if no filter is given, take the default filter of the factory
if ( !aFilterName.isEmpty() )
+ {
pNewFile->SetFilter( GetFactory().GetFilterContainer()->GetFilter4FilterName( aFilterName ) );
+
+ if(aFilterName == "writer_pdf_Export" && pNewFile->GetItemSet())
+ {
+ uno::Sequence< beans::PropertyValue > aSaveToFilterDataOptions(2);
+ bool bRet = false;
+
+ for(int i = 0 ; i< rArgs.getLength() ; ++i)
+ {
+ auto aProp = rArgs[i];
+ if(aProp.Name == "EncryptFile")
+ {
+ aSaveToFilterDataOptions[0].Name = aProp.Name;
+ aSaveToFilterDataOptions[0].Value = aProp.Value;
+ bRet = true;
+ }
+ if(aProp.Name == "DocumentOpenPassword")
+ {
+ aSaveToFilterDataOptions[1].Name = aProp.Name;
+ aSaveToFilterDataOptions[1].Value = aProp.Value;
+ bRet = true;
+ }
+ }
+
+ if( bRet )
+ pNewFile->GetItemSet()->Put( SfxUnoAnyItem(SID_FILTER_DATA, uno::makeAny(aSaveToFilterDataOptions)));
+ }
+ }
else
pNewFile->SetFilter( GetFactory().GetFilterContainer()->GetAnyFilter( SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT ) );