summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-05-29 13:14:41 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-30 06:40:58 +0000
commit12aafb69fab3c7f91aa727ace19c1df7c53edd64 (patch)
tree4fb40811d3df46863a07b1bd2688570b54f56161
parentf3fd69585db35dd0ba229b080705927733e8f949 (diff)
Convert DialogCancelMode to scoped enum
Change-Id: I7aca03334c6609a8729bbc88ada6ecce4309c21d Reviewed-on: https://gerrit.libreoffice.org/25607 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--framework/source/services/frame.cxx2
-rw-r--r--include/vcl/svapp.hxx8
-rw-r--r--vcl/source/app/svapp.cxx4
-rw-r--r--vcl/source/window/dialog.cxx6
4 files changed, 10 insertions, 10 deletions
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 279e2616979c..1dbd72316b6d 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 7d190b9f83fa..ae1141862526 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 be670e0a9160..7fc4d4cfbfc1 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 e7c9992969ff..d26c58429ecc 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();
}