diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-06 16:02:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-07 09:12:58 +0000 |
commit | b5e3f8a5fa98a249ecd50021c33cf2a5c7a3b4fc (patch) | |
tree | 7f09b0c1897bba078282fe7e78911c59f1118f04 /basic | |
parent | bcb8aaf6522745b236dead5963b24ecc6aa2eac7 (diff) |
remove ugly operator* in DynamicErrorInfo
I can see why you'd want to hide this horrible tunnelling of
information with objects registering themselves in a global list.
Urrgh.
Change-Id: Ib151a0d2d5a4508dc456e52883e488ce56d9a095
Reviewed-on: https://gerrit.libreoffice.org/33984
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 20 | ||||
-rw-r--r-- | basic/source/classes/sb.cxx | 6 |
2 files changed, 13 insertions, 13 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 9b0c92a850fc..286a9c4f5d25 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -634,10 +634,10 @@ BasicManager::BasicManager( StarBASIC* pSLib, OUString* pLibPath, bool bDocMgr ) void BasicManager::ImpMgrNotLoaded( const OUString& rStorageName ) { - // pErrInf is only destroyed if the error os processed by an + // pErrInf is only destroyed if the error is processed by an // ErrorHandler StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, rStorageName, ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENMGRSTREAM)); + aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENMGRSTREAM)); // Create a stdlib otherwise we crash! BasicLibInfo* pStdLibInfo = CreateLibInfo(); @@ -777,7 +777,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) if (!ImplLoadBasic( *xManagerStream, mpImpl->aLibs.front()->GetLibRef() )) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, aStorName, ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENMGRSTREAM)); + aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENMGRSTREAM)); // and it proceeds ... } xManagerStream->Seek( nBasicEndOff+1 ); // +1: 0x00 as separator @@ -825,7 +825,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) else { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, aStorName, ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::STORAGENOTFOUND)); + aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::STORAGENOTFOUND)); } } } @@ -908,7 +908,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora if ( !xBasicStorage.is() || xBasicStorage->GetError() ) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, xStorage->GetName(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTORAGE)); + aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTORAGE)); } else { @@ -917,7 +917,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora if ( !xBasicStream.is() || xBasicStream->GetError() ) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD , pLibInfo->GetLibName(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTREAM)); + aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTREAM)); } else { @@ -940,7 +940,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora if ( !bLoaded ) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, pLibInfo->GetLibName(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::BASICLOADERROR)); + aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::BASICLOADERROR)); } else { @@ -1124,7 +1124,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage ) if( !nLib || nLib < mpImpl->aLibs.size() ) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::STDLIB)); + aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::STDLIB)); return false; } @@ -1160,7 +1160,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage ) if ( !xBasicStorage.is() || xBasicStorage->GetError() ) { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTORAGE)); + aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTORAGE)); } else if (xBasicStorage->IsStream((*itLibInfo)->GetLibName())) { @@ -1295,7 +1295,7 @@ bool BasicManager::LoadLib( sal_uInt16 nLib ) else { StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, OUString(), ERRCODE_BUTTON_OK ); - aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::LIBNOTFOUND)); + aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::LIBNOTFOUND)); } return bDone; } diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 60d71c79a445..74cec84f634c 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -1663,7 +1663,7 @@ bool StarBASIC::CError( SbError code, const OUString& rMsg, // Implementation of the code for the string transport to SFX-Error if( !rMsg.isEmpty() ) { - code = (SbError)*new StringErrorInfo( code, rMsg ); + code = (SbError)(new StringErrorInfo( code, rMsg ))->GetErrorCode(); } SetErrorData( code, l, c1, c2 ); GetSbData()->bCompilerError = true; @@ -1702,11 +1702,11 @@ bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_In { OUString aTmp = "\'" + OUString::number(SbxErrObject::getUnoErrObject()->getNumber()) + "\'\n" + OUString(!GetSbData()->aErrMsg.isEmpty() ? GetSbData()->aErrMsg : rMsg); - code = (SbError)*new StringErrorInfo( code, aTmp ); + code = (SbError)(new StringErrorInfo( code, aTmp ))->GetErrorCode(); } else { - code = (SbError)*new StringErrorInfo( code, rMsg ); + code = (SbError)(new StringErrorInfo( code, rMsg ))->GetErrorCode(); } } |