related tdf#57414 autosave: try harder to know when !IsModified
The cache that holds document status did:
-saveDocs: for each cached document status:
-creates a copy of the cached status
-call saveOneDoc: given the copy
[-updateModifiedState should get called, updating the cache itself]
-saveOneDoc: flushConfig writes copy to RecoveryList (as modified)
-cache is updated with the results from saveOneDoc (*pIt = aInfo)
Now, it is easily possible that saveOneDoc changed the status from
modified, to not modified, wouldn't you think (if UserAutoSave)?
But since the copy was never updated, it reported as modified still!
storeToRecoveryFile can benefit from knowing the real modified status,
so do the update just prior to that call.
Change-Id: Iee1ddd0bf7bee25d5ba3e7abb1ac6713295906af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154683
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 4eb7000..1bef7e6 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3076,6 +3076,15 @@ void AutoRecovery::implts_saveOneDoc(const OUString&
{
}
// DocState::Modified status cannot be trusted to be accurate, but at least attempt to be so,
// since this rInfo will eventually get assigned to m_lDocCache as the authoritative status.
const Reference<css::util::XModifiable> xModify(rInfo.Document, UNO_QUERY);
const bool bModified = xModify.is() && xModify->isModified();
if (bModified)
rInfo.DocumentState |= DocState::Modified;
else if (xModify.is())
rInfo.DocumentState &= ~DocState::Modified;
sal_Int32 nRetry = RETRY_STORE_ON_FULL_DISC_FOREVER;
bool bError = false;
do