diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-09 08:52:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-21 08:42:30 +0200 |
commit | 528632660b72b105345945c13c5b68060d94a91b (patch) | |
tree | 860508d482959abeb9175f0ce6b9e65954269f95 /uui | |
parent | aee66aa85e75f67135e5c6079a281e18402d261a (diff) |
convert ErrCode to strong typedef
would have preferred to re-use o3tl::strong_int, of which this
is a modified copy, but there are lots of convenience accessors
which are nice to define on the class.
Change-Id: I301b807aaf02fbced3bf75de1e1692cde6c0340a
Reviewed-on: https://gerrit.libreoffice.org/38497
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'uui')
-rw-r--r-- | uui/source/iahndl-errorhandler.cxx | 8 | ||||
-rw-r--r-- | uui/source/iahndl-ssl.cxx | 4 | ||||
-rw-r--r-- | uui/source/iahndl.cxx | 14 | ||||
-rw-r--r-- | uui/source/iahndl.hxx | 2 | ||||
-rw-r--r-- | uui/source/ids.hrc | 130 |
5 files changed, 79 insertions, 79 deletions
diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index 5c0c389607f1..72236f972f25 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -156,11 +156,11 @@ UUIInteractionHelper::handleErrorHandlerRequest( = { RID_ERRHDL, RID_SVXERRCODE, RID_UUI_ERRHDL }; - ErrCode nErrorId = nErrorCode & ~ERRCODE_WARNING_MASK; - Source eSource = nErrorId < ERRCODE_AREA_LIB1 ? + ErrCode nErrorId = nErrorCode.IgnoreWarning(); + Source eSource = nErrorId < ErrCode(ERRCODE_AREA_LIB1) ? SOURCE_DEFAULT : - nErrorId >= ERRCODE_AREA_SVX - && nErrorId <= ERRCODE_AREA_SVX_END ? + nErrorId >= ErrCode(ERRCODE_AREA_SVX) + && nErrorId <= ErrCode(ERRCODE_AREA_SVX_END) ? SOURCE_SVX : SOURCE_UUI; diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx index c3b48ed0d19d..6ace40b53192 100644 --- a/uui/source/iahndl-ssl.cxx +++ b/uui/source/iahndl-ssl.cxx @@ -220,7 +220,7 @@ executeSSLWarnDialog( { ResId aResId(RID_UUI_ERRHDL, *xManager.get()); if (ErrorResource(aResId).getString( - ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + DESCRIPTION_1, + ErrCode(sal_uInt32(ERRCODE_AREA_UUI_UNKNOWNAUTH) + failure + DESCRIPTION_1), aMessage_1)) { aMessage_1 = UUIInteractionHelper::replaceMessageWithArguments( @@ -230,7 +230,7 @@ executeSSLWarnDialog( OUString aTitle; if (ErrorResource(aResId).getString( - ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + TITLE, aTitle)) + ErrCode(sal_uInt32(ERRCODE_AREA_UUI_UNKNOWNAUTH) + failure + TITLE), aTitle)) { xDialog->SetText(aTitle); } diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 2fa698b14ea7..6febfae49664 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -486,7 +486,7 @@ UUIInteractionHelper::handleRequest_impl( { std::vector< OUString > aArguments; handleErrorHandlerRequest( aAppException.Classification, - aAppException.Code, + ErrCode(aAppException.Code), aArguments, rRequest->getContinuations(), bObtainErrorStringOnly, @@ -725,7 +725,7 @@ UUIInteractionHelper::handleRequest_impl( task::ErrorCodeRequest aErrorCodeRequest; if (aAnyRequest >>= aErrorCodeRequest) { - handleGenericErrorRequest( aErrorCodeRequest.ErrCode, + handleGenericErrorRequest( ErrCode(aErrorCodeRequest.ErrCode), rRequest->getContinuations(), bObtainErrorStringOnly, bHasErrorString, @@ -736,7 +736,7 @@ UUIInteractionHelper::handleRequest_impl( task::ErrorCodeIOException aErrorCodeIOException; if (aAnyRequest >>= aErrorCodeIOException) { - handleGenericErrorRequest( aErrorCodeIOException.ErrCode, + handleGenericErrorRequest( ErrCode(aErrorCodeIOException.ErrCode), rRequest->getContinuations(), bObtainErrorStringOnly, bHasErrorString, @@ -1075,7 +1075,7 @@ UUIInteractionHelper::handleNameClashResolveRequest( void UUIInteractionHelper::handleGenericErrorRequest( - sal_Int32 nErrorCode, + ErrCode nErrorCode, uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations, bool bObtainErrorStringOnly, @@ -1101,8 +1101,8 @@ UUIInteractionHelper::handleGenericErrorRequest( // Note: It's important to convert the transported long to the // required unsigned long value. Otherwhise using as flag field // can fail ... - ErrCode nError = static_cast< ErrCode >(nErrorCode); - bool bWarning = !ERRCODE_TOERROR(nError); + ErrCode nError(nErrorCode); + bool bWarning = !nError.IgnoreWarning(); if ( nError == ERRCODE_SFX_INCOMPLETE_ENCRYPTION ) { @@ -1274,7 +1274,7 @@ bool ErrorResource::getString(ErrCode nErrorCode, OUString &rString) const { - sal_uInt32 nIdx = m_aStringArray.FindIndex(nErrorCode & ERRCODE_RES_MASK); + sal_uInt32 nIdx = m_aStringArray.FindIndex(nErrorCode.GetRest()); if (nIdx == RESARRAY_INDEX_NOTFOUND) return false; rString = m_aStringArray.GetString(nIdx); diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 87c662766ea1..558951b3ef90 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -199,7 +199,7 @@ private: void handleGenericErrorRequest( - sal_Int32 nErrorCode, + ErrCode nErrorCode, css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > const & rContinuations, bool bObtainErrorStringOnly, diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc index 635c708d3d8c..d019907c8d65 100644 --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -71,76 +71,76 @@ #define STR_TITLE_ENTER_PASSWORD (RID_UUI_START + 65) #define STR_PASSWORD_MISMATCH (RID_UUI_START + 66) -#define ERRCODE_UUI_IO_ABORT (ERRCODE_AREA_UUI + 0) -#define ERRCODE_UUI_IO_ACCESSDENIED (ERRCODE_AREA_UUI + 1) -#define ERRCODE_UUI_IO_ALREADYEXISTS (ERRCODE_AREA_UUI + 2) -#define ERRCODE_UUI_IO_BADCRC (ERRCODE_AREA_UUI + 3) -#define ERRCODE_UUI_IO_CANTCREATE (ERRCODE_AREA_UUI + 4) -#define ERRCODE_UUI_IO_CANTREAD (ERRCODE_AREA_UUI + 5) -#define ERRCODE_UUI_IO_CANTSEEK (ERRCODE_AREA_UUI + 6) -#define ERRCODE_UUI_IO_CANTTELL (ERRCODE_AREA_UUI + 7) -#define ERRCODE_UUI_IO_CANTWRITE (ERRCODE_AREA_UUI + 8) -#define ERRCODE_UUI_IO_CURRENTDIR (ERRCODE_AREA_UUI + 9) -#define ERRCODE_UUI_IO_NOTREADY (ERRCODE_AREA_UUI + 10) -#define ERRCODE_UUI_IO_NOTSAMEDEVICE (ERRCODE_AREA_UUI + 11) -#define ERRCODE_UUI_IO_GENERAL (ERRCODE_AREA_UUI + 12) -#define ERRCODE_UUI_IO_INVALIDACCESS (ERRCODE_AREA_UUI + 13) -#define ERRCODE_UUI_IO_INVALIDCHAR (ERRCODE_AREA_UUI + 14) -#define ERRCODE_UUI_IO_INVALIDDEVICE (ERRCODE_AREA_UUI + 15) -#define ERRCODE_UUI_IO_INVALIDLENGTH (ERRCODE_AREA_UUI + 16) -#define ERRCODE_UUI_IO_INVALIDPARAMETER (ERRCODE_AREA_UUI + 17) -#define ERRCODE_UUI_IO_ISWILDCARD (ERRCODE_AREA_UUI + 18) -#define ERRCODE_UUI_IO_LOCKVIOLATION (ERRCODE_AREA_UUI + 19) -#define ERRCODE_UUI_IO_MISPLACEDCHAR (ERRCODE_AREA_UUI + 20) -#define ERRCODE_UUI_IO_NAMETOOLONG (ERRCODE_AREA_UUI + 21) -#define ERRCODE_UUI_IO_NOTEXISTS (ERRCODE_AREA_UUI + 22) -#define ERRCODE_UUI_IO_NOTEXISTSPATH (ERRCODE_AREA_UUI + 23) -#define ERRCODE_UUI_IO_NOTSUPPORTED (ERRCODE_AREA_UUI + 24) -#define ERRCODE_UUI_IO_NOTADIRECTORY (ERRCODE_AREA_UUI + 25) -#define ERRCODE_UUI_IO_NOTAFILE (ERRCODE_AREA_UUI + 26) -#define ERRCODE_UUI_IO_OUTOFSPACE (ERRCODE_AREA_UUI + 27) -#define ERRCODE_UUI_IO_TOOMANYOPENFILES (ERRCODE_AREA_UUI + 28) -#define ERRCODE_UUI_IO_OUTOFMEMORY (ERRCODE_AREA_UUI + 29) -#define ERRCODE_UUI_IO_PENDING (ERRCODE_AREA_UUI + 30) -#define ERRCODE_UUI_IO_RECURSIVE (ERRCODE_AREA_UUI + 31) -#define ERRCODE_UUI_IO_UNKNOWN (ERRCODE_AREA_UUI + 32) -#define ERRCODE_UUI_IO_WRITEPROTECTED (ERRCODE_AREA_UUI + 33) -#define ERRCODE_UUI_IO_WRONGFORMAT (ERRCODE_AREA_UUI + 34) -#define ERRCODE_UUI_IO_WRONGVERSION (ERRCODE_AREA_UUI + 35) -#define ERRCODE_UUI_IO_NOTEXISTS_VOLUME (ERRCODE_AREA_UUI + 36) -#define ERRCODE_UUI_IO_NOTEXISTS_FOLDER (ERRCODE_AREA_UUI + 37) -#define ERRCODE_UUI_WRONGJAVA (ERRCODE_AREA_UUI + 38) -#define ERRCODE_UUI_WRONGJAVA_VERSION (ERRCODE_AREA_UUI + 39) -#define ERRCODE_UUI_WRONGJAVA_MIN (ERRCODE_AREA_UUI + 40) -#define ERRCODE_UUI_WRONGJAVA_VERSION_MIN (ERRCODE_AREA_UUI + 41) -#define ERRCODE_UUI_BADPARTNERSHIP (ERRCODE_AREA_UUI + 42) -#define ERRCODE_UUI_BADPARTNERSHIP_NAME (ERRCODE_AREA_UUI + 43) -#define ERRCODE_UUI_IO_NOTREADY_VOLUME (ERRCODE_AREA_UUI + 44) -#define ERRCODE_UUI_IO_NOTREADY_REMOVABLE (ERRCODE_AREA_UUI + 45) -#define ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE (ERRCODE_AREA_UUI + 46) -#define ERRCODE_UUI_WRONGMEDIUM (ERRCODE_AREA_UUI + 47) -#define ERRCODE_UUI_IO_CANTCREATE_NONAME (ERRCODE_AREA_UUI + 48) -#define ERRCODE_UUI_IO_TARGETALREADYEXISTS (ERRCODE_AREA_UUI + 49) -#define ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE (ERRCODE_AREA_UUI + 50) -#define ERRCODE_UUI_IO_BROKENPACKAGE (ERRCODE_AREA_UUI + 51) -#define ERRCODE_UUI_IO_BROKENPACKAGE_CANTREPAIR (ERRCODE_AREA_UUI + 52) -#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE (ERRCODE_AREA_UUI + 53) -#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE (ERRCODE_AREA_UUI + 54) -#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING (ERRCODE_AREA_UUI + 55) -#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING_WITHRECOVER (ERRCODE_AREA_UUI + 56) -#define ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA (ERRCODE_AREA_UUI + 57) -#define ERRCODE_UUI_IO_MODULESIZEEXCEEDED (ERRCODE_AREA_UUI + 58) -#define ERRCODE_UUI_LOCKING_LOCKED (ERRCODE_AREA_UUI + 59) -#define ERRCODE_UUI_LOCKING_LOCKED_SELF (ERRCODE_AREA_UUI + 60) -#define ERRCODE_UUI_LOCKING_NOT_LOCKED (ERRCODE_AREA_UUI + 61) -#define ERRCODE_UUI_LOCKING_LOCK_EXPIRED (ERRCODE_AREA_UUI + 62) -#define ERRCODE_UUI_CANNOT_ACTIVATE_FACTORY (ERRCODE_AREA_UUI + 63) +#define ERRCODE_UUI_IO_ABORT ErrCode(ERRCODE_AREA_UUI + 0) +#define ERRCODE_UUI_IO_ACCESSDENIED ErrCode(ERRCODE_AREA_UUI + 1) +#define ERRCODE_UUI_IO_ALREADYEXISTS ErrCode(ERRCODE_AREA_UUI + 2) +#define ERRCODE_UUI_IO_BADCRC ErrCode(ERRCODE_AREA_UUI + 3) +#define ERRCODE_UUI_IO_CANTCREATE ErrCode(ERRCODE_AREA_UUI + 4) +#define ERRCODE_UUI_IO_CANTREAD ErrCode(ERRCODE_AREA_UUI + 5) +#define ERRCODE_UUI_IO_CANTSEEK ErrCode(ERRCODE_AREA_UUI + 6) +#define ERRCODE_UUI_IO_CANTTELL ErrCode(ERRCODE_AREA_UUI + 7) +#define ERRCODE_UUI_IO_CANTWRITE ErrCode(ERRCODE_AREA_UUI + 8) +#define ERRCODE_UUI_IO_CURRENTDIR ErrCode(ERRCODE_AREA_UUI + 9) +#define ERRCODE_UUI_IO_NOTREADY ErrCode(ERRCODE_AREA_UUI + 10) +#define ERRCODE_UUI_IO_NOTSAMEDEVICE ErrCode(ERRCODE_AREA_UUI + 11) +#define ERRCODE_UUI_IO_GENERAL ErrCode(ERRCODE_AREA_UUI + 12) +#define ERRCODE_UUI_IO_INVALIDACCESS ErrCode(ERRCODE_AREA_UUI + 13) +#define ERRCODE_UUI_IO_INVALIDCHAR ErrCode(ERRCODE_AREA_UUI + 14) +#define ERRCODE_UUI_IO_INVALIDDEVICE ErrCode(ERRCODE_AREA_UUI + 15) +#define ERRCODE_UUI_IO_INVALIDLENGTH ErrCode(ERRCODE_AREA_UUI + 16) +#define ERRCODE_UUI_IO_INVALIDPARAMETER ErrCode(ERRCODE_AREA_UUI + 17) +#define ERRCODE_UUI_IO_ISWILDCARD ErrCode(ERRCODE_AREA_UUI + 18) +#define ERRCODE_UUI_IO_LOCKVIOLATION ErrCode(ERRCODE_AREA_UUI + 19) +#define ERRCODE_UUI_IO_MISPLACEDCHAR ErrCode(ERRCODE_AREA_UUI + 20) +#define ERRCODE_UUI_IO_NAMETOOLONG ErrCode(ERRCODE_AREA_UUI + 21) +#define ERRCODE_UUI_IO_NOTEXISTS ErrCode(ERRCODE_AREA_UUI + 22) +#define ERRCODE_UUI_IO_NOTEXISTSPATH ErrCode(ERRCODE_AREA_UUI + 23) +#define ERRCODE_UUI_IO_NOTSUPPORTED ErrCode(ERRCODE_AREA_UUI + 24) +#define ERRCODE_UUI_IO_NOTADIRECTORY ErrCode(ERRCODE_AREA_UUI + 25) +#define ERRCODE_UUI_IO_NOTAFILE ErrCode(ERRCODE_AREA_UUI + 26) +#define ERRCODE_UUI_IO_OUTOFSPACE ErrCode(ERRCODE_AREA_UUI + 27) +#define ERRCODE_UUI_IO_TOOMANYOPENFILES ErrCode(ERRCODE_AREA_UUI + 28) +#define ERRCODE_UUI_IO_OUTOFMEMORY ErrCode(ERRCODE_AREA_UUI + 29) +#define ERRCODE_UUI_IO_PENDING ErrCode(ERRCODE_AREA_UUI + 30) +#define ERRCODE_UUI_IO_RECURSIVE ErrCode(ERRCODE_AREA_UUI + 31) +#define ERRCODE_UUI_IO_UNKNOWN ErrCode(ERRCODE_AREA_UUI + 32) +#define ERRCODE_UUI_IO_WRITEPROTECTED ErrCode(ERRCODE_AREA_UUI + 33) +#define ERRCODE_UUI_IO_WRONGFORMAT ErrCode(ERRCODE_AREA_UUI + 34) +#define ERRCODE_UUI_IO_WRONGVERSION ErrCode(ERRCODE_AREA_UUI + 35) +#define ERRCODE_UUI_IO_NOTEXISTS_VOLUME ErrCode(ERRCODE_AREA_UUI + 36) +#define ERRCODE_UUI_IO_NOTEXISTS_FOLDER ErrCode(ERRCODE_AREA_UUI + 37) +#define ERRCODE_UUI_WRONGJAVA ErrCode(ERRCODE_AREA_UUI + 38) +#define ERRCODE_UUI_WRONGJAVA_VERSION ErrCode(ERRCODE_AREA_UUI + 39) +#define ERRCODE_UUI_WRONGJAVA_MIN ErrCode(ERRCODE_AREA_UUI + 40) +#define ERRCODE_UUI_WRONGJAVA_VERSION_MIN ErrCode(ERRCODE_AREA_UUI + 41) +#define ERRCODE_UUI_BADPARTNERSHIP ErrCode(ERRCODE_AREA_UUI + 42) +#define ERRCODE_UUI_BADPARTNERSHIP_NAME ErrCode(ERRCODE_AREA_UUI + 43) +#define ERRCODE_UUI_IO_NOTREADY_VOLUME ErrCode(ERRCODE_AREA_UUI + 44) +#define ERRCODE_UUI_IO_NOTREADY_REMOVABLE ErrCode(ERRCODE_AREA_UUI + 45) +#define ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE ErrCode(ERRCODE_AREA_UUI + 46) +#define ERRCODE_UUI_WRONGMEDIUM ErrCode(ERRCODE_AREA_UUI + 47) +#define ERRCODE_UUI_IO_CANTCREATE_NONAME ErrCode(ERRCODE_AREA_UUI + 48) +#define ERRCODE_UUI_IO_TARGETALREADYEXISTS ErrCode(ERRCODE_AREA_UUI + 49) +#define ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE ErrCode(ERRCODE_AREA_UUI + 50) +#define ERRCODE_UUI_IO_BROKENPACKAGE ErrCode(ERRCODE_AREA_UUI + 51) +#define ERRCODE_UUI_IO_BROKENPACKAGE_CANTREPAIR ErrCode(ERRCODE_AREA_UUI + 52) +#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE ErrCode(ERRCODE_AREA_UUI + 53) +#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE ErrCode(ERRCODE_AREA_UUI + 54) +#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING ErrCode(ERRCODE_AREA_UUI + 55) +#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING_WITHRECOVER ErrCode(ERRCODE_AREA_UUI + 56) +#define ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA ErrCode(ERRCODE_AREA_UUI + 57) +#define ERRCODE_UUI_IO_MODULESIZEEXCEEDED ErrCode(ERRCODE_AREA_UUI + 58) +#define ERRCODE_UUI_LOCKING_LOCKED ErrCode(ERRCODE_AREA_UUI + 59) +#define ERRCODE_UUI_LOCKING_LOCKED_SELF ErrCode(ERRCODE_AREA_UUI + 60) +#define ERRCODE_UUI_LOCKING_NOT_LOCKED ErrCode(ERRCODE_AREA_UUI + 61) +#define ERRCODE_UUI_LOCKING_LOCK_EXPIRED ErrCode(ERRCODE_AREA_UUI + 62) +#define ERRCODE_UUI_CANNOT_ACTIVATE_FACTORY ErrCode(ERRCODE_AREA_UUI + 63) #define ERRCODE_AREA_UUI_UNKNOWNAUTH 25000 #define SSLWARN_TYPE_DOMAINMISMATCH 10 #define SSLWARN_TYPE_EXPIRED 20 #define SSLWARN_TYPE_INVALID 30 -#define ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED (ERRCODE_AREA_UUI_UNKNOWNAUTH + 1) +#define ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED ErrCode(ERRCODE_AREA_UUI_UNKNOWNAUTH + 1) #define ERRCODE_UUI_SSLWARN_EXPIRED_1 (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_EXPIRED + 1) #define TITLE_UUI_SSLWARN_EXPIRED (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_EXPIRED + 3) |