Kaydet (Commit) 54691579 authored tarafından Thorsten Behrens's avatar Thorsten Behrens Kaydeden (comit) Katarina Behrens

gpg4libre: request key from filepicker

Change-Id: I3a20f293bd12fc3de76fb1e846452c0a574e8794
Reviewed-on: https://gerrit.libreoffice.org/41503Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 91635d50
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment