[Libreoffice-commits] core.git: vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Dec 6 13:16:25 UTC 2018


 vcl/source/app/svapp.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit b301dcc711636533d0d8dade7fbb1decb058e18b
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Dec 6 15:05:43 2018 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Dec 6 15:15:38 2018 +0200

    Don't fail assertion when setting the dialog cancel mode to its current value
    
    Change-Id: Ie9d78346bb104734fddeb27ff0414b4c7ef64ae9

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 40ff79b7d70f..f4d2080849de 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1438,9 +1438,11 @@ const LocaleDataWrapper& Application::GetAppLocaleDataWrapper()
 
 void Application::EnableHeadlessMode( bool dialogsAreFatal )
 {
-    assert(GetDialogCancelMode() == DialogCancelMode::Off);
-    SetDialogCancelMode(
-        dialogsAreFatal ? DialogCancelMode::Fatal : DialogCancelMode::Silent );
+    DialogCancelMode eNewMode = dialogsAreFatal ? DialogCancelMode::Fatal : DialogCancelMode::Silent;
+    DialogCancelMode eOldMode = GetDialogCancelMode();
+    assert(eOldMode == DialogCancelMode::Off || GetDialogCancelMode() == eNewMode);
+    if (eOldMode != eNewMode)
+        SetDialogCancelMode( eNewMode );
 }
 
 bool Application::IsHeadlessModeEnabled()


More information about the Libreoffice-commits mailing list