From 8933f19100adbf9f2601db0f3ac67dd3b1887ef7 Mon Sep 17 00:00:00 2001 From: Krisztian Pinter Date: Mon, 11 Mar 2013 12:46:18 +0100 Subject: fdo#47011 autosave feature removed unnecessary prop. name "Document/UserAutoSave" from saveopt.cxx fixed autosave feature setting "losing its value" set autosave feature default value to False Change-Id: I473154b21bab53bf595a5a59e87dc16e472dcbf9 Reviewed-on: https://gerrit.libreoffice.org/2663 Reviewed-by: Bosdonnat Cedric Tested-by: Bosdonnat Cedric --- framework/source/services/autorecovery.cxx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'framework') diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index d0f1fab43739..431b5a40a1f3 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -21,8 +21,6 @@ #include "services/autorecovery.hxx" #include -#include //? - #include #include #include @@ -90,6 +88,8 @@ #include +#include + //_______________________________________________ // namespaces @@ -583,6 +583,8 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams) // in case a new dispatch overwrites a may ba active AutoSave session // we must restore this session later. see below ... sal_Bool bWasAutoSaveActive = ((eJob & AutoRecovery::E_AUTO_SAVE) == AutoRecovery::E_AUTO_SAVE); + sal_Bool bWasUserAutoSaveActive = + ((eJob & AutoRecovery::E_USER_AUTO_SAVE) == AutoRecovery::E_USER_AUTO_SAVE); // On the other side it make no sense to reactivate the AutoSave operation // if the new dispatch indicates a final decision ... @@ -691,6 +693,11 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams) ) { m_eJob |= AutoRecovery::E_AUTO_SAVE; + + if (bWasUserAutoSaveActive) + { + m_eJob |= AutoRecovery::E_USER_AUTO_SAVE; + } } aWriteLock.unlock(); @@ -993,9 +1000,13 @@ void AutoRecovery::implts_readAutoSaveConfig() m_eTimerType = AutoRecovery::E_NORMAL_AUTOSAVE_INTERVALL; if (bUserEnabled) + { m_eJob |= AutoRecovery::E_USER_AUTO_SAVE; + } else + { m_eJob &= ~AutoRecovery::E_USER_AUTO_SAVE; + } } else { @@ -2341,7 +2352,6 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString& // Mark AutoSave state as "INCOMPLETE" if it failed. // Because the last temp file is to old and does not include all changes. Reference< XDocumentRecovery > xDocRecover(rInfo.Document, css::uno::UNO_QUERY_THROW); - Reference< XStorable > xDocSave(rInfo.Document, css::uno::UNO_QUERY_THROW); // safe the state about "trying to save" // ... we need it for recovery if e.g. a crash occures inside next line! @@ -2359,6 +2369,7 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString& // if userautosave is enabled, also save to the original file if((m_eJob & AutoRecovery::E_USER_AUTO_SAVE) == AutoRecovery::E_USER_AUTO_SAVE) { + Reference< XStorable > xDocSave(rInfo.Document, css::uno::UNO_QUERY_THROW); xDocSave->store(); } -- cgit