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 <jluth@mail.com>
Tested-by: Jenkins
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 657d8c1..dbf0c80 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;
        }