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 /svtools | |
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 'svtools')
-rw-r--r-- | svtools/source/misc/ehdl.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index 57b75f475875..eb432c7ce2e7 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -139,7 +139,7 @@ static DialogMask aWndFunc( } -SfxErrorHandler::SfxErrorHandler(sal_uInt16 nIdP, sal_uLong lStartP, sal_uLong lEndP, ResMgr *pMgrP) : +SfxErrorHandler::SfxErrorHandler(sal_uInt16 nIdP, ErrCode lStartP, ErrCode lEndP, ResMgr *pMgrP) : lStart(lStartP), lEnd(lEndP), nId(nIdP), pMgr(pMgrP), pFreeMgr( nullptr ) @@ -167,7 +167,7 @@ bool SfxErrorHandler::CreateString(const ErrorInfo *pErr, OUString &rStr) const */ { - sal_uLong nErrCode = pErr->GetErrorCode() & ERRCODE_ERROR_MASK; + ErrCode nErrCode = pErr->GetErrorCode().IgnoreWarning(); if( nErrCode>=lEnd || nErrCode<=lStart ) return false; if(GetErrorString(nErrCode, rStr)) @@ -213,7 +213,7 @@ void SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr) } } -bool SfxErrorHandler::GetErrorString(sal_uLong lErrId, OUString &rStr) const +bool SfxErrorHandler::GetErrorString(ErrCode lErrId, OUString &rStr) const /* [Description] @@ -229,7 +229,7 @@ bool SfxErrorHandler::GetErrorString(sal_uLong lErrId, OUString &rStr) const rStr = RID_ERRHDL_CLASS; ResStringArray aEr(ResId(nId, *pMgr)); - sal_uInt32 nErrIdx = aEr.FindIndex((sal_uInt16)lErrId); + sal_uInt32 nErrIdx = aEr.FindIndex((sal_uInt16)(sal_uInt32)lErrId); if (nErrIdx != RESARRAY_INDEX_NOTFOUND) { rStr = rStr.replaceAll("$(ERROR)", aEr.GetString(nErrIdx)); @@ -241,7 +241,7 @@ bool SfxErrorHandler::GetErrorString(sal_uLong lErrId, OUString &rStr) const if( bRet ) { OUString aErrStr; - GetClassString(lErrId & ERRCODE_CLASS_MASK, + GetClassString((sal_uInt32)lErrId & ERRCODE_CLASS_MASK, aErrStr); if(!aErrStr.isEmpty()) aErrStr += ".\n"; @@ -271,7 +271,7 @@ SfxErrorContext::SfxErrorContext( } -bool SfxErrorContext::GetString(sal_uInt32 nErrId, OUString &rStr) +bool SfxErrorContext::GetString(ErrCode nErrId, OUString &rStr) /* [Description] @@ -305,7 +305,7 @@ bool SfxErrorContext::GetString(sal_uInt32 nErrId, OUString &rStr) if ( bRet ) { - sal_uInt16 nId = ( nErrId & ERRCODE_WARNING_MASK ) ? ERRCTX_WARNING : ERRCTX_ERROR; + sal_uInt16 nId = nErrId.IsWarning() ? ERRCTX_WARNING : ERRCTX_ERROR; ResStringArray aEr(ResId(RID_ERRCTX, *pMgr)); rStr = rStr.replaceAll("$(ERR)", aEr.GetString(nId)); } |