Kaydet (Commit) ef87ff66 authored tarafından Matúš Kukan's avatar Matúš Kukan

fdo#51819: autorecovery: fix saving password in protected documents.

Thanks to sayt@mailinator.com for the idea.

Change-Id: Ib79abafe3d4d3ba21f7914aeb284d86ce662824c
üst c5630fed
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment