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 /sw/source/uibase/uiview/view2.cxx | |
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 'sw/source/uibase/uiview/view2.cxx')
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 1fc001e2830d..2250d4985c2d 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -468,27 +468,18 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq ) } sal_uInt32 nResId(0); - switch( nError ) - { - case ERRCODE_GRFILTER_OPENERROR: - nResId = STR_GRFILTER_OPENERROR; - break; - case ERRCODE_GRFILTER_IOERROR: - nResId = STR_GRFILTER_IOERROR; - break; - case ERRCODE_GRFILTER_FORMATERROR: - nResId = STR_GRFILTER_FORMATERROR; - break; - case ERRCODE_GRFILTER_VERSIONERROR: - nResId = STR_GRFILTER_VERSIONERROR; - break; - case ERRCODE_GRFILTER_FILTERERROR: - nResId = STR_GRFILTER_FILTERERROR; - break; - case ERRCODE_GRFILTER_TOOBIG: - nResId = STR_GRFILTER_TOOBIG; - break; - } + if( nError == ERRCODE_GRFILTER_OPENERROR ) + nResId = STR_GRFILTER_OPENERROR; + else if( nError == ERRCODE_GRFILTER_IOERROR ) + nResId = STR_GRFILTER_IOERROR; + else if( nError ==ERRCODE_GRFILTER_FORMATERROR ) + nResId = STR_GRFILTER_FORMATERROR; + else if( nError ==ERRCODE_GRFILTER_VERSIONERROR ) + nResId = STR_GRFILTER_VERSIONERROR; + else if( nError ==ERRCODE_GRFILTER_FILTERERROR ) + nResId = STR_GRFILTER_FILTERERROR; + else if( nError ==ERRCODE_GRFILTER_TOOBIG ) + nResId = STR_GRFILTER_TOOBIG; rSh.EndAction(); rSh.UnlockPaint(); @@ -2156,7 +2147,7 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe SfxObjectShellRef aRef( pDocSh ); - sal_uInt32 nError = SfxObjectShell::HandleFilter( pMedium, pDocSh ); + ErrCode nError = SfxObjectShell::HandleFilter( pMedium, pDocSh ); // #i16722# aborted? if(nError != ERRCODE_NONE) { @@ -2176,7 +2167,7 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe SwDoc *pDoc = pDocSh->GetDoc(); if( pRead && pDocSh->GetDoc() ) nUndoCheck = lcl_PageDescWithHeader( *pDoc ); - sal_uLong nErrno; + ErrCode nErrno; { //Scope for SwWait-Object, to be able to execute slots //outside this scope. SwWait aWait( *GetDocShell(), true ); @@ -2195,7 +2186,7 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe SwXTextRange::CreateXTextRange(*pDoc, *m_pWrtShell->GetCursor()->GetPoint(), nullptr)); nErrno = pDocSh->ImportFrom(*pMedium, xInsertPosition) - ? 0 : ERR_SWG_READ_ERROR; + ? ERRCODE_NONE : ERR_SWG_READ_ERROR; } } @@ -2221,7 +2212,7 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe if( nErrno ) { ErrorHandler::HandleError( nErrno ); - nFound = IsError( nErrno ) ? -1 : 0; + nFound = nErrno.IsError() ? -1 : 0; } else nFound = 0; |