diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2020-06-14 19:21:22 +0300 |
---|---|---|
committer | Gülşah Köse <gulsah.kose@collabora.com> | 2020-06-15 09:30:47 +0200 |
commit | aa96436c6eeeca9004b6c72282a8cfe9cf8c9eb3 (patch) | |
tree | a4a949ea3c859c6a6c58f81e166e6d5a83e1f8a1 /sfx2 | |
parent | 360adf267b923d263adc536ab542320538609b4e (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>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index e80419546292..2bfa41d90a72 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2805,7 +2805,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 ) ); |