sc/source/ui/docshell/docsh.cxx | 8 ++++++++ 1 file changed, 8 insertions(+)
New commits: commit 0b338e4b50962834d012a3af1c9290e3d7ab61bd Author: Balazs Varga <[email protected]> AuthorDate: Sun Jul 17 12:36:15 2022 +0200 Commit: Balazs Varga <[email protected]> CommitDate: Mon Jul 25 17:25:25 2022 +0200 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 <[email protected]> Reviewed-by: Gabor Kelemen <[email protected]> Reviewed-by: Thorsten Behrens <[email protected]> (cherry picked from commit 8fa6a1f628ca9df5d910db2b2aa7328e1d6220d7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137187 Tested-by: Balazs Varga <[email protected]> Reviewed-by: Balazs Varga <[email protected]> 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 );
