summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx7
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx7
-rw-r--r--sfx2/source/doc/docfile.cxx28
-rw-r--r--sfx2/source/doc/docinf.cxx2
-rw-r--r--sfx2/source/doc/docinsert.cxx4
-rw-r--r--sfx2/source/doc/docmacromode.cxx4
-rw-r--r--sfx2/source/doc/graphhelp.cxx8
-rw-r--r--sfx2/source/doc/guisaveas.cxx22
-rw-r--r--sfx2/source/doc/new.cxx3
-rw-r--r--sfx2/source/doc/objmisc.cxx18
-rw-r--r--sfx2/source/doc/objserv.cxx10
-rw-r--r--sfx2/source/doc/objstor.cxx6
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx56
13 files changed, 85 insertions, 90 deletions
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 8fb8220bb1c6..00404ec9acb2 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -1300,14 +1300,13 @@ DocumentMetadataAccess::storeMetadataToMedium(
const bool bOk = aMedium.Commit();
aMedium.Close();
if ( !bOk ) {
- sal_uInt32 nError = aMedium.GetError();
+ ErrCode nError = aMedium.GetError();
if ( nError == ERRCODE_NONE ) {
nError = ERRCODE_IO_GENERAL;
}
task::ErrorCodeIOException ex(
- ("DocumentMetadataAccess::storeMetadataToMedium Commit failed: "
- "0x" + OUString::number(nError, 16)),
- uno::Reference< uno::XInterface >(), nError);
+ "DocumentMetadataAccess::storeMetadataToMedium Commit failed: " + nError.toHexString(),
+ uno::Reference< uno::XInterface >(), sal_uInt32(nError));
throw lang::WrappedTargetException(OUString(), *this,
uno::makeAny(ex));
}
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index fa34dc6e498a..b222b8639161 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -1949,15 +1949,14 @@ SfxDocumentMetaData::storeToMedium(const OUString & URL,
const bool bOk = aMedium.Commit();
aMedium.Close();
if ( !bOk ) {
- sal_uInt32 nError = aMedium.GetError();
+ ErrCode nError = aMedium.GetError();
if ( nError == ERRCODE_NONE ) {
nError = ERRCODE_IO_GENERAL;
}
throw css::task::ErrorCodeIOException(
- ("SfxDocumentMetaData::storeToMedium <" + URL + "> Commit failed: "
- "0x" + OUString::number(nError, 16)),
- css::uno::Reference< css::uno::XInterface >(), nError);
+ "SfxDocumentMetaData::storeToMedium <" + URL + "> Commit failed: " + nError.toHexString(),
+ css::uno::Reference< css::uno::XInterface >(), sal_uInt32(nError));
}
}
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index b86dba5a7d58..ae39a016c5cf 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -167,7 +167,7 @@ class SfxMedium_Impl
{
public:
StreamMode m_nStorOpenMode;
- sal_uInt32 m_eError;
+ ErrCode m_eError;
::ucbhelper::Content aContent;
bool bUpdatePickList:1;
@@ -224,7 +224,7 @@ public:
uno::Reference<io::XStream> m_xLockingStream;
uno::Reference<task::XInteractionHandler> xInteraction;
- sal_uInt32 nLastStorageError;
+ ErrCode nLastStorageError;
OUString m_aBackupURL;
@@ -276,7 +276,7 @@ SfxMedium_Impl::SfxMedium_Impl() :
pOrigFilter( nullptr ),
aExpireTime( Date( Date::SYSTEM ) + 10, tools::Time( tools::Time::SYSTEM ) ),
pTempFile( nullptr ),
- nLastStorageError( 0 ),
+ nLastStorageError( ERRCODE_NONE ),
m_nSignatureState( SignatureState::NOSIGNATURES )
{
aDoneLink.CreateMutex();
@@ -301,19 +301,19 @@ void SfxMedium::ResetError()
pImpl->m_pOutStream->ResetError();
}
-sal_uInt32 SfxMedium::GetLastStorageCreationState()
+ErrCode SfxMedium::GetLastStorageCreationState()
{
return pImpl->nLastStorageError;
}
-void SfxMedium::SetError(sal_uInt32 nError)
+void SfxMedium::SetError(ErrCode nError)
{
pImpl->m_eError = nError;
}
-sal_uInt32 SfxMedium::GetErrorCode() const
+ErrCode SfxMedium::GetErrorCode() const
{
- sal_uInt32 lError = pImpl->m_eError;
+ ErrCode lError = pImpl->m_eError;
if(!lError && pImpl->m_pInStream)
lError = pImpl->m_pInStream->GetErrorCode();
if(!lError && pImpl->m_pOutStream)
@@ -1694,7 +1694,7 @@ void SfxMedium::TransactedTransferForFS_Impl( const INetURLObject& aSource,
pImpl->m_eError = ERRCODE_IO_GENERAL;
}
- if( !pImpl->m_eError || (pImpl->m_eError & ERRCODE_WARNING_MASK) )
+ if( !pImpl->m_eError || pImpl->m_eError.IsWarning() )
{
if ( pImpl->xStorage.is() )
CloseStorage();
@@ -1859,7 +1859,7 @@ void SfxMedium::Transfer_Impl()
SAL_WARN( "sfx.doc", "The medium name is not convertible!" );
}
- if ( !aNameURL.isEmpty() && ( !pImpl->m_eError || (pImpl->m_eError & ERRCODE_WARNING_MASK) ) )
+ if ( !aNameURL.isEmpty() && ( !pImpl->m_eError || pImpl->m_eError.IsWarning() ) )
{
SAL_INFO( "sfx.doc", "SfxMedium::Transfer_Impl, copying to target" );
@@ -2026,7 +2026,7 @@ void SfxMedium::Transfer_Impl()
pImpl->m_eError = ERRCODE_IO_GENERAL;
}
- if ( !pImpl->m_eError || (pImpl->m_eError & ERRCODE_WARNING_MASK) )
+ if ( !pImpl->m_eError || pImpl->m_eError.IsWarning() )
{
// free resources, otherwise the transfer may fail
if ( pImpl->xStorage.is() )
@@ -2122,7 +2122,7 @@ void SfxMedium::Transfer_Impl()
}
}
- if ( ( !pImpl->m_eError || (pImpl->m_eError & ERRCODE_WARNING_MASK) ) && !pImpl->pTempFile )
+ if ( ( !pImpl->m_eError || pImpl->m_eError.IsWarning() ) && !pImpl->pTempFile )
{
// without a TempFile the physical and logical name should be the same after successful transfer
if (osl::FileBase::getSystemPathFromFileURL(
@@ -2464,8 +2464,8 @@ void SfxMedium::GetMedium_Impl()
pImpl->bDownloadDone = true;
pImpl->aDoneLink.ClearPendingCall();
- sal_uIntPtr nError = GetError();
- pImpl->aDoneLink.Call( reinterpret_cast<void*>(nError) );
+ ErrCode nError = GetError();
+ pImpl->aDoneLink.Call( reinterpret_cast<void*>(sal_uInt32(nError)) );
}
}
@@ -3430,7 +3430,7 @@ void SfxMedium::CreateTempFile( bool bReplace )
if ( pImpl->m_pOutStream )
{
char *pBuf = new char [8192];
- sal_uInt32 nErr = ERRCODE_NONE;
+ ErrCode nErr = ERRCODE_NONE;
pImpl->m_pInStream->Seek(0);
pImpl->m_pOutStream->Seek(0);
diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx
index 3241a0146e55..f73407735c45 100644
--- a/sfx2/source/doc/docinf.cxx
+++ b/sfx2/source/doc/docinf.cxx
@@ -44,7 +44,7 @@ using namespace ::com::sun::star;
namespace sfx2 {
-sal_uInt32 LoadOlePropertySet(
+ErrCode LoadOlePropertySet(
const uno::Reference< document::XDocumentProperties>& i_xDocProps,
SotStorage* i_pStorage )
{
diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx
index 5957b0fa4d92..8209b4a1f4cb 100644
--- a/sfx2/source/doc/docinsert.cxx
+++ b/sfx2/source/doc/docinsert.cxx
@@ -119,7 +119,7 @@ SfxMedium* DocumentInserter::CreateMedium(char const*const pFallbackHack)
pMatcher.reset(new SfxFilterMatcher());
std::shared_ptr<const SfxFilter> pFilter;
- sal_uInt32 nError = pMatcher->DetectFilter( *pMedium, pFilter );
+ ErrCode nError = pMatcher->DetectFilter( *pMedium, pFilter );
// tdf#101813 hack: check again if it's a global document
if (ERRCODE_NONE != nError && pFallbackHack)
{
@@ -153,7 +153,7 @@ SfxMediumList* DocumentInserter::CreateMediumList()
SfxFilterMatcher aMatcher( m_sDocFactory );
std::shared_ptr<const SfxFilter> pFilter;
- sal_uInt32 nError = aMatcher.DetectFilter( *pMedium, pFilter );
+ ErrCode nError = aMatcher.DetectFilter( *pMedium, pFilter );
if ( nError == ERRCODE_NONE && pFilter )
pMedium->SetFilter( pFilter );
else
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index f9ba5ac180f8..da009871b2aa 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -83,13 +83,13 @@ namespace sfx2
namespace
{
- void lcl_showGeneralSfxErrorOnce( const Reference< XInteractionHandler >& rxHandler, const sal_Int32 nSfxErrorCode, bool& rbAlreadyShown )
+ void lcl_showGeneralSfxErrorOnce( const Reference< XInteractionHandler >& rxHandler, ErrCode nSfxErrorCode, bool& rbAlreadyShown )
{
if ( rbAlreadyShown )
return;
ErrorCodeRequest aErrorCodeRequest;
- aErrorCodeRequest.ErrCode = nSfxErrorCode;
+ aErrorCodeRequest.ErrCode = sal_uInt32(nSfxErrorCode);
SfxMedium::CallApproveHandler( rxHandler, makeAny( aErrorCodeRequest ), false );
rbAlreadyShown = true;
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index 190a2e75e847..7e78818c0732 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -95,11 +95,11 @@ void* GraphicHelper::getEnhMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta )
if ( pStream )
{
Graphic aGraph( *pGDIMeta );
- bool bFailed = GraphicConverter::Export( *pStream, aGraph, ConvertDataFormat::EMF );
+ ErrCode nFailed = GraphicConverter::Export( *pStream, aGraph, ConvertDataFormat::EMF );
pStream->Flush();
delete pStream;
- if ( !bFailed )
+ if ( !nFailed )
pResult = GetEnhMetaFileA( aWinFile.getStr() );
}
}
@@ -121,9 +121,9 @@ void* GraphicHelper::getWinMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta, co
{
SvMemoryStream pStream( 65535, 65535 );
Graphic aGraph( *pGDIMeta );
- bool bFailed = GraphicConverter::Export( pStream, aGraph, ConvertDataFormat::WMF );
+ ErrCode nFailed = GraphicConverter::Export( pStream, aGraph, ConvertDataFormat::WMF );
pStream.Flush();
- if ( !bFailed )
+ if ( !nFailed )
{
sal_Int32 nLength = pStream.Seek( STREAM_SEEK_TO_END );
if ( nLength > 22 )
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 1df20de8d694..7adac1e93a7d 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -166,7 +166,7 @@ sal_Int8 getStoreModeFromSlotName( const OUString& aSlotName )
throw task::ErrorCodeIOException(
("getStoreModeFromSlotName(\"" + aSlotName
+ "): ERRCODE_IO_INVALIDPARAMETER"),
- uno::Reference< uno::XInterface >(), ERRCODE_IO_INVALIDPARAMETER );
+ uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_INVALIDPARAMETER) );
return nResult;
}
@@ -601,7 +601,7 @@ bool ModelData_Impl::ExecuteFilterDialog_Impl( const OUString& aFilterName )
("ModelData_Impl::ExecuteFilterDialog_Impl:"
" ERRCODE_IO_ABORT"),
uno::Reference< uno::XInterface >(),
- ERRCODE_IO_ABORT);
+ sal_uInt32(ERRCODE_IO_ABORT));
}
}
}
@@ -617,7 +617,7 @@ bool ModelData_Impl::ExecuteFilterDialog_Impl( const OUString& aFilterName )
throw task::ErrorCodeIOException(
("ModelData_Impl::ExecuteFilterDialog_Impl: NoSuchElementException"
" \"" + e.Message + "\": ERRCODE_IO_ABORT"),
- uno::Reference< uno::XInterface >(), ERRCODE_IO_INVALIDPARAMETER);
+ uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_INVALIDPARAMETER));
}
catch( const task::ErrorCodeIOException& )
{
@@ -799,7 +799,7 @@ bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
throw task::ErrorCodeIOException(
"ModelData_Impl::OutputFileDialog: ERRCODE_IO_INVALIDPARAMETER",
uno::Reference< uno::XInterface >(),
- ERRCODE_IO_INVALIDPARAMETER);
+ sal_uInt32(ERRCODE_IO_INVALIDPARAMETER));
// no target file name is specified
// we need to show the file dialog
@@ -967,7 +967,7 @@ bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
{
throw task::ErrorCodeIOException(
"ModelData_Impl::OutputFileDialog: ERRCODE_IO_ABORT",
- uno::Reference< uno::XInterface >(), ERRCODE_IO_ABORT);
+ uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_ABORT));
}
// the following two arguments can not be converted in MediaDescriptor,
@@ -1302,7 +1302,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo
if ( ( nStoreMode & SAVEAS_REQUESTED ) && aModelData.CheckSaveAcceptable( STATUS_SAVEAS ) == STATUS_NO_ACTION )
throw task::ErrorCodeIOException(
"SfxStoringHelper::GUIStoreModel: ERRCODE_IO_ABORT",
- uno::Reference< uno::XInterface >(), ERRCODE_IO_ABORT);
+ uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_ABORT));
}
else if ( nStoreMode & SAVE_REQUESTED )
{
@@ -1312,7 +1312,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo
if ( nStatusSave == STATUS_NO_ACTION )
throw task::ErrorCodeIOException(
"SfxStoringHelper::GUIStoreModel: ERRCODE_IO_ABORT",
- uno::Reference< uno::XInterface >(), ERRCODE_IO_ABORT);
+ uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_ABORT));
else if ( nStatusSave == STATUS_SAVE )
{
// check whether it is possible to use save operation
@@ -1323,7 +1323,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo
{
throw task::ErrorCodeIOException(
"SfxStoringHelper::GUIStoreModel: ERRCODE_IO_ABORT",
- uno::Reference< uno::XInterface >(), ERRCODE_IO_ABORT);
+ uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_ABORT));
}
else if ( nStatusSave != STATUS_SAVE )
{
@@ -1348,7 +1348,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo
// the user has decided not to store the document
throw task::ErrorCodeIOException(
"SfxStoringHelper::GUIStoreModel: ERRCODE_IO_ABORT",
- uno::Reference< uno::XInterface >(), ERRCODE_IO_ABORT);
+ uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_ABORT));
}
}
}
@@ -1387,7 +1387,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo
if ( !aFilterProps.getLength() )
throw task::ErrorCodeIOException(
"SfxStoringHelper::GUIStoreModel: ERRCODE_IO_INVALIDPARAMETER",
- uno::Reference< uno::XInterface >(), ERRCODE_IO_INVALIDPARAMETER);
+ uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_INVALIDPARAMETER));
::comphelper::SequenceAsHashMap aFilterPropsHM( aFilterProps );
OUString aFilterName = aFilterPropsHM.getUnpackedValueOrDefault( "Name", OUString() );
@@ -1537,7 +1537,7 @@ bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >& xMo
SAL_WARN( "sfx.doc", "This code must be unreachable!" );
throw task::ErrorCodeIOException(
"SfxStoringHelper::GUIStoreModel: ERRCODE_IO_INVALIDPARAMETER",
- uno::Reference< uno::XInterface >(), ERRCODE_IO_INVALIDPARAMETER);
+ uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_INVALIDPARAMETER));
}
::comphelper::SequenceAsHashMap::const_iterator aIter =
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index 3c5716e9eed3..e10986bf6111 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -216,11 +216,10 @@ IMPL_LINK_NOARG(SfxNewFileDialog_Impl, Update, Timer*, void)
{
SfxErrorContext eEC(ERRCTX_SFX_LOADTEMPLATE,pAntiImpl);
SfxApplication *pSfxApp = SfxGetpApp();
- sal_uIntPtr lErr;
SfxItemSet* pSet = new SfxAllItemSet(pSfxApp->GetPool());
pSet->Put(SfxBoolItem(SID_TEMPLATE, true));
pSet->Put(SfxBoolItem(SID_PREVIEW, true));
- lErr = pSfxApp->LoadTemplate(xDocShell, aFileName, pSet);
+ ErrCode lErr = pSfxApp->LoadTemplate(xDocShell, aFileName, pSet);
if (lErr)
ErrorHandler::HandleError(lErr);
if (!xDocShell.Is())
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 7ff7253dfe3b..952bd34f66f2 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -197,7 +197,7 @@ void SfxObjectShell::FlushDocInfo()
(delay > 0) || !url.isEmpty() );
}
-void SfxObjectShell::SetError(sal_uInt32 lErr)
+void SfxObjectShell::SetError(ErrCode lErr)
{
if (pImpl->lErr==ERRCODE_NONE)
{
@@ -205,14 +205,14 @@ void SfxObjectShell::SetError(sal_uInt32 lErr)
}
}
-sal_uInt32 SfxObjectShell::GetError() const
+ErrCode SfxObjectShell::GetError() const
{
- return ERRCODE_TOERROR(GetErrorCode());
+ return GetErrorCode().IgnoreWarning();
}
-sal_uInt32 SfxObjectShell::GetErrorCode() const
+ErrCode SfxObjectShell::GetErrorCode() const
{
- sal_uInt32 lError=pImpl->lErr;
+ ErrCode lError=pImpl->lErr;
if(!lError && GetMedium())
lError=GetMedium()->GetErrorCode();
return lError;
@@ -220,7 +220,7 @@ sal_uInt32 SfxObjectShell::GetErrorCode() const
void SfxObjectShell::ResetError()
{
- pImpl->lErr=0;
+ pImpl->lErr=ERRCODE_NONE;
SfxMedium * pMed = GetMedium();
if( pMed )
pMed->ResetError();
@@ -965,7 +965,7 @@ void SfxObjectShell::CheckEncryption_Impl( const uno::Reference< task::XInteract
{
// this is an encrypted document with nonencrypted streams inside, show the warning
css::task::ErrorCodeRequest aErrorCode;
- aErrorCode.ErrCode = ERRCODE_SFX_INCOMPLETE_ENCRYPTION;
+ aErrorCode.ErrCode = sal_uInt32(ERRCODE_SFX_INCOMPLETE_ENCRYPTION);
SfxMedium::CallApproveHandler( xHandler, uno::makeAny( aErrorCode ), false );
pImpl->m_bIncomplEncrWarnShown = true;
@@ -1656,7 +1656,7 @@ void SfxObjectShell::InPlaceActivate( bool )
bool SfxObjectShell::UseInteractionToHandleError(
const uno::Reference< task::XInteractionHandler >& xHandler,
- sal_uInt32 nError )
+ ErrCode nError )
{
bool bResult = false;
@@ -1672,7 +1672,7 @@ bool SfxObjectShell::UseInteractionToHandleError(
lContinuations[1].set( static_cast< task::XInteractionContinuation* >( pApprove ), uno::UNO_QUERY );
task::ErrorCodeRequest aErrorCode;
- aErrorCode.ErrCode = nError;
+ aErrorCode.ErrCode = sal_uInt32(nError);
aInteraction <<= aErrorCode;
xHandler->handle(::framework::InteractionRequest::CreateRequest (aInteraction,lContinuations));
bResult = pAbort->wasSelected();
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index fea3af2af67b..dc2cfa229ed1 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -519,7 +519,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// at the end of the method
aModelGuard.Init_Impl( uno::Reference< util::XCloseable >( GetModel(), uno::UNO_QUERY ) );
- sal_uInt32 nErrorCode = ERRCODE_NONE;
+ ErrCode nErrorCode = ERRCODE_NONE;
// by default versions should be preserved always except in case of an explicit
// SaveAs via GUI, so the flag must be set accordingly
@@ -633,7 +633,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// the user has decided not to store the document
throw task::ErrorCodeIOException(
"SfxObjectShell::ExecFile_Impl: ERRCODE_IO_ABORT",
- uno::Reference< uno::XInterface >(), ERRCODE_IO_ABORT);
+ uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_IO_ABORT));
}
// merge aDispatchArgs to the request
@@ -654,7 +654,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
}
catch( const task::ErrorCodeIOException& aErrorEx )
{
- nErrorCode = (sal_uInt32)aErrorEx.ErrCode;
+ nErrorCode = ErrCode(aErrorEx.ErrCode);
}
catch( Exception& )
{
@@ -664,7 +664,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
// by default versions should be preserved always except in case of an explicit
// SaveAs via GUI, so the flag must be reset to guarantee this
pImpl->bPreserveVersions = true;
- sal_uIntPtr lErr=GetErrorCode();
+ ErrCode lErr=GetErrorCode();
if ( !lErr && nErrorCode )
lErr = nErrorCode;
@@ -790,7 +790,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
}
SetModified( false );
- sal_uIntPtr lErr = GetErrorCode();
+ ErrCode lErr = GetErrorCode();
ErrorHandler::HandleError(lErr);
rReq.SetReturnValue( SfxBoolItem(0, true) );
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index ea77377f54b5..2f87356dcaa1 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -658,7 +658,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
bool bHasStorage = IsPackageStorageFormat_Impl( *pMedium );
if ( pMedium->GetFilter() )
{
- sal_uInt32 nError = HandleFilter( pMedium, this );
+ ErrCode nError = HandleFilter( pMedium, this );
if ( nError != ERRCODE_NONE )
SetError(nError);
@@ -868,9 +868,9 @@ bool SfxObjectShell::DoLoadExternal( SfxMedium *pMed )
return LoadExternal(*pMedium);
}
-sal_uInt32 SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDoc )
+ErrCode SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDoc )
{
- sal_uInt32 nError = ERRCODE_NONE;
+ ErrCode nError = ERRCODE_NONE;
SfxItemSet* pSet = pMedium->GetItemSet();
const SfxStringItem* pOptions = SfxItemSet::GetItem<SfxStringItem>(pSet, SID_FILE_FILTEROPTIONS, false);
const SfxUnoAnyItem* pData = SfxItemSet::GetItem<SfxUnoAnyItem>(pSet, SID_FILTER_DATA, false);
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 2e2d0d325d93..e2ebee05f9bb 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1543,8 +1543,8 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue >
DELETEZ( pParams );
- sal_uInt32 nErrCode = m_pData->m_pObjectShell->GetError() ? m_pData->m_pObjectShell->GetError()
- : ERRCODE_IO_CANTWRITE;
+ ErrCode nErrCode = m_pData->m_pObjectShell->GetError() ? m_pData->m_pObjectShell->GetError()
+ : ERRCODE_IO_CANTWRITE;
m_pData->m_pObjectShell->ResetError();
if ( bRet )
@@ -1559,8 +1559,8 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue >
SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::SaveDocFailed, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCFAILED), m_pData->m_pObjectShell.get() ) );
throw task::ErrorCodeIOException(
- "SfxBaseModel::storeSelf: 0x" + OUString::number(nErrCode, 16),
- Reference< XInterface >(), nErrCode);
+ "SfxBaseModel::storeSelf: " + nErrCode.toHexString(),
+ Reference< XInterface >(), sal_uInt32(nErrCode));
}
}
@@ -1705,14 +1705,14 @@ void SAL_CALL SfxBaseModel::initNew()
throw frame::DoubleInitializationException();
bool bRes = m_pData->m_pObjectShell->DoInitNew();
- sal_uInt32 nErrCode = m_pData->m_pObjectShell->GetError() ?
- m_pData->m_pObjectShell->GetError() : ERRCODE_IO_CANTCREATE;
+ ErrCode nErrCode = m_pData->m_pObjectShell->GetError() ?
+ m_pData->m_pObjectShell->GetError() : ERRCODE_IO_CANTCREATE;
m_pData->m_pObjectShell->ResetError();
if ( !bRes )
throw task::ErrorCodeIOException(
- "SfxBaseModel::initNew: 0x" + OUString::number(nErrCode, 16),
- Reference< XInterface >(), nErrCode);
+ "SfxBaseModel::initNew: " + nErrCode.toHexString(),
+ Reference< XInterface >(), sal_uInt32(nErrCode));
}
}
@@ -1760,7 +1760,7 @@ void SAL_CALL SfxBaseModel::load( const Sequence< beans::PropertyValue >& seqA
SfxMedium* pMedium = new SfxMedium( seqArguments );
- sal_uInt32 nError = ERRCODE_NONE;
+ ErrCode nError = ERRCODE_NONE;
OUString aFilterProvider = getFilterProvider(*pMedium);
if (!aFilterProvider.isEmpty())
{
@@ -2584,7 +2584,7 @@ void SfxBaseModel::loadCmisProperties( )
}
}
-SfxMedium* SfxBaseModel::handleLoadError( sal_uInt32 nError, SfxMedium* pMedium )
+SfxMedium* SfxBaseModel::handleLoadError( ErrCode nError, SfxMedium* pMedium )
{
if (!nError)
{
@@ -2597,7 +2597,7 @@ SfxMedium* SfxBaseModel::handleLoadError( sal_uInt32 nError, SfxMedium* pMedium
if( pSilentItem )
bSilent = pSilentItem->GetValue();
- bool bWarning = ((nError & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK);
+ bool bWarning = nError.IsWarning();
if ( nError != ERRCODE_IO_BROKENPACKAGE && !bSilent )
{
// broken package was handled already
@@ -2620,8 +2620,8 @@ SfxMedium* SfxBaseModel::handleLoadError( sal_uInt32 nError, SfxMedium* pMedium
{
nError = nError ? nError : ERRCODE_IO_CANTREAD;
throw task::ErrorCodeIOException(
- "SfxBaseModel::handleLoadError: 0x" + OUString::number(nError, 16),
- Reference< XInterface >(), nError);
+ "SfxBaseModel::handleLoadError: 0x" + nError.toHexString(),
+ Reference< XInterface >(), sal_uInt32(nError));
}
return pMedium;
@@ -2902,7 +2902,7 @@ void SfxBaseModel::impl_store( const OUString& sURL
else
{
// if the password is changed a special error should be used in case of shared document
- throw task::ErrorCodeIOException("Can not change password for shared document.", uno::Reference< uno::XInterface >(), ERRCODE_SFX_SHARED_NOPASSWORDCHANGE );
+ throw task::ErrorCodeIOException("Can not change password for shared document.", uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_SFX_SHARED_NOPASSWORDCHANGE) );
}
}
#endif
@@ -2982,7 +2982,7 @@ void SfxBaseModel::impl_store( const OUString& sURL
pItemSet.reset();
- sal_uInt32 nErrCode = m_pData->m_pObjectShell->GetErrorCode();
+ ErrCode nErrCode = m_pData->m_pObjectShell->GetErrorCode();
if ( !bRet && !nErrCode )
{
SAL_WARN("sfx.doc", "Storing has failed, no error is set!");
@@ -3001,7 +3001,7 @@ void SfxBaseModel::impl_store( const OUString& sURL
SfxErrorContext aEc( ERRCTX_SFX_SAVEASDOC, m_pData->m_pObjectShell->GetTitle() );
task::ErrorCodeRequest aErrorCode;
- aErrorCode.ErrCode = nErrCode;
+ aErrorCode.ErrCode = sal_uInt32(nErrCode);
SfxMedium::CallApproveHandler( xHandler, makeAny( aErrorCode ), false );
}
}
@@ -3031,9 +3031,8 @@ void SfxBaseModel::impl_store( const OUString& sURL
m_pData->m_pObjectShell.get() ) );
throw task::ErrorCodeIOException(
- ("SfxBaseModel::impl_store <" + sURL + "> failed: 0x"
- + OUString::number(nErrCode, 16)),
- Reference< XInterface >(), nErrCode);
+ "SfxBaseModel::impl_store <" + sURL + "> failed: " + nErrCode.toHexString(),
+ Reference< XInterface >(), sal_uInt32(nErrCode));
}
}
}
@@ -3610,11 +3609,11 @@ void SAL_CALL SfxBaseModel::loadFromStorage( const Reference< embed::XStorage >&
// load document
if ( !m_pData->m_pObjectShell->DoLoad(pMedium) )
{
- sal_uInt32 nError = m_pData->m_pObjectShell->GetErrorCode();
+ ErrCode nError = m_pData->m_pObjectShell->GetErrorCode();
nError = nError ? nError : ERRCODE_IO_CANTREAD;
throw task::ErrorCodeIOException(
- "SfxBaseModel::loadFromStorage: 0x" + OUString::number(nError, 16),
- Reference< XInterface >(), nError);
+ "SfxBaseModel::loadFromStorage: " + nError.toHexString(),
+ Reference< XInterface >(), sal_uInt32(nError));
}
loadCmisProperties( );
}
@@ -3664,7 +3663,7 @@ void SAL_CALL SfxBaseModel::storeToStorage( const Reference< embed::XStorage >&
}
}
- sal_uInt32 nError = m_pData->m_pObjectShell->GetErrorCode();
+ ErrCode nError = m_pData->m_pObjectShell->GetErrorCode();
m_pData->m_pObjectShell->ResetError();
// the warnings are currently not transported
@@ -3672,8 +3671,8 @@ void SAL_CALL SfxBaseModel::storeToStorage( const Reference< embed::XStorage >&
{
nError = nError ? nError : ERRCODE_IO_GENERAL;
throw task::ErrorCodeIOException(
- "SfxBaseModel::storeToStorage: 0x" + OUString::number(nError, 16),
- Reference< XInterface >(), nError);
+ "SfxBaseModel::storeToStorage: " + nError.toHexString(),
+ Reference< XInterface >(), sal_uInt32(nError));
}
}
@@ -3689,12 +3688,11 @@ void SAL_CALL SfxBaseModel::switchToStorage( const Reference< embed::XStorage >&
{
if ( !m_pData->m_pObjectShell->SwitchPersistance( xStorage ) )
{
- sal_uInt32 nError = m_pData->m_pObjectShell->GetErrorCode();
+ ErrCode nError = m_pData->m_pObjectShell->GetErrorCode();
nError = nError ? nError : ERRCODE_IO_GENERAL;
throw task::ErrorCodeIOException(
- ("SfxBaseModel::switchToStorage: 0x"
- + OUString::number(nError, 16)),
- Reference< XInterface >(), nError);
+ "SfxBaseModel::switchToStorage: " + nError.toHexString(),
+ Reference< XInterface >(), sal_uInt32(nError));
}
else
{