Bug 121140 - Misleading GPG encryption option
Summary: Misleading GPG encryption option
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:pdf, implementationError
: 117928 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-11-03 10:09 UTC by Timur Davletshin
Modified: 2024-05-21 23:07 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timur Davletshin 2018-11-03 10:09:48 UTC
Description:
Misleading GPG encryption option in file save dialog

Steps to Reproduce:
1. Cleate new document
2. Type something
3. Open file save dialog 
4. Choose Flat ODT or txt choose "Encrypt with GPG key" option and save

Actual Results:
Open created file in text editor, file is unencrypted.

Expected Results:
Disable GPG encryption option for non-compatible file formats.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Comment 1 Thorsten Behrens (allotropia) 2018-11-11 23:44:02 UTC
*** Bug 117928 has been marked as a duplicate of this bug. ***
Comment 2 Thorsten Behrens (allotropia) 2018-11-11 23:58:19 UTC
Right, depending on the selected output format, checkbox should get disabled, like it's currently happening for the password checkbox already.
Comment 3 QA Administrators 2019-11-13 03:33:13 UTC Comment hidden (obsolete)
Comment 4 Timur Davletshin 2019-11-13 06:46:52 UTC
Still can reproduced in:

Version: 6.3.3.2
Build ID: a64200df03143b798afd1ec74a12ab50359878ed
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk2; 
Locale: en-US (C.UTF-8); UI-Language: en-US
Calc: threaded
Comment 5 QA Administrators 2021-11-13 05:46:04 UTC Comment hidden (obsolete)
Comment 6 Andrew Watson 2023-05-02 09:19:57 UTC
Bug still present in:

Version: 7.4.6.2 / LibreOffice Community
Build ID: 5b1f5509c2decdade7fda905e3e1429a67acd63d
CPU threads: 4; OS: Mac OS X 10.14.6; UI render: default; VCL: osx
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Calc: threaded
Comment 7 kolAflash 2024-05-21 23:07:18 UTC
As far as I understand what's happening and what needs to be changed:


FileDialogHelper_Impl needs to respect GPGENCRYPTION from SfxFilterFlags as it respects ENCRYPTION for the password checkbox.

https://git.libreoffice.org/core/+/101b08fe1ec77ffe8c1a9b2b8f9f20884269a1ed/sfx2/source/dialog/filedlghelper.cxx#513

https://git.libreoffice.org/core/+/101b08fe1ec77ffe8c1a9b2b8f9f20884269a1ed/include/comphelper/documentconstants.hxx#114


Currently (2024-05-22) the "Encrypt with GPG key" checkbox is simply always enabled. For FODT and also for TXT, DOC, PPT, XLS, ... and everything else.

Saving a DOCX with GPG enabled results in an error. But pretty much every other document than ODT saves an unencrypted document without complaining if the GPG check box is enabled.

Only ODT (with the exception of FODT) gives the expected encrypted result. So for every other format GPG should be disabled.
And it looks like SfxFilterFlags::GPGENCRYPTION is already holds this information for disabling the GPG check box. FileDialogHelper_Impl just needs to use that information.