summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-14 13:34:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-14 15:42:31 +0200
commita6aa57ff591fdf3d834a7e0b1e9e2ebad1d87c5c (patch)
tree3de1d4767963fd78bcf6f8a90a4e2467e3a2acc5 /basic
parent546c35519125a769755330c961c7b8fc61e24d89 (diff)
use ERRCODE_NONE instead of 0
peeling off a small chunk of my ErrCode strong_int conversion Change-Id: Idc89e8496083beed7608cba705cd981139eb7111 Reviewed-on: https://gerrit.libreoffice.org/38777 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.cxx2
-rw-r--r--basic/source/classes/sbintern.cxx2
-rw-r--r--basic/source/classes/sbxmod.cxx2
-rw-r--r--basic/source/comp/scanner.cxx2
-rw-r--r--basic/source/runtime/ddectrl.cxx6
-rw-r--r--basic/source/runtime/methods.cxx2
-rw-r--r--basic/source/runtime/methods1.cxx8
-rw-r--r--basic/source/runtime/runtime.cxx26
8 files changed, 25 insertions, 25 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index cd9774b84ff0..e66cf58edf4a 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1542,7 +1542,7 @@ bool BasicManager::HasMacro( OUString const& i_fullyQualifiedName ) const
ErrCode BasicManager::ExecuteMacro( OUString const& i_fullyQualifiedName, SbxArray* i_arguments, SbxValue* i_retValue )
{
SbMethod* pMethod = lcl_queryMacro( this, i_fullyQualifiedName );
- ErrCode nError = 0;
+ ErrCode nError = ERRCODE_NONE;
if ( pMethod )
{
if ( i_arguments )
diff --git a/basic/source/classes/sbintern.cxx b/basic/source/classes/sbintern.cxx
index 20cbf6f9db6a..371f1daad2b6 100644
--- a/basic/source/classes/sbintern.cxx
+++ b/basic/source/classes/sbintern.cxx
@@ -46,7 +46,7 @@ SbiGlobals::SbiGlobals()
pMod = nullptr;
pCompMod = nullptr; // JSM
nInst = 0;
- nCode = 0;
+ nCode = ERRCODE_NONE;
nLine = 0;
nCol1 = nCol2 = 0;
bCompilerError = false;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 25b45ca3b36f..d77e7dd0f881 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1064,7 +1064,7 @@ void SbModule::Run( SbMethod* pMeth )
// Launcher problem
// i80726 The Find below will generate an error in Testtool so we reset it unless there was one before already
- bool bWasError = SbxBase::GetError() != 0;
+ bool bWasError = SbxBase::GetError() != ERRCODE_NONE;
SbxVariable* pMSOMacroRuntimeLibVar = Find( "Launcher", SbxClassType::Object );
if ( !bWasError && (SbxBase::GetError() == ERRCODE_SBX_PROC_UNDEFINED) )
SbxBase::ResetError();
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index f6c87116dc68..c851384a342b 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -376,7 +376,7 @@ bool SbiScanner::NextSym()
aSym = p; bNumber = true;
// For bad characters, scan and parse errors generate only one error.
- SbError nError = 0;
+ ErrCode nError = ERRCODE_NONE;
if (bScanError)
{
--pLine;
diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx
index c4cd17ec1765..24484b274109 100644
--- a/basic/source/runtime/ddectrl.cxx
+++ b/basic/source/runtime/ddectrl.cxx
@@ -115,7 +115,7 @@ SbError SbiDdeControl::Initiate( const OUString& rService, const OUString& rTopi
aConvList[nChannel-1] = pConv;
rnHandle = nChannel;
}
- return 0;
+ return ERRCODE_NONE;
}
SbError SbiDdeControl::Terminate( size_t nChannel )
@@ -133,7 +133,7 @@ SbError SbiDdeControl::Terminate( size_t nChannel )
delete pConv;
aConvList[nChannel-1] = DDE_FREECHANNEL;
- return 0;
+ return ERRCODE_NONE;
}
SbError SbiDdeControl::TerminateAll()
@@ -148,7 +148,7 @@ SbError SbiDdeControl::TerminateAll()
aConvList.clear();
- return 0;
+ return ERRCODE_NONE;
}
SbError SbiDdeControl::Request( size_t nChannel, const OUString& rItem, OUString& rResult )
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 92a50b638935..396ae9e8fc26 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -206,7 +206,7 @@ RTLFUNC(Error)
else
{
OUString aErrorMsg;
- SbError nErr = 0;
+ SbError nErr = ERRCODE_NONE;
sal_Int32 nCode = 0;
if( rPar.Count() == 1 )
{
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 021e7f21b950..965379d7a49f 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -1080,7 +1080,7 @@ static bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm,
{
pStrm->Seek( nFPos + nBlockLen );
}
- return pStrm->GetErrorCode() == 0;
+ return pStrm->GetErrorCode() == ERRCODE_NONE;
}
static bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm,
@@ -1191,7 +1191,7 @@ static bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm,
{
pStrm->Seek( nFPos + nBlockLen );
}
- return pStrm->GetErrorCode() == 0;
+ return pStrm->GetErrorCode() == ERRCODE_NONE;
}
@@ -2283,7 +2283,7 @@ RTLFUNC(DateDiff)
double implGetDateOfFirstDayInFirstWeek
( sal_Int16 nYear, sal_Int16& nFirstDay, sal_Int16& nFirstWeek, bool* pbError = nullptr )
{
- SbError nError = 0;
+ SbError nError = ERRCODE_NONE;
if( nFirstDay < 0 || nFirstDay > 7 )
nError = ERRCODE_BASIC_BAD_ARGUMENT;
@@ -2298,7 +2298,7 @@ double implGetDateOfFirstDayInFirstWeek
nError = ERRCODE_BASIC_BAD_ARGUMENT;
}
- if( nError != 0 )
+ if( nError != ERRCODE_NONE )
{
StarBASIC::Error( nError );
if( pbError )
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 7b8761cc750f..5054c9bf9f6a 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -585,7 +585,7 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, sal_uInt32 nStart )
nCol2 = 0;
nExprLvl = 0;
nArgc = 0;
- nError = 0;
+ nError = ERRCODE_NONE;
nForLvl = 0;
nOps = 0;
refExprStk = new SbxArray;
@@ -792,7 +792,7 @@ bool SbiRuntime::Step()
{
SbError err = nError;
ClearExprStack();
- nError = 0;
+ nError = ERRCODE_NONE;
pInst->nErr = err;
pInst->nErl = nLine;
pErrCode = pCode;
@@ -2408,7 +2408,7 @@ void SbiRuntime::StepINPUT()
char ch = 0;
SbError err;
// Skip whitespace
- while( ( err = pIosys->GetError() ) == 0 )
+ while( ( err = pIosys->GetError() ) == ERRCODE_NONE )
{
ch = pIosys->Read();
if( ch != ' ' && ch != '\t' && ch != '\n' )
@@ -2424,7 +2424,7 @@ void SbiRuntime::StepINPUT()
{
ch = pIosys->Read();
}
- while( ( err = pIosys->GetError() ) == 0 )
+ while( ( err = pIosys->GetError() ) == ERRCODE_NONE )
{
if( ch == sep )
{
@@ -2444,7 +2444,7 @@ void SbiRuntime::StepINPUT()
// skip whitespace
if( ch == ' ' || ch == '\t' )
{
- while( ( err = pIosys->GetError() ) == 0 )
+ while( ( err = pIosys->GetError() ) == ERRCODE_NONE )
{
if( ch != ' ' && ch != '\t' && ch != '\n' )
{
@@ -2588,18 +2588,18 @@ void SbiRuntime::StepSTDERROR()
{
pError = nullptr; bError = true;
pInst->aErrorMsg.clear();
- pInst->nErr = 0;
+ pInst->nErr = ERRCODE_NONE;
pInst->nErl = 0;
- nError = 0;
+ nError = ERRCODE_NONE;
SbxErrObject::getUnoErrObject()->Clear();
}
void SbiRuntime::StepNOERROR()
{
pInst->aErrorMsg.clear();
- pInst->nErr = 0;
+ pInst->nErr = ERRCODE_NONE;
pInst->nErl = 0;
- nError = 0;
+ nError = ERRCODE_NONE;
SbxErrObject::getUnoErrObject()->Clear();
bError = false;
}
@@ -3081,9 +3081,9 @@ void SbiRuntime::StepERRHDL( sal_uInt32 nOp1 )
pError = pCode;
pCode = p;
pInst->aErrorMsg.clear();
- pInst->nErr = 0;
+ pInst->nErr = ERRCODE_NONE;
pInst->nErl = 0;
- nError = 0;
+ nError = ERRCODE_NONE;
SbxErrObject::getUnoErrObject()->Clear();
}
@@ -3111,9 +3111,9 @@ void SbiRuntime::StepRESUME( sal_uInt32 nOp1 )
if( nOp1 > 1 )
StepJUMP( nOp1 );
pInst->aErrorMsg.clear();
- pInst->nErr = 0;
+ pInst->nErr = ERRCODE_NONE;
pInst->nErl = 0;
- nError = 0;
+ nError = ERRCODE_NONE;
bInError = false;
}