From dcc667ac5ef0d7b4bbdfba0727ef6e2be3ed5313 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 22 Aug 2017 11:11:44 +0200 Subject: convert message box style bits to scoped enum and fix harmless bug in ImpSVGDialog::ImpSVGDialog, which there since commit 6456f1d81090dd5fe44455c09ae3ede7ec6ac38a Date: Fri Feb 4 14:52:54 2011 +0100 ka102: added/removed files for SVG import and module cleanup Change-Id: I66b2ec2b029431ab453e54e962863e4ed7d78962 Reviewed-on: https://gerrit.libreoffice.org/41412 Tested-by: Jenkins Reviewed-by: Noel Grandin --- uui/source/alreadyopen.cxx | 2 +- uui/source/filechanged.cxx | 2 +- uui/source/iahndl-errorhandler.cxx | 44 +++++++++++++++++++------------------- uui/source/iahndl.cxx | 10 ++++----- uui/source/lockcorrupt.cxx | 2 +- uui/source/lockfailed.cxx | 2 +- uui/source/openlocked.cxx | 2 +- uui/source/trylater.cxx | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) (limited to 'uui') diff --git a/uui/source/alreadyopen.cxx b/uui/source/alreadyopen.cxx index 755d82171edc..02687af3800b 100644 --- a/uui/source/alreadyopen.cxx +++ b/uui/source/alreadyopen.cxx @@ -22,7 +22,7 @@ #include AlreadyOpenQueryBox::AlreadyOpenQueryBox( vcl::Window* pParent, const std::locale& rLocale, const OUString& aMessage, bool bIsStoring ) : - MessBox(pParent, 0, + MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_ALREADYOPEN_TITLE, rLocale), aMessage ) { diff --git a/uui/source/filechanged.cxx b/uui/source/filechanged.cxx index 97c98d216438..e9d50ce12584 100644 --- a/uui/source/filechanged.cxx +++ b/uui/source/filechanged.cxx @@ -22,7 +22,7 @@ #include "filechanged.hxx" FileChangedQueryBox::FileChangedQueryBox( vcl::Window* pParent, const std::locale& rLocale ) : - MessBox(pParent, 0, + MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_FILECHANGED_TITLE, rLocale), OUString() ) { diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index 1277d11c17cc..9f4642ab063e 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -48,7 +48,7 @@ executeErrorDialog( task::InteractionClassification eClassification, OUString const & rContext, OUString const & rMessage, - WinBits nButtonMask) + MessBoxStyle nButtonMask) { SolarMutexGuard aGuard; @@ -76,9 +76,9 @@ executeErrorDialog( break; case task::InteractionClassification_INFO: -# define WB_DEF_BUTTONS (WB_DEF_OK | WB_DEF_CANCEL | WB_DEF_RETRY) +# define WB_DEF_BUTTONS (MessBoxStyle::DefaultOk | MessBoxStyle::DefaultCancel | MessBoxStyle::DefaultRetry) //(want to ignore any default button settings)... - if ((nButtonMask & WB_DEF_BUTTONS) == WB_DEF_OK) + if ((nButtonMask & WB_DEF_BUTTONS) == MessBoxStyle::DefaultOk) xBox.reset(VclPtr::Create(pParent, aText.makeStringAndClear())); else @@ -214,30 +214,30 @@ UUIInteractionHelper::handleErrorHandlerRequest( // Finally, it seems to be better to leave default button // determination to VCL (the favouring of CANCEL as default button // seems to not always be what the user wants)... - WinBits const aButtonMask[16] - = { 0, - WB_OK /*| WB_DEF_OK*/, // Abort - 0, - WB_RETRY_CANCEL /*| WB_DEF_CANCEL*/, // Retry, Abort - 0, - 0, - 0, - 0, - WB_OK /*| WB_DEF_OK*/, // Approve - WB_OK_CANCEL /*| WB_DEF_CANCEL*/, // Approve, Abort - 0, - 0, - WB_YES_NO /*| WB_DEF_NO*/, // Approve, Disapprove - WB_YES_NO_CANCEL /*| WB_DEF_CANCEL*/, + MessBoxStyle const aButtonMask[16] + = { MessBoxStyle::NONE, + MessBoxStyle::Ok /*| MessBoxStyle::DefaultOk*/, // Abort + MessBoxStyle::NONE, + MessBoxStyle::RetryCancel /*| MessBoxStyle::DefaultCancel*/, // Retry, Abort + MessBoxStyle::NONE, + MessBoxStyle::NONE, + MessBoxStyle::NONE, + MessBoxStyle::NONE, + MessBoxStyle::Ok /*| MessBoxStyle::DefaultOk*/, // Approve + MessBoxStyle::OkCancel /*| MessBoxStyle::DefaultCancel*/, // Approve, Abort + MessBoxStyle::NONE, + MessBoxStyle::NONE, + MessBoxStyle::YesNo /*| MessBoxStyle::DefaultNo*/, // Approve, Disapprove + MessBoxStyle::YesNoCancel /*| MessBoxStyle::DefaultCancel*/, // Approve, Disapprove, Abort - 0, - 0 }; + MessBoxStyle::NONE, + MessBoxStyle::NONE }; - WinBits nButtonMask = aButtonMask[(xApprove.is() ? 8 : 0) + MessBoxStyle nButtonMask = aButtonMask[(xApprove.is() ? 8 : 0) | (xDisapprove.is() ? 4 : 0) | (xRetry.is() ? 2 : 0) | (xAbort.is() ? 1 : 0)]; - if (nButtonMask == 0) + if (nButtonMask == MessBoxStyle::NONE) return; //TODO! remove this backwards compatibility? diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 4b61c00c8979..d136f047c3f3 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -961,7 +961,7 @@ executeMessageBox( vcl::Window * pParent, OUString const & rTitle, OUString const & rMessage, - WinBits nButtonMask ) + MessBoxStyle nButtonMask ) { SolarMutexGuard aGuard; @@ -1110,7 +1110,7 @@ UUIInteractionHelper::handleGenericErrorRequest( aTitle += aErrTitle; executeMessageBox( - getParentProperty(), aTitle, aErrorString, WB_OK ); + getParentProperty(), aTitle, aErrorString, MessBoxStyle::Ok ); } else ErrorHandler::HandleError(nErrorCode); @@ -1208,14 +1208,14 @@ UUIInteractionHelper::handleBrokenPackageRequest( return; } - WinBits nButtonMask; + MessBoxStyle nButtonMask; if( xApprove.is() && xDisapprove.is() ) { - nButtonMask = WB_YES_NO | WB_DEF_YES; + nButtonMask = MessBoxStyle::YesNo | MessBoxStyle::DefaultYes; } else if ( xAbort.is() ) { - nButtonMask = WB_OK; + nButtonMask = MessBoxStyle::Ok; } else return; diff --git a/uui/source/lockcorrupt.cxx b/uui/source/lockcorrupt.cxx index a101a6794332..5812216b0c4e 100644 --- a/uui/source/lockcorrupt.cxx +++ b/uui/source/lockcorrupt.cxx @@ -24,7 +24,7 @@ #include LockCorruptQueryBox::LockCorruptQueryBox(vcl::Window* pParent, const std::locale& rResLocale) - : MessBox(pParent, 0, Translate::get(STR_LOCKCORRUPT_TITLE, rResLocale), OUString()) + : MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_LOCKCORRUPT_TITLE, rResLocale), OUString()) { SetImage( ErrorBox::GetStandardImage() ); diff --git a/uui/source/lockfailed.cxx b/uui/source/lockfailed.cxx index e5d00b9a01a6..80209ee5fbbc 100644 --- a/uui/source/lockfailed.cxx +++ b/uui/source/lockfailed.cxx @@ -23,7 +23,7 @@ #include LockFailedQueryBox::LockFailedQueryBox(vcl::Window* pParent, const std::locale& rResLocale) - : MessBox(pParent, 0, Translate::get(STR_LOCKFAILED_TITLE, rResLocale), OUString()) + : MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_LOCKFAILED_TITLE, rResLocale), OUString()) { SetImage( ErrorBox::GetStandardImage() ); diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx index cae6baa2b0c0..dfd59425e090 100644 --- a/uui/source/openlocked.cxx +++ b/uui/source/openlocked.cxx @@ -22,7 +22,7 @@ #include OpenLockedQueryBox::OpenLockedQueryBox( vcl::Window* pParent, const std::locale& rResLocale, const OUString& aMessage ) : - MessBox(pParent, 0, + MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_OPENLOCKED_TITLE, rResLocale), aMessage ) { diff --git a/uui/source/trylater.cxx b/uui/source/trylater.cxx index a7eb623d1fc4..01a09502b286 100644 --- a/uui/source/trylater.cxx +++ b/uui/source/trylater.cxx @@ -22,7 +22,7 @@ #include "trylater.hxx" TryLaterQueryBox::TryLaterQueryBox(vcl::Window* pParent, const std::locale& rResLocale, const OUString& aMessage) - : MessBox(pParent, 0, Translate::get(STR_TRYLATER_TITLE, rResLocale), aMessage) + : MessBox(pParent, MessBoxStyle::NONE, Translate::get(STR_TRYLATER_TITLE, rResLocale), aMessage) { SetImage( QueryBox::GetStandardImage() ); -- cgit