summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/objserv.cxx
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2019-10-14 00:01:52 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-11-15 12:50:38 +0100
commite0cced9d4c94324e834e46d807469a0cd6c1f738 (patch)
tree8d5e063a0ae2f46c937db21d0b9693bd51069180 /sfx2/source/doc/objserv.cxx
parente21f5796b1d0d34522cef3888a3e5d91b86c2c00 (diff)
do not clean up EncryptionData during SaveAs
As the SID_ENCRYPTIONDATA and SID_PASSWORD are used for setting password together, EncryptionData should be removed only when Password was set (reset of Password protection for the document). Elsewhere EncryptionData should remain as is, while it could contain encryption data used for opened document. Change-Id: I46b757af81e68ad4781e83b1a0e0b6da3a5e13e1 Change-Id: I1213ec55d6dc42f062930467976de45c73152f0b Reviewed-on: https://gerrit.libreoffice.org/82616 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sfx2/source/doc/objserv.cxx')
-rw-r--r--sfx2/source/doc/objserv.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 24cfa8afd294..512fe81d6efd 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -809,11 +809,9 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
}
- bool bPreselectPassword = false;
- const SfxUnoAnyItem* pOldEncryptionDataItem = SfxItemSet::GetItem<SfxUnoAnyItem>(GetMedium()->GetItemSet(), SID_ENCRYPTIONDATA, false);
const SfxStringItem* pOldPasswordItem = SfxItemSet::GetItem<SfxStringItem>(GetMedium()->GetItemSet(), SID_PASSWORD, false);
- if ( pOldEncryptionDataItem || pOldPasswordItem )
- bPreselectPassword = true;
+ const SfxUnoAnyItem* pOldEncryptionDataItem = SfxItemSet::GetItem<SfxUnoAnyItem>(GetMedium()->GetItemSet(), SID_ENCRYPTIONDATA, false);
+ bool bPreselectPassword = (pOldPasswordItem && pOldEncryptionDataItem);
uno::Sequence< beans::PropertyValue > aDispatchArgs;
if ( rReq.GetArgs() )