diff options
author | Justin Luth <justin.luth@collabora.com> | 2022-11-24 15:16:28 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2022-12-20 14:47:33 +0000 |
commit | 29386030a96f2c8b1c636f4d4bb283109e01de8b (patch) | |
tree | f77fdad88dc4fa6fe1f2dbbb80ef121128d19b18 /sfx2 | |
parent | cbca5617387aaa39c9ee86272166bb3df7874b25 (diff) |
tdf#142147 saveas: encrypted docs should default to use password
If a document is currently encrypted (pOldEncryptionDataItem),
when the user saves as a different name, the save dialog should
BY DEFAULT have the "Save with password" option enabled.
That makes sense, right? If the document was secure enough
to require a password, then any copies of it should
AT MINIMUM suggest a password.
Anyway, it worked that way prior to LO 7.0's
e0cced9d4c94324e834e46d807469a0cd6c1f738.
The concern was that the same password would be applied
silently. That might have been true with 7.0.
However, in my current testing that never happened.
It always prompted the user to create a new password.
And that is exactly what I would want on a SAVE-AS,
whether it be from a template or a file I was copying.
I would hope that this has no bad implications for headless RT.
After all, this is just a "suggestion" passed to guisaveas.cxx.
I did not find any parameters to provide a password
via commandline anyway.
Change-Id: Id3535d883cd5d2d1427055f7a21f6ae87e0d5324
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143250
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 35716406cd80..1a0356279c4d 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1007,7 +1007,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) const SfxStringItem* pOldPasswordItem = SfxItemSet::GetItem<SfxStringItem>(GetMedium()->GetItemSet(), SID_PASSWORD, false); const SfxUnoAnyItem* pOldEncryptionDataItem = SfxItemSet::GetItem<SfxUnoAnyItem>(GetMedium()->GetItemSet(), SID_ENCRYPTIONDATA, false); - bool bPreselectPassword = (pOldPasswordItem && pOldEncryptionDataItem); + const bool bPreselectPassword = pOldPasswordItem || pOldEncryptionDataItem; uno::Sequence< beans::PropertyValue > aDispatchArgs; if ( rReq.GetArgs() ) |