From 32cae6a2eaa41568888df9c8fc5605debd8d704a Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 7 Feb 2017 23:02:28 +0100 Subject: Revert "create ErrorHandlerFlags scoped enum for error handling flags" This reverts commit 05e78bde26d8b8b257ed22a0ce20c5b386a629d1. Depends on the other commit that needs reverting --- uui/source/iahndl-authentication.cxx | 26 +++++++++++++------------- uui/source/iahndl-errorhandler.cxx | 32 ++++++++++++++------------------ uui/source/iahndl.cxx | 26 +++++++++++--------------- uui/source/loginerr.hxx | 10 +++++----- 4 files changed, 43 insertions(+), 51 deletions(-) (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 3701f73886c7..9e07550ee5db 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -113,8 +113,8 @@ executeLoginDialog( if ( bCanUseSysCreds ) xDialog->SetUseSystemCredentials( rInfo.GetIsUseSystemCredentials() ); - rInfo.SetResult(xDialog->Execute() == RET_OK ? ErrorHandlerFlags::ButtonsOk : - ErrorHandlerFlags::ButtonsCancel); + rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : + ERRCODE_BUTTON_CANCEL); rInfo.SetUserName(xDialog->GetName()); rInfo.SetPassword(xDialog->GetPassword()); rInfo.SetAccount(xDialog->GetAccount()); @@ -276,7 +276,7 @@ handleAuthenticationRequest_( rRequest.HasRealm ? rRequest.Realm : OUString()); switch (aInfo.GetResult()) { - case ErrorHandlerFlags::ButtonsOk: + case ERRCODE_BUTTON_OK: if (xSupplyAuthentication.is()) { if (xSupplyAuthentication->canSetUserName()) @@ -390,7 +390,7 @@ handleAuthenticationRequest_( } break; - case ErrorHandlerFlags::ButtonsRetry: + case ERRCODE_BUTTON_RETRY: if (xRetry.is()) xRetry->select(); break; @@ -419,7 +419,7 @@ executeMasterPasswordDialog( ScopedVclPtrInstance< MasterPasswordCreateDialog > xDialog( pParent, xManager.get()); rInfo.SetResult(xDialog->Execute() - == RET_OK ? ErrorHandlerFlags::ButtonsOk : ErrorHandlerFlags::ButtonsCancel); + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); aMaster = OUStringToOString( xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8); } @@ -428,7 +428,7 @@ executeMasterPasswordDialog( ScopedVclPtrInstance< MasterPasswordDialog > xDialog( pParent, nMode, xManager.get()); rInfo.SetResult(xDialog->Execute() - == RET_OK ? ErrorHandlerFlags::ButtonsOk : ErrorHandlerFlags::ButtonsCancel); + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); aMaster = OUStringToOString( xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8); } @@ -476,7 +476,7 @@ handleMasterPasswordRequest_( switch (aInfo.GetResult()) { - case ErrorHandlerFlags::ButtonsOk: + case ERRCODE_BUTTON_OK: if (xSupplyAuthentication.is()) { if (xSupplyAuthentication->canSetPassword()) @@ -485,7 +485,7 @@ handleMasterPasswordRequest_( } break; - case ErrorHandlerFlags::ButtonsRetry: + case ERRCODE_BUTTON_RETRY: if (xRetry.is()) xRetry->select(); break; @@ -520,7 +520,7 @@ executePasswordDialog( bIsPasswordToModify, bIsSimplePasswordRequest); xDialog->SetMinLen(0); - rInfo.SetResult(xDialog->Execute() == RET_OK ? ErrorHandlerFlags::ButtonsOk : ErrorHandlerFlags::ButtonsCancel); + rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); rInfo.SetPassword(xDialog->GetPassword()); } else @@ -531,7 +531,7 @@ executePasswordDialog( ScopedVclPtr const pDialog( pFact->CreatePasswordToOpenModifyDialog(pParent, nMaxPasswdLen, bIsPasswordToModify)); - rInfo.SetResult( pDialog->Execute() == RET_OK ? ErrorHandlerFlags::ButtonsOk : ErrorHandlerFlags::ButtonsCancel ); + rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); rInfo.SetPassword( pDialog->GetPasswordToOpen() ); rInfo.SetPasswordToModify( pDialog->GetPasswordToModify() ); rInfo.SetRecommendToOpenReadonly( pDialog->IsRecommendToOpenReadonly() ); @@ -543,7 +543,7 @@ executePasswordDialog( bIsPasswordToModify, bIsSimplePasswordRequest); xDialog->SetMinLen(0); - rInfo.SetResult(xDialog->Execute() == RET_OK ? ErrorHandlerFlags::ButtonsOk : ErrorHandlerFlags::ButtonsCancel); + rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); rInfo.SetPassword(bIsPasswordToModify ? OUString() : xDialog->GetPassword()); rInfo.SetPasswordToModify(bIsPasswordToModify ? xDialog->GetPassword() : OUString()); } @@ -582,7 +582,7 @@ handlePasswordRequest_( switch (aInfo.GetResult()) { - case ErrorHandlerFlags::ButtonsOk: + case ERRCODE_BUTTON_OK: OSL_ENSURE( !bIsPasswordToModify || xPassword2.is(), "PasswordToModify is requested, but there is no Interaction!" ); if (xPassword.is()) { @@ -597,7 +597,7 @@ handlePasswordRequest_( } break; - case ErrorHandlerFlags::ButtonsRetry: + case ERRCODE_BUTTON_RETRY: if (xRetry.is()) xRetry->select(); break; diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index a549cc2a4e7b..786ba755a298 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -40,7 +40,7 @@ using namespace com::sun::star; namespace { -ErrorHandlerFlags +sal_uInt16 executeErrorDialog( vcl::Window * pParent, task::InteractionClassification eClassification, @@ -101,29 +101,27 @@ executeErrorDialog( throw uno::RuntimeException("out of memory"); } - sal_uInt16 aMessResult = xBox->Execute(); + sal_uInt16 aResult = xBox->Execute(); xBox.disposeAndClear(); - ErrorHandlerFlags aResult = ErrorHandlerFlags::NONE; - switch( aMessResult ) + switch( aResult ) { case RET_OK: - aResult = ErrorHandlerFlags::ButtonsOk; + aResult = ERRCODE_BUTTON_OK; break; case RET_CANCEL: - aResult = ErrorHandlerFlags::ButtonsCancel; + aResult = ERRCODE_BUTTON_CANCEL; break; case RET_YES: - aResult = ErrorHandlerFlags::ButtonsYes; + aResult = ERRCODE_BUTTON_YES; break; case RET_NO: - aResult = ErrorHandlerFlags::ButtonsNo; + aResult = ERRCODE_BUTTON_NO; break; case RET_RETRY: - aResult = ErrorHandlerFlags::ButtonsRetry; + aResult = ERRCODE_BUTTON_RETRY; break; - default: assert(false); } return aResult; @@ -259,12 +257,12 @@ UUIInteractionHelper::handleErrorHandlerRequest( } } - ErrorHandlerFlags nResult = executeErrorDialog( + sal_uInt16 nResult = executeErrorDialog( getParentProperty(), eClassification, aContext, aMessage, nButtonMask ); switch (nResult) { - case ErrorHandlerFlags::ButtonsOk: + case ERRCODE_BUTTON_OK: OSL_ENSURE(xApprove.is() || xAbort.is(), "unexpected situation"); if (xApprove.is()) xApprove->select(); @@ -272,31 +270,29 @@ UUIInteractionHelper::handleErrorHandlerRequest( xAbort->select(); break; - case ErrorHandlerFlags::ButtonsCancel: + case ERRCODE_BUTTON_CANCEL: OSL_ENSURE(xAbort.is(), "unexpected situation"); if (xAbort.is()) xAbort->select(); break; - case ErrorHandlerFlags::ButtonsRetry: + case ERRCODE_BUTTON_RETRY: OSL_ENSURE(xRetry.is(), "unexpected situation"); if (xRetry.is()) xRetry->select(); break; - case ErrorHandlerFlags::ButtonsNo: + case ERRCODE_BUTTON_NO: OSL_ENSURE(xDisapprove.is(), "unexpected situation"); if (xDisapprove.is()) xDisapprove->select(); break; - case ErrorHandlerFlags::ButtonsYes: + case ERRCODE_BUTTON_YES: OSL_ENSURE(xApprove.is(), "unexpected situation"); if (xApprove.is()) xApprove->select(); break; - - default: break; } } diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index f2915b119e49..31074fb015c2 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -987,7 +987,7 @@ UUIInteractionHelper::getInteractionHandler() namespace { -ErrorHandlerFlags +sal_uInt16 executeMessageBox( vcl::Window * pParent, OUString const & rTitle, @@ -998,26 +998,24 @@ executeMessageBox( ScopedVclPtrInstance< MessBox > xBox(pParent, nButtonMask, rTitle, rMessage); - sal_uInt16 aMessResult = xBox->Execute(); - ErrorHandlerFlags aResult = ErrorHandlerFlags::NONE; - switch( aMessResult ) + sal_uInt16 aResult = xBox->Execute(); + switch( aResult ) { case RET_OK: - aResult = ErrorHandlerFlags::ButtonsOk; + aResult = ERRCODE_BUTTON_OK; break; case RET_CANCEL: - aResult = ErrorHandlerFlags::ButtonsCancel; + aResult = ERRCODE_BUTTON_CANCEL; break; case RET_YES: - aResult = ErrorHandlerFlags::ButtonsYes; + aResult = ERRCODE_BUTTON_YES; break; case RET_NO: - aResult = ErrorHandlerFlags::ButtonsNo; + aResult = ERRCODE_BUTTON_NO; break; case RET_RETRY: - aResult = ErrorHandlerFlags::ButtonsRetry; + aResult = ERRCODE_BUTTON_RETRY; break; - default: assert(false); } return aResult; @@ -1272,25 +1270,23 @@ UUIInteractionHelper::handleBrokenPackageRequest( switch ( executeMessageBox( getParentProperty(), title, aMessage, nButtonMask ) ) { - case ErrorHandlerFlags::ButtonsOk: + case ERRCODE_BUTTON_OK: OSL_ENSURE( xAbort.is(), "unexpected situation" ); if (xAbort.is()) xAbort->select(); break; - case ErrorHandlerFlags::ButtonsNo: + case ERRCODE_BUTTON_NO: OSL_ENSURE(xDisapprove.is(), "unexpected situation"); if (xDisapprove.is()) xDisapprove->select(); break; - case ErrorHandlerFlags::ButtonsYes: + case ERRCODE_BUTTON_YES: OSL_ENSURE(xApprove.is(), "unexpected situation"); if (xApprove.is()) xApprove->select(); break; - - default: break; } } diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx index ae0775a3f154..db4ce88d5178 100644 --- a/uui/source/loginerr.hxx +++ b/uui/source/loginerr.hxx @@ -43,13 +43,13 @@ private: OUString m_aPath; OUString m_aErrorText; sal_uInt8 m_nFlags; - ErrorHandlerFlags m_nRet; + sal_uInt16 m_nRet; bool m_bRecommendToOpenReadonly; public: LoginErrorInfo() : m_nFlags(LOGINERROR_FLAG_MODIFY_USER_NAME) - , m_nRet(ErrorHandlerFlags::ButtonsCancel) + , m_nRet(ERRCODE_BUTTON_CANCEL) , m_bRecommendToOpenReadonly(false) { } @@ -71,8 +71,8 @@ public: bool GetIsUseSystemCredentials() const { return ( m_nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) == LOGINERROR_FLAG_IS_USE_SYSCREDS; } - sal_uInt8 GetFlags() const { return m_nFlags; } - ErrorHandlerFlags GetResult() const { return m_nRet; } + sal_uInt8 GetFlags() const { return m_nFlags; } + sal_uInt16 GetResult() const { return m_nRet; } void SetTitle( const OUString& aTitle ) { m_aTitle = aTitle; } @@ -100,7 +100,7 @@ public: inline void SetModifyAccount( bool bSet ); inline void SetModifyUserName( bool bSet ); - void SetResult( ErrorHandlerFlags nRet ) + void SetResult( sal_uInt16 nRet ) { m_nRet = nRet; } }; -- cgit