include/comphelper/documentconstants.hxx |    2 +-
 sfx2/source/dialog/filedlghelper.cxx     |    3 +++
 sfx2/source/dialog/filedlgimpl.hxx       |    4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 55e74a33c757ffa40ce2ea50d986c60b9c84732b
Author:     Moritz Duge <moritz.d...@allotropia.de>
AuthorDate: Thu May 23 18:11:22 2024 +0200
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Mon May 27 22:18:21 2024 +0200

    Related tdf#158839: pw and GPG encryption, add comments and TODOs
    
    Change-Id: I53dbc43dcd5dbf594b7cd562bfff0bd3bdcb8ec7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168000
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/include/comphelper/documentconstants.hxx 
b/include/comphelper/documentconstants.hxx
index 929a49458c87..c4372c200809 100644
--- a/include/comphelper/documentconstants.hxx
+++ b/include/comphelper/documentconstants.hxx
@@ -111,7 +111,7 @@ enum class SfxFilterFlags
     EXOTIC            = 0x00200000,
     COMBINED          = 0x00800000,
 
-    ENCRYPTION        = 0x01000000,
+    ENCRYPTION        = 0x01000000,  // password encryption
     PASSWORDTOMODIFY  = 0x02000000,
     GPGENCRYPTION     = 0x04000000,
     PREFERED          = 0x10000000,
diff --git a/sfx2/source/dialog/filedlghelper.cxx 
b/sfx2/source/dialog/filedlghelper.cxx
index 2629bae49899..3fa8768b637c 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1417,6 +1417,7 @@ ErrCode FileDialogHelper_Impl::execute( 
std::vector<OUString>& rpURLList,
         if( mbHasPassword )
         {
             const SfxBoolItem* pPassItem = 
SfxItemSet::GetItem<SfxBoolItem>(&*rpSet, SID_PASSWORDINTERACTION, false);
+            // TODO: tdf#158839 problem: Is also true if the file is GPG 
encrypted. (not with a password)
             mbPwdCheckBoxState = ( pPassItem != nullptr && 
pPassItem->GetValue() );
 
             // in case the document has password to modify, the dialog should 
be shown
@@ -1535,6 +1536,8 @@ ErrCode FileDialogHelper_Impl::execute( 
std::vector<OUString>& rpURLList,
                 {
                     // ask for a password
                     OUString aDocName(rpURLList[0]);
+                    // TODO: tdf#158839 problem: Also asks for a password if 
CHECKBOX_GPGENCRYPTION && CHECKBOX_PASSWORD
+                    //       are checked. But only encrypts using GPG and 
discards the password.
                     ErrCode errCode = RequestPassword(pCurrentFilter, 
aDocName, &*rpSet, GetFrameInterface());
                     if (errCode != ERRCODE_NONE)
                         return errCode;
diff --git a/sfx2/source/dialog/filedlgimpl.hxx 
b/sfx2/source/dialog/filedlgimpl.hxx
index 20a4cc42f382..fe9e8f7a99a5 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -74,8 +74,8 @@ namespace sfx2
 
         FileDialogHelper::Context   meContext;
 
-        bool                    mbHasPassword           : 1;
-        bool                    mbIsPwdEnabled          : 1;
+        bool                    mbHasPassword           : 1;  // checkbox is 
visible
+        bool                    mbIsPwdEnabled          : 1;  // password 
checkbox is not grayed out
         bool                    m_bHaveFilterOptions    : 1;
         bool                    mbHasVersions           : 1;
         bool                    mbHasAutoExt            : 1;

Reply via email to