summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/appinit.cxx6
-rw-r--r--sfx2/source/appl/appopen.cxx20
-rw-r--r--sfx2/source/appl/macroloader.cxx2
-rw-r--r--sfx2/source/appl/opengrf.cxx32
4 files changed, 27 insertions, 33 deletions
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index e6e7596a01aa..e098600f70a6 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -211,7 +211,7 @@ void SfxApplication::Initialize_Impl()
Help::EnableExtHelp();
pImpl->m_pToolsErrorHdl = new SfxErrorHandler(
- RID_ERRHDL, ERRCODE_AREA_TOOLS, ERRCODE_AREA_LIB1);
+ RID_ERRHDL, ErrCode(ERRCODE_AREA_TOOLS), ErrCode(ERRCODE_AREA_LIB1));
#if HAVE_FEATURE_SCRIPTING
pImpl->pBasicResMgr = ResMgr::CreateResMgr("sb");
@@ -219,10 +219,10 @@ void SfxApplication::Initialize_Impl()
pImpl->pSvtResMgr = ResMgr::CreateResMgr("svt");
pImpl->m_pSoErrorHdl = new SfxErrorHandler(
- RID_SO_ERROR_HANDLER, ERRCODE_AREA_SO, ERRCODE_AREA_SO_END, pImpl->pSvtResMgr );
+ RID_SO_ERROR_HANDLER, ErrCode(ERRCODE_AREA_SO), ErrCode(ERRCODE_AREA_SO_END), pImpl->pSvtResMgr );
#if HAVE_FEATURE_SCRIPTING
pImpl->m_pSbxErrorHdl = new SfxErrorHandler(
- RID_BASIC_START, ERRCODE_AREA_SBX, ERRCODE_AREA_SBX_END, pImpl->pBasicResMgr );
+ RID_BASIC_START, ErrCode(ERRCODE_AREA_SBX), ErrCode(ERRCODE_AREA_SBX_END), pImpl->pBasicResMgr );
#endif
if (!utl::ConfigManager::IsAvoidConfig())
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index d4717a16d733..9821f16e56b0 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -170,7 +170,7 @@ private:
}
-sal_uInt32 CheckPasswd_Impl
+ErrCode CheckPasswd_Impl
(
SfxObjectShell* pDoc,
SfxMedium* pFile // the Medium and its Password shold be obtained
@@ -184,7 +184,7 @@ sal_uInt32 CheckPasswd_Impl
If the set does not exist the it is created.
*/
{
- sal_uIntPtr nRet = ERRCODE_NONE;
+ ErrCode nRet = ERRCODE_NONE;
if( ( !pFile->GetFilter() || pFile->IsStorage() ) )
{
@@ -271,7 +271,7 @@ sal_uInt32 CheckPasswd_Impl
}
-sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUString &rFileName, SfxItemSet* pSet )
+ErrCode SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUString &rFileName, SfxItemSet* pSet )
{
std::shared_ptr<const SfxFilter> pFilter;
SfxMedium aMedium( rFileName, ( StreamMode::READ | StreamMode::SHARE_DENYNONE ) );
@@ -286,8 +286,8 @@ sal_uIntPtr SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUStri
}
aMedium.UseInteractionHandler( true );
- sal_uIntPtr nErr = GetFilterMatcher().GuessFilter( aMedium, pFilter, SfxFilterFlags::TEMPLATE, SfxFilterFlags::NONE );
- if ( 0 != nErr)
+ ErrCode nErr = GetFilterMatcher().GuessFilter( aMedium, pFilter, SfxFilterFlags::TEMPLATE, SfxFilterFlags::NONE );
+ if ( ERRCODE_NONE != nErr)
{
delete pSet;
return ERRCODE_SFX_NOTATEMPLATE;
@@ -488,7 +488,7 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
}
}
- sal_uIntPtr lErr = 0;
+ ErrCode lErr = ERRCODE_NONE;
SfxItemSet* pSet = new SfxAllItemSet( GetPool() );
pSet->Put( SfxBoolItem( SID_TEMPLATE, true ) );
if ( !bDirect )
@@ -506,7 +506,7 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
if ( lErr != ERRCODE_NONE )
{
- sal_uIntPtr lFatalErr = ERRCODE_TOERROR(lErr);
+ ErrCode lFatalErr = lErr.IgnoreWarning();
if ( lFatalErr )
ErrorHandler::HandleError(lErr);
}
@@ -639,7 +639,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
pBlackListItem->GetStringList( aBlackList );
- sal_uIntPtr nErr = sfx2::FileOpenDialog_Impl(
+ ErrCode nErr = sfx2::FileOpenDialog_Impl(
nDialogType,
eDialogFlags, OUString(), aURLList,
aFilter, pSet, &aPath, nDialog, sStandardDir, aBlackList );
@@ -716,9 +716,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
css::task::ErrorCodeRequest aRequest;
if (aRule.m_xRequest->getRequest() >>= aRequest)
{
- if (aRequest.ErrCode ==
- sal::static_int_cast< sal_Int32 >(
- ERRCODE_SFX_NOMOREDOCUMENTSALLOWED))
+ if (aRequest.ErrCode == sal_Int32(sal_uInt32(ERRCODE_SFX_NOMOREDOCUMENTSALLOWED)))
break;
}
}
diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx
index ce1e85e0c88b..7621ea7665b8 100644
--- a/sfx2/source/appl/macroloader.cxx
+++ b/sfx2/source/appl/macroloader.cxx
@@ -159,7 +159,7 @@ uno::Any SAL_CALL SfxMacroLoader::dispatchWithReturnValue(
beans::PropertyValue aErrorCode;
aErrorCode.Name = "ErrorCode";
- aErrorCode.Value <<= nErr;
+ aErrorCode.Value <<= sal_uInt32(nErr);
aRet <<= aErrorCode;
}
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index ef3a060d99cc..51ce43006f71 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -57,20 +57,16 @@ using namespace ::cppu;
sal_uInt16 SvxOpenGrfErr2ResId( ErrCode err )
{
- switch( err )
- {
- case ERRCODE_GRFILTER_OPENERROR:
- return RID_SVXSTR_GRFILTER_OPENERROR;
- case ERRCODE_GRFILTER_IOERROR:
- return RID_SVXSTR_GRFILTER_IOERROR;
- case ERRCODE_GRFILTER_VERSIONERROR:
- return RID_SVXSTR_GRFILTER_VERSIONERROR;
- case ERRCODE_GRFILTER_FILTERERROR:
- return RID_SVXSTR_GRFILTER_FILTERERROR;
- case ERRCODE_GRFILTER_FORMATERROR:
- default:
- return RID_SVXSTR_GRFILTER_FORMATERROR;
- }
+ if (err == ERRCODE_GRFILTER_OPENERROR)
+ return RID_SVXSTR_GRFILTER_OPENERROR;
+ else if (err == ERRCODE_GRFILTER_IOERROR)
+ return RID_SVXSTR_GRFILTER_IOERROR;
+ else if (err == ERRCODE_GRFILTER_VERSIONERROR)
+ return RID_SVXSTR_GRFILTER_VERSIONERROR;
+ else if (err == ERRCODE_GRFILTER_FILTERERROR)
+ return RID_SVXSTR_GRFILTER_FILTERERROR;
+ else
+ return RID_SVXSTR_GRFILTER_FORMATERROR;
}
@@ -104,9 +100,9 @@ SvxOpenGraphicDialog::~SvxOpenGraphicDialog()
}
-short SvxOpenGraphicDialog::Execute()
+ErrCode SvxOpenGraphicDialog::Execute()
{
- sal_uInt16 nImpRet;
+ ErrCode nImpRet;
bool bQuitLoop(false);
while( !bQuitLoop &&
@@ -174,7 +170,7 @@ short SvxOpenGraphicDialog::Execute()
}
// cancel
- return -1;
+ return ErrCode(sal_uInt32(-1));
}
@@ -243,7 +239,7 @@ bool SvxOpenGraphicDialog::IsAsLink() const
}
-int SvxOpenGraphicDialog::GetGraphic(Graphic& rGraphic) const
+ErrCode SvxOpenGraphicDialog::GetGraphic(Graphic& rGraphic) const
{
return mpImpl->aFileDlg.GetGraphic(rGraphic);
}