framework/source/services/autorecovery.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit f9be1da8203d610a038732c6c8a80206b038fa79 Author: Matúš Kukan <[email protected]> Date: Fri Mar 14 09:42:02 2014 +0100 fdo#51819: autorecovery: fix saving password in protected documents. Thanks to [email protected] 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 <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 9541000..2136538 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.
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
