summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-03-14 09:42:02 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-03-17 20:38:20 +0100
commitef87ff6680f79362a431db6e7ef2f40cfc576219 (patch)
treea1817c09311cca77e44c62f51f253c588a25352b
parentc5630fed3b30f6d5fd0b2692cd96e34e419f9a6c (diff)
fdo#51819: autorecovery: fix saving password in protected documents.
Thanks to sayt@mailinator.com for the idea. Change-Id: Ib79abafe3d4d3ba21f7914aeb284d86ce662824c
-rw-r--r--framework/source/services/autorecovery.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 980e92b09e2f..4ebd694f2935 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3233,9 +3233,11 @@ void AutoRecovery::implts_saveOneDoc(const OUString&
// if the document was loaded with a password, it should be
// stored with password
utl::MediaDescriptor lNewArgs;
- OUString sPassword = lOldArgs.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PASSWORD(), OUString());
- if (!sPassword.isEmpty())
- lNewArgs[utl::MediaDescriptor::PROP_PASSWORD()] <<= sPassword;
+ css::uno::Sequence< css::beans::NamedValue > aEncryptionData =
+ lOldArgs.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_ENCRYPTIONDATA(),
+ css::uno::Sequence< css::beans::NamedValue >());
+ if (aEncryptionData.getLength() > 0)
+ lNewArgs[utl::MediaDescriptor::PROP_ENCRYPTIONDATA()] <<= aEncryptionData;
// Further it must be saved using the default file format of that application.
// Otherwhise we will some data lost.