diff options
author | Justin Luth <jluth@mail.com> | 2023-08-01 10:47:46 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-08-02 23:32:15 +0200 |
commit | fe55282c02a3306ac1c7971a5c2c85c52f54d205 (patch) | |
tree | fc12c692bad0f870b778d2ba103f5fc01c99d465 /framework | |
parent | 7aae2fbef91d00afaded26215f48fcdb2070b6ef (diff) |
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 <jluth@mail.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/autorecovery.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
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; + } } } |