diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2022-07-17 12:36:15 +0200 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2022-07-20 09:22:34 +0200 |
commit | 832f2b2949e000e2d5969798284bca8d0723ea55 (patch) | |
tree | 52df4c5fa11316bd9b696045d8b62d83c73686a4 /sc | |
parent | 9352ba337a84672a0ba60651023422de88105456 (diff) |
tdf#119491 sc odf export: fix password protection of shared files
Handle SID_ENCRYPTIONDATA for shared password protected docs.
Change-Id: If9554a991a39d6be45ed688a0bd638cd166589c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137146
Tested-by: Jenkins
Tested-by: Gabor Kelemen <kelemeng@ubuntu.com>
Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
(cherry picked from commit 8fa6a1f628ca9df5d910db2b2aa7328e1d6220d7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137182
Tested-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index bd7402231333..2203ca42725c 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -915,6 +915,14 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) aValues[1].Name = "Password"; aValues[1].Value <<= pPasswordItem->GetValue(); } + const SfxUnoAnyItem* pEncryptionItem = SfxItemSet::GetItem<SfxUnoAnyItem>(GetMedium()->GetItemSet(), SID_ENCRYPTIONDATA, false); + if (pEncryptionItem) + { + aValues.realloc(aValues.getLength() + 1); + auto pValues = aValues.getArray(); + pValues[aValues.getLength() - 1].Name = "EncryptionData"; + pValues[aValues.getLength() - 1].Value = pEncryptionItem->GetValue(); + } SC_MOD()->SetInSharedDocSaving( true ); xStor->storeToURL( GetSharedFileURL(), aValues ); |