diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-02-07 23:02:28 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-02-07 23:02:28 +0100 |
commit | 32cae6a2eaa41568888df9c8fc5605debd8d704a (patch) | |
tree | a17234bc71f7cbde274bfa2c9930d7ea2dfe35bf /tools | |
parent | 178f5306979ef55a5682191dcdafb9e926e57cde (diff) |
Revert "create ErrorHandlerFlags scoped enum for error handling flags"
This reverts commit 05e78bde26d8b8b257ed22a0ce20c5b386a629d1.
Depends on the other commit that needs reverting
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/ref/errinf.cxx | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx index 754a888e1743..539151c40583 100644 --- a/tools/source/ref/errinf.cxx +++ b/tools/source/ref/errinf.cxx @@ -47,8 +47,8 @@ struct TheEDcrData: public rtl::Static<EDcrData, TheEDcrData> {}; class DynamicErrorInfo_Impl { - ErrCode lErrId; - ErrorHandlerFlags nMask; + sal_uIntPtr lErrId; + sal_uInt16 nMask; void RegisterEDcr(DynamicErrorInfo *); static void UnRegisterEDcr(DynamicErrorInfo const *); @@ -110,7 +110,7 @@ sal_uIntPtr DynamicErrorInfo::GetErrorCode() const return pImpl->lErrId; } -DynamicErrorInfo::DynamicErrorInfo(sal_uIntPtr lArgUserId, ErrorHandlerFlags nMask) +DynamicErrorInfo::DynamicErrorInfo(sal_uIntPtr lArgUserId, sal_uInt16 nMask) : ErrorInfo(lArgUserId), pImpl(new DynamicErrorInfo_Impl) { @@ -133,13 +133,13 @@ ErrorInfo* DynamicErrorInfo_Impl::GetDynamicErrorInfo(sal_uIntPtr lId) return new ErrorInfo(lId & ~ERRCODE_DYNAMIC_MASK); } -ErrorHandlerFlags DynamicErrorInfo::GetDialogMask() const +sal_uInt16 DynamicErrorInfo::GetDialogMask() const { return pImpl->nMask; } StringErrorInfo::StringErrorInfo( - sal_uIntPtr UserId, const OUString& aStringP, ErrorHandlerFlags nMask) + sal_uIntPtr UserId, const OUString& aStringP, sal_uInt16 nMask) : DynamicErrorInfo(UserId, nMask), aString(aStringP) { } @@ -147,7 +147,7 @@ StringErrorInfo::StringErrorInfo( class ErrorHandler_Impl { public: - static bool CreateString(const ErrorInfo*, OUString&, ErrorHandlerFlags&); + static bool CreateString(const ErrorInfo*, OUString&, sal_uInt16&); }; static void aDspFunc(const OUString &rErr, const OUString &rAction) @@ -226,25 +226,25 @@ void ErrorHandler::RegisterDisplay(BasicDisplayErrorFunc *aDsp) 1. nFlags, 2. Resource Flags 3. Dynamic Flags - 4. Default ButtonsOk, MessageError + 4. Default ERRCODE_BUTTON_OK, ERRCODE_MSG_ERROR - @param nErrCodeId error id + @param lId error id @param nFlags error flags. @param bJustCreateString ??? @param rError ??? @return ??? */ -ErrorHandlerFlags ErrorHandler::HandleError_Impl( - sal_uIntPtr nErrCodeId, ErrorHandlerFlags nFlags, bool bJustCreateString, OUString & rError) +sal_uInt16 ErrorHandler::HandleError_Impl( + sal_uIntPtr lId, sal_uInt16 nFlags, bool bJustCreateString, OUString & rError) { OUString aErr; OUString aAction; - if(!nErrCodeId || nErrCodeId == ERRCODE_ABORT) - return ErrorHandlerFlags::NONE; + if(!lId || lId == ERRCODE_ABORT) + return 0; EDcrData &rData = TheEDcrData::get(); vcl::Window *pParent = nullptr; - ErrorInfo *pInfo = ErrorInfo::GetErrorInfo(nErrCodeId); + ErrorInfo *pInfo = ErrorInfo::GetErrorInfo(lId); if (!rData.contexts.empty()) { rData.contexts.front()->GetString(pInfo->GetErrorCode(), aAction); @@ -257,18 +257,18 @@ ErrorHandlerFlags ErrorHandler::HandleError_Impl( } } - bool bWarning = ((nErrCodeId & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK); - ErrorHandlerFlags nErrFlags = ErrorHandlerFlags::ButtonDefaultsOk | ErrorHandlerFlags::ButtonsOk; + bool bWarning = ((lId & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK); + sal_uInt16 nErrFlags = ERRCODE_BUTTON_DEF_OK | ERRCODE_BUTTON_OK; if (bWarning) - nErrFlags |= ErrorHandlerFlags::MessageWarning; + nErrFlags |= ERRCODE_MSG_WARNING; else - nErrFlags |= ErrorHandlerFlags::MessageError; + nErrFlags |= ERRCODE_MSG_ERROR; DynamicErrorInfo* pDynPtr=dynamic_cast<DynamicErrorInfo*>(pInfo); if(pDynPtr) { - ErrorHandlerFlags nDynFlags = pDynPtr->GetDialogMask(); - if( nDynFlags != ErrorHandlerFlags::NONE ) + sal_uInt16 nDynFlags = pDynPtr->GetDialogMask(); + if( nDynFlags ) nErrFlags = nDynFlags; } @@ -277,7 +277,7 @@ ErrorHandlerFlags ErrorHandler::HandleError_Impl( if (bJustCreateString) { rError = aErr; - return ErrorHandlerFlags::ButtonsOk; + return 1; } else { @@ -295,11 +295,11 @@ ErrorHandlerFlags ErrorHandler::HandleError_Impl( if(!rData.bIsWindowDsp) { (*reinterpret_cast<BasicDisplayErrorFunc*>(rData.pDsp))(aErr,aAction); - return ErrorHandlerFlags::NONE; + return 0; } else { - if (nFlags != ErrorHandlerFlags::MAX) + if (nFlags != USHRT_MAX) nErrFlags = nFlags; return (*reinterpret_cast<WindowDisplayErrorFunc*>(rData.pDsp))( pParent, nErrFlags, aErr, aAction); @@ -311,34 +311,34 @@ ErrorHandlerFlags ErrorHandler::HandleError_Impl( // Error 1 is General Error in the Sfx if(pInfo->GetErrorCode()!=1) { - HandleError_Impl(1, ErrorHandlerFlags::MAX, bJustCreateString, rError); + HandleError_Impl(1, USHRT_MAX, bJustCreateString, rError); } else { OSL_FAIL("Error 1 nicht gehandeled"); } delete pInfo; - return ErrorHandlerFlags::NONE; + return 0; } // static bool ErrorHandler::GetErrorString(sal_uIntPtr lId, OUString& rStr) { - return HandleError_Impl( lId, ErrorHandlerFlags::MAX, true, rStr ) != ErrorHandlerFlags::NONE; + return (bool)HandleError_Impl( lId, USHRT_MAX, true, rStr ); } /** Handles an error. @see ErrorHandler::HandleError_Impl */ -ErrorHandlerFlags ErrorHandler::HandleError(sal_uIntPtr lId, ErrorHandlerFlags nFlags) +sal_uInt16 ErrorHandler::HandleError(sal_uIntPtr lId, sal_uInt16 nFlags) { OUString aDummy; return HandleError_Impl( lId, nFlags, false, aDummy ); } bool ErrorHandler_Impl::CreateString( const ErrorInfo* pInfo, OUString& pStr, - ErrorHandlerFlags &rFlags) + sal_uInt16 &rFlags) { for(const ErrorHandler *pHdl : TheEDcrData::get().errorHandlers) { |