framework/source/services/desktop.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 64a50c65ee15c03f58ccf25308a70dfd24e791fe
Author:     Tibor Nagy <tibor.nagy.ext...@allotropia.de>
AuthorDate: Mon May 6 10:43:34 2024 +0200
Commit:     Nagy Tibor <tibor.nagy.ext...@allotropia.de>
CommitDate: Mon May 6 14:38:06 2024 +0200

    The previous behavior of using the TerminationVetoException has changed
    
    "Since LibreOffice 5.3: Throwing this exception will only prevent 
termination. Exiting LibreOffice will close all the windows but the process 
will keep running."
    
    Currently, the behavior is different, because not only is LibreOffice
    prevented from terminating, but the last document cannot be closed either. 
The expected behavior is all windows should be closed, but the
    process should be kept running when using a TerminationVetoException.
    
    Change-Id: I8764aefccc4c9feec3ee0e45a54bf0aebcf16c5d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167194
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
    Tested-by: Jenkins

diff --git a/framework/source/services/desktop.cxx 
b/framework/source/services/desktop.cxx
index 6560af7f1eb3..2f9ccbd04bf2 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -201,6 +201,8 @@ sal_Bool SAL_CALL Desktop::terminate()
     aGuard.clear();
 
     // Allow using of any UI ... because Desktop.terminate() was designed as 
UI functionality in the past.
+    // try to close all open frames
+    bool bFramesClosed = impl_closeFrames(!bRestartableMainLoop);
 
     // Ask normal terminate listener. They could veto terminating the process.
     Desktop::TTerminateListenerList lCalledTerminationListener;
@@ -210,8 +212,7 @@ sal_Bool SAL_CALL Desktop::terminate()
         return false;
     }
 
-    // try to close all open frames
-    if (!impl_closeFrames(!bRestartableMainLoop))
+    if (!bFramesClosed)
     {
         impl_sendCancelTerminationEvent(lCalledTerminationListener);
         return false;

Reply via email to