tdf#148416 saveas: preserve loadreadonly with password
If a document is set to load readonly,
and that setting is password protected,
then at least suggest using a password on save-as.
Change-Id: I788da43733470e56af988e7c4b9f2cae01573e50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153726
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index f321cbfc..caa1b80 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1027,7 +1027,10 @@ 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);
const bool bPreselectPassword = pOldPasswordItem || pOldEncryptionDataItem;
const bool bPreselectPassword
= pOldPasswordItem || pOldEncryptionDataItem
|| (IsLoadReadonly()
&& (GetModifyPasswordHash() || GetModifyPasswordInfo().hasElements()));
uno::Sequence< beans::PropertyValue > aDispatchArgs;
if ( rReq.GetArgs() )