diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-07 11:26:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-07 12:04:35 +0000 |
commit | 05e78bde26d8b8b257ed22a0ce20c5b386a629d1 (patch) | |
tree | bbcbccae5942edaf4557018cdb82b1b147f1d9cf /uui/source/iahndl-errorhandler.cxx | |
parent | 7edbe6529825f562e2eab0b7c19c8c0883ea4fea (diff) |
create ErrorHandlerFlags scoped enum for error handling flags
Change-Id: I30c80979c87bad7bc98f36a158c31c88d80d1caf
Reviewed-on: https://gerrit.libreoffice.org/33991
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'uui/source/iahndl-errorhandler.cxx')
-rw-r--r-- | uui/source/iahndl-errorhandler.cxx | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index 167db086a965..8be4cbb3791b 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -39,7 +39,7 @@ using namespace com::sun::star; namespace { -sal_uInt16 +ErrorHandlerFlags executeErrorDialog( vcl::Window * pParent, task::InteractionClassification eClassification, @@ -100,27 +100,29 @@ executeErrorDialog( throw uno::RuntimeException("out of memory"); } - sal_uInt16 aResult = xBox->Execute(); + sal_uInt16 aMessResult = xBox->Execute(); xBox.disposeAndClear(); - switch( aResult ) + ErrorHandlerFlags aResult = ErrorHandlerFlags::NONE; + switch( aMessResult ) { case RET_OK: - aResult = ERRCODE_BUTTON_OK; + aResult = ErrorHandlerFlags::ButtonsOk; break; case RET_CANCEL: - aResult = ERRCODE_BUTTON_CANCEL; + aResult = ErrorHandlerFlags::ButtonsCancel; break; case RET_YES: - aResult = ERRCODE_BUTTON_YES; + aResult = ErrorHandlerFlags::ButtonsYes; break; case RET_NO: - aResult = ERRCODE_BUTTON_NO; + aResult = ErrorHandlerFlags::ButtonsNo; break; case RET_RETRY: - aResult = ERRCODE_BUTTON_RETRY; + aResult = ErrorHandlerFlags::ButtonsRetry; break; + default: assert(false); } return aResult; @@ -262,12 +264,12 @@ UUIInteractionHelper::handleErrorHandlerRequest( } } - sal_uInt16 nResult = executeErrorDialog( + ErrorHandlerFlags nResult = executeErrorDialog( getParentProperty(), eClassification, aContext, aMessage, nButtonMask ); switch (nResult) { - case ERRCODE_BUTTON_OK: + case ErrorHandlerFlags::ButtonsOk: OSL_ENSURE(xApprove.is() || xAbort.is(), "unexpected situation"); if (xApprove.is()) xApprove->select(); @@ -275,29 +277,31 @@ UUIInteractionHelper::handleErrorHandlerRequest( xAbort->select(); break; - case ERRCODE_BUTTON_CANCEL: + case ErrorHandlerFlags::ButtonsCancel: OSL_ENSURE(xAbort.is(), "unexpected situation"); if (xAbort.is()) xAbort->select(); break; - case ERRCODE_BUTTON_RETRY: + case ErrorHandlerFlags::ButtonsRetry: OSL_ENSURE(xRetry.is(), "unexpected situation"); if (xRetry.is()) xRetry->select(); break; - case ERRCODE_BUTTON_NO: + case ErrorHandlerFlags::ButtonsNo: OSL_ENSURE(xDisapprove.is(), "unexpected situation"); if (xDisapprove.is()) xDisapprove->select(); break; - case ERRCODE_BUTTON_YES: + case ErrorHandlerFlags::ButtonsYes: OSL_ENSURE(xApprove.is(), "unexpected situation"); if (xApprove.is()) xApprove->select(); break; + + default: break; } } |