summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx21
-rw-r--r--sfx2/source/dialog/filedlgimpl.hxx1
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;