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

New commits:
commit 65db5b6a34c4cb781e7a9ab813801a0e0d114da5
Author:     Justin Luth <jl...@mail.com>
AuthorDate: Fri Jul 14 14:37:43 2023 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Fri Jul 14 22:21:02 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>

diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index ddeeab2c23c5..a0ef83d3a9da 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3086,7 +3086,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