framework/source/services/autorecovery.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
New commits: commit fe55282c02a3306ac1c7971a5c2c85c52f54d205 Author: Justin Luth <jl...@mail.com> AuthorDate: Tue Aug 1 10:47:46 2023 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Wed Aug 2 23:32:15 2023 +0200 tdf#144512 autorecovery: don't delay autosave on shutdown Change-Id: I98ee31369aa46c4e3aeb405ec11a1ef197c31fe0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155165 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index c55e869cedf3..902e180320ee 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2895,15 +2895,18 @@ AutoRecovery::ETimerType AutoRecovery::implts_saveDocs( bool bAllow continue; } - if (auto xDocRecovery2 = xDocRecover.query<XDocumentRecovery2>()) + // If the document became modified not too long ago, don't autosave it yet. + if (bAllowUserIdleLoop) { - const sal_Int64 nDirtyDuration = xDocRecovery2->getModifiedStateDuration(); - // If the document became modified not too long ago, don't autosave it yet. - // Round up to second - if this document is almost ready for autosave, do it now. - if (nDirtyDuration + 999 < nConfiguredAutoSaveInterval) + if (auto xDocRecovery2 = xDocRecover.query<XDocumentRecovery2>()) { - aInfo.DocumentState |= DocState::Handled; - continue; + const sal_Int64 nDirtyDuration = xDocRecovery2->getModifiedStateDuration(); + // Round up to second - if this document is almost ready for autosave, do it now. + if (nDirtyDuration + 999 < nConfiguredAutoSaveInterval) + { + aInfo.DocumentState |= DocState::Handled; + continue; + } } }