diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2023-07-04 02:13:28 -0400 |
---|---|---|
committer | Ashod Nakashian <ash@collabora.com> | 2023-07-06 11:26:26 +0200 |
commit | 1b7d41abd0f281651dca1c8c7b7b62f952e8022b (patch) | |
tree | 84fe02ff0e3964e8d2ec3c80da451a64f38fb60f /sfx2 | |
parent | 8a1f78dab16e3b27752b76e9013ec2249c894dbc (diff) |
sfx2: disable setting password on text documents
Since we can't preserve the password in a plain-text
file, we should disable the ability to set/change
it. Otherwise, it's misleading to users.
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Change-Id: I3176243ddd2826eb07def1ff5ab251e33cb7125e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153941
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 85b9e50fc941..52416c1f55d0 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1025,6 +1025,16 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet ) { m_xFileValEd->set_label(aName); m_xFileValEd->set_uri(aName); + + // Disable setting/changing password on text files. + // Perhaps this needs to be done for both Online and Desktop. + OUString sExtension(INetURLObject(rMainURL).getExtension()); + if (!sExtension.isEmpty()) + { + sExtension = sExtension.toAsciiLowerCase(); + if (sExtension.equalsAscii("txt") || sExtension.equalsAscii("csv")) + m_xChangePassBtn->set_sensitive(false); + } } else { |