diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-12-07 05:11:15 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-12-07 18:21:02 +0100 |
commit | 626e73eafe953b102107031721a0b145fb713e9d (patch) | |
tree | aa79783dd8504c26ebcaa7a70835b5e8695c8060 /sfx2/source/dialog | |
parent | 5d0f3cc3f9e6fc687ba6a40cebf2096d70e4f811 (diff) |
gpg4libre: permit multi-select encrypt cert
And pass down all necessary parameters everywhere
Change-Id: I152b9d84c0e35be9e5193a9a6f67de9fb86133b0
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 4482d2887c41..84e248bfa390 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -1521,8 +1521,26 @@ ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList, bool bGpg = false; if ( ( aValue >>= bGpg ) && bGpg ) { - // ask for a key - rpSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( ::comphelper::OStorageHelper::CreateGpgPackageEncryptionData() ) ) ); + uno::Sequence< beans::NamedValue > aEncryptionData; + while(true) + { + try + { + // ask for keys + aEncryptionData = ::comphelper::OStorageHelper::CreateGpgPackageEncryptionData(); + break; // user cancelled or we've some keys now + } + catch( const IllegalArgumentException& ) + { + ScopedVclPtrInstance< MessageDialog > aBox( + mpPreferredParentWindow, + SfxResId(RID_SVXSTR_INCORRECT_PASSWORD)); + aBox->Execute(); + } + } + + if ( aEncryptionData.hasElements() ) + rpSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData) ) ); } } catch( const IllegalArgumentException& ){} |