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

Noel Grandin noelgrandin at gmail.com
Mon May 30 06:41:34 UTC 2016


 framework/source/services/frame.cxx |    2 +-
 include/vcl/svapp.hxx               |    8 ++++----
 vcl/source/app/svapp.cxx            |    4 ++--
 vcl/source/window/dialog.cxx        |    6 +++---
 4 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 12aafb69fab3c7f91aa727ace19c1df7c53edd64
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sun May 29 13:14:41 2016 +0200

    Convert DialogCancelMode to scoped enum
    
    Change-Id: I7aca03334c6609a8729bbc88ada6ecce4309c21d
    Reviewed-on: https://gerrit.libreoffice.org/25607
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 279e261..1dbd723 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -2133,7 +2133,7 @@ void SAL_CALL Frame::disposing()
     //      (b) Don't forget to save the old value of IsDialogCancelEnabled() to
     //          restore it afterwards (to not kill headless mode).
     Application::DialogCancelMode old = Application::GetDialogCancelMode();
-    Application::SetDialogCancelMode( Application::DIALOG_CANCEL_SILENT );
+    Application::SetDialogCancelMode( Application::DialogCancelMode::Silent );
 
     // We should be alone for ever and further dispose calls are rejected by lines before ...
     // I hope it :-)
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 7d190b9..ae11418 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -232,10 +232,10 @@ private:
 class VCL_DLLPUBLIC Application
 {
 public:
-    enum DialogCancelMode {
-        DIALOG_CANCEL_OFF,      ///< do not automatically cancel dialogs
-        DIALOG_CANCEL_SILENT,   ///< silently cancel any dialogs
-        DIALOG_CANCEL_FATAL     ///< cancel any dialogs by std::abort
+    enum class DialogCancelMode {
+        Off,      ///< do not automatically cancel dialogs
+        Silent,   ///< silently cancel any dialogs
+        Fatal     ///< cancel any dialogs by std::abort
     };
 
     /** @name Initialization
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index be670e0..7fc4d4c 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -1500,7 +1500,7 @@ void Application::SetDialogCancelMode( DialogCancelMode mode )
 
 bool Application::IsDialogCancelEnabled()
 {
-    return ImplGetSVData()->maAppData.meDialogCancel != DIALOG_CANCEL_OFF;
+    return ImplGetSVData()->maAppData.meDialogCancel != DialogCancelMode::Off;
 }
 
 void Application::SetSystemWindowMode( SystemWindowFlags nMode )
@@ -1658,7 +1658,7 @@ const LocaleDataWrapper& Application::GetAppLocaleDataWrapper()
 void Application::EnableHeadlessMode( bool dialogsAreFatal )
 {
     SetDialogCancelMode(
-        dialogsAreFatal ? DIALOG_CANCEL_FATAL : DIALOG_CANCEL_SILENT );
+        dialogsAreFatal ? DialogCancelMode::Fatal : DialogCancelMode::Silent );
 }
 
 bool Application::IsHeadlessModeEnabled()
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index e7c9992..d26c584 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -803,16 +803,16 @@ bool Dialog::ImplStartExecuteModal()
 
     switch ( Application::GetDialogCancelMode() )
     {
-    case Application::DIALOG_CANCEL_OFF:
+    case Application::DialogCancelMode::Off:
         break;
-    case Application::DIALOG_CANCEL_SILENT:
+    case Application::DialogCancelMode::Silent:
         SAL_INFO(
             "vcl",
             "Dialog \"" << ImplGetDialogText(this).getStr()
                 << "\"cancelled in silent mode");
         return false;
     default: // default cannot happen
-    case Application::DIALOG_CANCEL_FATAL:
+    case Application::DialogCancelMode::Fatal:
         std::abort();
     }
 


More information about the Libreoffice-commits mailing list