diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-08-18 22:01:13 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-08-30 13:42:36 +0200 |
commit | 546915797286b0e1744c25b1b0d7e13fb1bbe94e (patch) | |
tree | bef514c426d26695ed609148f2ba5ef874f3ee2f /sfx2 | |
parent | 91635d5096df2ac19c2f80fbfbecd86620902540 (diff) |
gpg4libre: request key from filepicker
Change-Id: I3a20f293bd12fc3de76fb1e846452c0a574e8794
Reviewed-on: https://gerrit.libreoffice.org/41503
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 21 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlgimpl.hxx | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index fa52ce51b90b..d6a5489f85ce 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -880,6 +880,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( mbHasPassword = false; m_bHaveFilterOptions = false; mbIsPwdEnabled = true; + mbIsGpgEnabled = true; mbHasVersions = false; mbHasPreview = false; mbShowPreview = false; @@ -1511,6 +1512,26 @@ ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList, } catch( const IllegalArgumentException& ){} } + // check, whether or not we have to display a key selection box + if ( pCurrentFilter && mbHasPassword && mbIsGpgEnabled && xCtrlAccess.is() ) + { + try + { + Any aValue = xCtrlAccess->getValue( ExtendedFilePickerElementIds::CHECKBOX_GPGENCRYPTION, 0 ); + bool bGpg = false; + if ( ( aValue >>= bGpg ) && bGpg ) + { + // ask for a key + OUString aDocName(rpURLList[0]); + // ErrCode errCode = RequestKey(pCurrentFilter, aDocName, rpSet); + //if (errCode != ERRCODE_NONE) + rpSet->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( ::comphelper::OStorageHelper::CreatePackageEncryptionData( aDocName ) ) ) ); + + return ERRCODE_IO_NOTSUPPORTED; //errCode; + } + } + catch( const IllegalArgumentException& ){} + } SaveLastUsedFilter(); return ERRCODE_NONE; diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index 736d00d41e10..595afd2fca39 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -76,6 +76,7 @@ namespace sfx2 bool mbHasPassword : 1; bool mbIsPwdEnabled : 1; + bool mbIsGpgEnabled : 1; bool m_bHaveFilterOptions : 1; bool mbHasVersions : 1; bool mbHasAutoExt : 1; |