diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-03-14 09:42:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-21 11:34:31 +0000 |
commit | f9be1da8203d610a038732c6c8a80206b038fa79 (patch) | |
tree | c0f82075d9ba1068d7577f512d3e9ac158159c95 | |
parent | b6d9aa63ab63f3236712b2b68155e6b0d129a688 (diff) |
fdo#51819: autorecovery: fix saving password in protected documents.
Thanks to sayt@mailinator.com for the idea.
(cherry picked from commit ef87ff6680f79362a431db6e7ef2f40cfc576219)
Conflicts:
framework/source/services/autorecovery.cxx
Change-Id: Ib79abafe3d4d3ba21f7914aeb284d86ce662824c
Reviewed-on: https://gerrit.libreoffice.org/8681
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | framework/source/services/autorecovery.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 9541000f5fe1..2136538c6724 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2333,9 +2333,11 @@ void AutoRecovery::implts_saveOneDoc(const OUString& // if the document was loaded with a password, it should be // stored with password ::comphelper::MediaDescriptor lNewArgs; - OUString sPassword = lOldArgs.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_PASSWORD(), OUString()); - if (!sPassword.isEmpty()) - lNewArgs[::comphelper::MediaDescriptor::PROP_PASSWORD()] <<= sPassword; + css::uno::Sequence< css::beans::NamedValue > aEncryptionData = + lOldArgs.getUnpackedValueOrDefault(::comphelper::MediaDescriptor::PROP_ENCRYPTIONDATA(), + css::uno::Sequence< css::beans::NamedValue >()); + if (aEncryptionData.getLength() > 0) + lNewArgs[::comphelper::MediaDescriptor::PROP_ENCRYPTIONDATA()] <<= aEncryptionData; // Further it must be saved using the default file format of that application. // Otherwhise we will some data lost. |