Bug 121140 - Misleading GPG encryption option (save dialog checkbox)
Summary: Misleading GPG encryption option (save dialog checkbox)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Moritz Duge (allotropia) (a.k.a. kolAflash)
URL:
Whiteboard: target:25.2.0 target:24.8.0.2 target:...
Keywords: filter:pdf, implementationError
: 117928 154747 (view as bug list)
Depends on:
Blocks: Document-Options
  Show dependency treegraph
 
Reported: 2018-11-03 10:09 UTC by Timur Davletshin
Modified: 2024-07-18 09:36 UTC (History)
7 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 Moritz Duge (allotropia) (a.k.a. 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.
Comment 8 Moritz Duge (allotropia) (a.k.a. kolAflash) 2024-05-24 13:53:34 UTC
Note:
See here for which feature is supported for which file format. That's what the SfxFilterFlags are matched with via GetFilterFlags()
https://git.libreoffice.org/core/+/a3150fc8a59662ce8630cfc64fec9cd083ac7d36/filter/source/config/fragments/filters
ODF is here for example.
https://git.libreoffice.org/core/+/a3150fc8a59662ce8630cfc64fec9cd083ac7d36/filter/source/config/fragments/filters/writer8.xcu
This ticket is about the GPGENCRYPTION feature.
Comment 9 Moritz Duge (allotropia) (a.k.a. kolAflash) 2024-07-11 12:04:13 UTC
*** Bug 154747 has been marked as a duplicate of this bug. ***
Comment 10 Commit Notification 2024-07-15 18:46:05 UTC
Moritz Duge committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/76f4e6d9764048d98f3fdd1620b0e0a6787385c1

tdf#121140: GPG checkbox only for file formats with GPGENCRYPTION flag

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2024-07-17 18:59:49 UTC
Moritz Duge committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/59aee2381ffeb566efc0c25f2d36b1d42301482f

tdf#121140: GPG checkbox only for file formats with GPGENCRYPTION flag

It will be available in 24.8.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2024-07-17 18:59:52 UTC
Moritz Duge committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/24c16b9ea8b9e19150887f79938fcbb3386dd54a

tdf#121140: GPG checkbox only for file formats with GPGENCRYPTION flag

It will be available in 24.2.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Moritz Duge (allotropia) (a.k.a. kolAflash) 2024-07-18 09:36:27 UTC
Should be fixed with the next releases on the mentioned branches.