summaryrefslogtreecommitdiff
path: root/uui/source/iahndl-errorhandler.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-08 11:12:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-09 05:47:36 +0000
commitbcad173faaffd3a3c1e6737d94d2108cf590338d (patch)
tree8370b2186548de7302eb9109ce6ac520ecf17c3b /uui/source/iahndl-errorhandler.cxx
parentafc755fa61cfd9645c4ed2507bdc3a06b721ed5c (diff)
Reapply "create ErrorHandlerFlags scoped enum for error handling flags""
This effectively reverts commit 32cae6a2eaa41568888df9c8fc5605debd8d704a. Change-Id: I15bb0a5c4acaeee6d47dd93a71601d9687d701bc Reviewed-on: https://gerrit.libreoffice.org/34028 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.cxx32
1 files changed, 18 insertions, 14 deletions
diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx
index 786ba755a298..a549cc2a4e7b 100644
--- a/uui/source/iahndl-errorhandler.cxx
+++ b/uui/source/iahndl-errorhandler.cxx
@@ -40,7 +40,7 @@ using namespace com::sun::star;
namespace {
-sal_uInt16
+ErrorHandlerFlags
executeErrorDialog(
vcl::Window * pParent,
task::InteractionClassification eClassification,
@@ -101,27 +101,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;
@@ -257,12 +259,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();
@@ -270,29 +272,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;
}
}