framework/source/services/autorecovery.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit ceeb48b33b374dfcd970d4fdd194ce0301bbb65a
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Wed Aug 2 15:28:44 2023 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Mon Aug 7 18:15:47 2023 +0200

    tdf#57414 autorecovery: ignoreClosing during Emergency/SessionSave
    
    Unmodified documents were losing the enties from RecoveryList
    when implts_deregisterDocument was triggered,
    which prevented the Session recovery from being able to reload them.
    
    Change-Id: I991a9821105aca81ec596b28341ef4335b817439
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155380
    Reviewed-by: Justin Luth <jl...@mail.com>
    Tested-by: Jenkins

diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index 657d8c12106c..dbf0c803aab6 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -2896,12 +2896,17 @@ AutoRecovery::ETimerType AutoRecovery::implts_saveDocs( 
      bool        bAllow
         if ((aInfo.DocumentState & DocState::Handled) == DocState::Handled)
             continue;
 
+        // don't allow implts_deregisterDocument to remove from RecoveryList 
during shutdown jobs
+        if (m_eJob & (Job::EmergencySave | Job::SessionSave))
+            aInfo.IgnoreClosing = true;
+
         // Not modified documents are not saved.
-        // We safe an information about the URL only!
+        // We save information about the URL only!
         Reference< XDocumentRecovery > xDocRecover( aInfo.Document, 
UNO_QUERY_THROW );
         if ( !xDocRecover->wasModifiedSinceLastSave() )
         {
             aInfo.DocumentState |= DocState::Handled;
+            *pIt = aInfo;
             continue;
         }
 

Reply via email to