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

New commits:
commit 973ef754442027b7508efbe8a7fb714856a72d1a
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Fri Jul 14 14:37:43 2023 -0400
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Jul 15 06:59:13 2023 +0200

    tdf#71550 autosave: remove empty, new file on failed autosave
    
    before throwing and losing any control.
    
    Change-Id: I2340c6f08bae116f3c1a390bccca2075c047a737
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154446
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <jl...@mail.com>
    (cherry picked from commit afed0bd83bbb415400c2f55535673c9768eb3a36)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154452

diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index c9e7d62cc5f9..07c56d3c2981 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3091,7 +3091,13 @@ void AutoRecovery::implts_saveOneDoc(const OUString&
             else if (nRetry > RETRY_STORE_ON_MIGHT_FULL_DISC_USEFULL)
                 nRetry = RETRY_STORE_ON_MIGHT_FULL_DISC_USEFULL;
             else if (nRetry <= GIVE_UP_RETRY)
+            {
+                // delete the empty file created by implts_generateNewTempURL
+                if (tools::isEmptyFileUrl(rInfo.NewTempURL))
+                    AutoRecovery::st_impl_removeFile(rInfo.NewTempURL);
+
                 throw; // force stacktrace to know if there exist might other 
reasons, why an AutoSave can fail !!!
+            }
 
             --nRetry;
         }

Reply via email to