From aaf91e7c4833689dc11d0b7f3e9f707a9ce206d5 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 13 Dec 2019 03:01:28 +0100 Subject: Don't autosave encrypted documents As we cannot generally make sure they stay encrypted. Change-Id: I15ed41fabcc553608e418608ad1166a951daa4b6 --- framework/source/services/autorecovery.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index d58883e83fe3..056e2bce3f38 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2384,7 +2384,10 @@ void AutoRecovery::implts_registerDocument(const css::uno::Reference< css::frame // check if this document must be ignored for recovery ! // Some use cases don't wish support for AutoSave/Recovery ... as e.g. OLE-Server / ActiveX Control etcpp. - bool bNoAutoSave = lDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_NOAUTOSAVE(), false); + bool bNoAutoSave = lDescriptor.getUnpackedValueOrDefault( + utl::MediaDescriptor::PROP_NOAUTOSAVE(), false) + || lDescriptor.getValue( + utl::MediaDescriptor::PROP_ENCRYPTIONDATA()).hasValue(); if (bNoAutoSave) return; @@ -2802,7 +2805,10 @@ bool lc_checkIfSaveForbiddenByArguments(AutoRecovery::TDocumentInfo const & rInf return true; utl::MediaDescriptor lDescriptor(rInfo.Document->getArgs()); - bool bNoAutoSave = lDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_NOAUTOSAVE(), false); + bool bNoAutoSave = lDescriptor.getUnpackedValueOrDefault( + utl::MediaDescriptor::PROP_NOAUTOSAVE(), false) + || lDescriptor.getValue( + utl::MediaDescriptor::PROP_ENCRYPTIONDATA()).hasValue(); return bNoAutoSave; } -- cgit v1.2.3