Kaydet (Commit) 14c763e7 authored tarafından Noel Grandin's avatar Noel Grandin

s/ERRCODE_SBX_OK/ERRCODE_NONE

adds no value

Change-Id: Iedf7a6a7be28fed4059b576312890be8cbb980d7
Reviewed-on: https://gerrit.libreoffice.org/39056Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 6580e171
......@@ -1945,7 +1945,7 @@ void StackWindow::UpdateCalls()
}
SbxBase::ResetError();
if( eOld != ERRCODE_SBX_OK )
if( eOld != ERRCODE_NONE )
SbxBase::SetError( eOld );
}
else
......@@ -2581,7 +2581,7 @@ void WatchTreeListBox::UpdateWatches( bool bBasicStopped )
Invalidate();
SbxBase::ResetError();
if( eOld != ERRCODE_SBX_OK )
if( eOld != ERRCODE_NONE )
SbxBase::SetError( eOld );
setBasicWatchMode( false );
}
......
......@@ -986,7 +986,7 @@ StarBASIC::~StarBASIC()
lclRemoveDocBasicItem( *this );
SbxBase::ResetError();
if( eOld != ERRCODE_SBX_OK )
if( eOld != ERRCODE_NONE )
{
SbxBase::SetError( eOld );
}
......@@ -1357,7 +1357,7 @@ bool StarBASIC::Call( const OUString& rName, SbxArray* pParam )
{
ErrCode eErr = SbxBase::GetError();
SbxBase::ResetError();
if( eErr != ERRCODE_SBX_OK )
if( eErr != ERRCODE_NONE )
{
RTError( eErr, OUString(), 0, 0, 0 );
}
......
......@@ -334,7 +334,7 @@ RTLFUNC(CDbl) // JSM
// #41690
OUString aScanStr = pSbxVariable->GetOUString();
ErrCode Error = SbxValue::ScanNumIntnl( aScanStr, nVal );
if( Error != ERRCODE_SBX_OK )
if( Error != ERRCODE_NONE )
{
StarBASIC::Error( Error );
}
......@@ -403,7 +403,7 @@ RTLFUNC(CSng) // JSM
double dVal = 0.0;
OUString aScanStr = pSbxVariable->GetOUString();
ErrCode Error = SbxValue::ScanNumIntnl( aScanStr, dVal, /*bSingle=*/true );
if( SbxBase::GetError() == ERRCODE_SBX_OK && Error != ERRCODE_SBX_OK )
if( SbxBase::GetError() == ERRCODE_NONE && Error != ERRCODE_NONE )
{
StarBASIC::Error( Error );
}
......
......@@ -1604,7 +1604,7 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe
// Alternatively it is possible that the same scenario
// could overwrite and existing error. Lets prevent that
SbxObjectRef xVarObj = static_cast<SbxObject*>(refVar->GetObject());
if ( eOldErr != ERRCODE_SBX_OK )
if ( eOldErr != ERRCODE_NONE )
SbxBase::SetError( eOldErr );
else
SbxBase::ResetError();
......
......@@ -551,7 +551,7 @@ void SbxDimArray::Clear()
void SbxDimArray::AddDimImpl32( sal_Int32 lb, sal_Int32 ub, bool bAllowSize0 )
{
ErrCode eRes = ERRCODE_SBX_OK;
ErrCode eRes = ERRCODE_NONE;
if( ub < lb && !bAllowSize0 )
{
eRes = ERRCODE_SBX_BOUNDS;
......
......@@ -34,7 +34,7 @@
SbxAppData::SbxAppData()
: eErrCode(ERRCODE_SBX_OK)
: eErrCode(ERRCODE_NONE)
, pBasicFormater(nullptr)
, eBasicFormaterLangType(LANGUAGE_DONTKNOW)
{
......@@ -102,18 +102,18 @@ ErrCode SbxBase::GetError()
void SbxBase::SetError( ErrCode e )
{
SbxAppData& r = GetSbxData_Impl();
if( e && r.eErrCode == ERRCODE_SBX_OK )
if( e && r.eErrCode == ERRCODE_NONE )
r.eErrCode = e;
}
bool SbxBase::IsError()
{
return GetSbxData_Impl().eErrCode != ERRCODE_SBX_OK;
return GetSbxData_Impl().eErrCode != ERRCODE_NONE;
}
void SbxBase::ResetError()
{
GetSbxData_Impl().eErrCode = ERRCODE_SBX_OK;
GetSbxData_Impl().eErrCode = ERRCODE_NONE;
}
void SbxBase::AddFactory( SbxFactory* pFac )
......
......@@ -80,7 +80,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* p )
double n;
SbxDataType t;
sal_uInt16 nLen = 0;
if( ImpScan( *p->pOUString, n, t, &nLen ) == ERRCODE_SBX_OK )
if( ImpScan( *p->pOUString, n, t, &nLen ) == ERRCODE_NONE )
{
if( nLen == p->pOUString->getLength() )
{
......
......@@ -161,7 +161,7 @@ start:
{
double d;
SbxDataType t;
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_NONE )
nRes = 0;
else if( d > SbxMAXBYTE )
{
......
......@@ -147,7 +147,7 @@ start:
{
double d;
SbxDataType t;
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_NONE )
nRes = 0;
else if( d > SbxMAXCHAR )
{
......
......@@ -81,7 +81,7 @@ double ImpGetDouble( const SbxValues* p )
{
double d;
SbxDataType t;
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_NONE )
{
nRes = 0;
#if HAVE_FEATURE_SCRIPTING
......
......@@ -154,7 +154,7 @@ start:
{
double d;
SbxDataType t;
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_NONE )
nRes = 0;
else if( d > SbxMAXINT )
{
......@@ -440,7 +440,7 @@ start:
// Check if really 0 or invalid conversion
double d;
SbxDataType t;
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_NONE )
nRes = 0;
else
nRes = (sal_Int64) d;
......@@ -702,7 +702,7 @@ start:
// Check if really 0 or invalid conversion
double d;
SbxDataType t;
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_NONE )
nRes = 0;
else if( d > SbxMAXSALUINT64 )
{
......
......@@ -118,7 +118,7 @@ start:
{
double d;
SbxDataType t;
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_NONE )
nRes = 0;
else if( d > SbxMAXLNG )
{
......
......@@ -268,7 +268,7 @@ ErrCode ImpScan( const OUString& rWSrc, double& nVal, SbxDataType& rType,
if( bMinus )
nVal = -nVal;
rType = eScanType;
return ERRCODE_SBX_OK;
return ERRCODE_NONE;
}
// port for CDbl in the Basic
......@@ -279,7 +279,7 @@ ErrCode SbxValue::ScanNumIntnl( const OUString& rSrc, double& nVal, bool bSingle
ErrCode nRetError = ImpScan( rSrc, nVal, t, &nLen,
/*bAllowIntntl*/false, /*bOnlyIntntl*/true );
// read completely?
if( nRetError == ERRCODE_SBX_OK && nLen != rSrc.getLength() )
if( nRetError == ERRCODE_NONE && nLen != rSrc.getLength() )
{
nRetError = ERRCODE_SBX_CONVERSION;
}
......@@ -550,7 +550,7 @@ static sal_uInt16 printfmtstr( const OUString& rStr, OUString& rRes, const OUStr
bool SbxValue::Scan( const OUString& rSrc, sal_uInt16* pLen )
{
ErrCode eRes = ERRCODE_SBX_OK;
ErrCode eRes = ERRCODE_NONE;
if( !CanWrite() )
{
eRes = ERRCODE_SBX_PROP_READONLY;
......@@ -560,7 +560,7 @@ bool SbxValue::Scan( const OUString& rSrc, sal_uInt16* pLen )
double n;
SbxDataType t;
eRes = ImpScan( rSrc, n, t, pLen );
if( eRes == ERRCODE_SBX_OK )
if( eRes == ERRCODE_NONE )
{
if( !IsFixed() )
{
......
......@@ -106,7 +106,7 @@ start:
{
double d;
SbxDataType t;
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_NONE )
nRes = 0;
else if( d > SbxMAXSNG )
{
......
......@@ -151,7 +151,7 @@ start:
{
double d;
SbxDataType t;
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_NONE )
nRes = 0;
else if( d > SbxMAXUINT )
{
......
......@@ -118,7 +118,7 @@ start:
{
double d;
SbxDataType t;
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( *p->pOUString, d, t, nullptr ) != ERRCODE_NONE )
nRes = 0;
else if( d > SbxMAXULNG )
{
......
......@@ -269,7 +269,7 @@ bool SbxValue::Get( SbxValues& rRes ) const
{
bool bRes = false;
ErrCode eOld = GetError();
if( eOld != ERRCODE_SBX_OK )
if( eOld != ERRCODE_NONE )
ResetError();
if( !CanRead() )
{
......@@ -357,7 +357,7 @@ bool SbxValue::Get( SbxValues& rRes ) const
if( !IsError() )
{
bRes = true;
if( eOld != ERRCODE_SBX_OK )
if( eOld != ERRCODE_NONE )
SetError( eOld );
}
return bRes;
......@@ -423,7 +423,7 @@ bool SbxValue::Put( const SbxValues& rVal )
{
bool bRes = false;
ErrCode eOld = GetError();
if( eOld != ERRCODE_SBX_OK )
if( eOld != ERRCODE_NONE )
ResetError();
if( !CanWrite() )
SetError( ERRCODE_SBX_PROP_READONLY );
......@@ -520,7 +520,7 @@ bool SbxValue::Put( const SbxValues& rVal )
{
p->SetModified( true );
p->Broadcast( SfxHintId::BasicDataChanged );
if( eOld != ERRCODE_SBX_OK )
if( eOld != ERRCODE_NONE )
SetError( eOld );
bRes = true;
}
......@@ -699,7 +699,7 @@ bool SbxValue::ImpIsNumeric( bool bOnlyIntntl ) const
double n;
SbxDataType t2;
sal_uInt16 nLen = 0;
if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/false, bOnlyIntntl ) == ERRCODE_SBX_OK )
if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/false, bOnlyIntntl ) == ERRCODE_NONE )
return nLen == s.getLength();
}
return false;
......@@ -835,7 +835,7 @@ bool SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp )
SbxDataType eThisType = GetType();
SbxDataType eOpType = rOp.GetType();
ErrCode eOld = GetError();
if( eOld != ERRCODE_SBX_OK )
if( eOld != ERRCODE_NONE )
ResetError();
if( !CanWrite() )
SetError( ERRCODE_SBX_PROP_READONLY );
......@@ -1196,7 +1196,7 @@ Lbl_OpIsDouble:
Lbl_OpIsEmpty:
bool bRes = !IsError();
if( bRes && eOld != ERRCODE_SBX_OK )
if( bRes && eOld != ERRCODE_NONE )
SetError( eOld );
return bRes;
}
......@@ -1213,7 +1213,7 @@ bool SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
bool bRes = false;
ErrCode eOld = GetError();
if( eOld != ERRCODE_SBX_OK )
if( eOld != ERRCODE_NONE )
ResetError();
if( !CanRead() || !rOp.CanRead() )
SetError( ERRCODE_SBX_PROP_WRITEONLY );
......@@ -1357,7 +1357,7 @@ bool SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const
}
}
}
if( eOld != ERRCODE_SBX_OK )
if( eOld != ERRCODE_NONE )
SetError( eOld );
return bRes;
}
......@@ -1386,7 +1386,7 @@ bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
RTL_TEXTENCODING_ASCII_US);
double d;
SbxDataType t;
if( ImpScan( aVal, d, t, nullptr ) != ERRCODE_SBX_OK || t == SbxDOUBLE )
if( ImpScan( aVal, d, t, nullptr ) != ERRCODE_NONE || t == SbxDOUBLE )
{
aData.nSingle = 0.0F;
return false;
......@@ -1401,7 +1401,7 @@ bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
OUString aVal = read_uInt16_lenPrefixed_uInt8s_ToOUString(r,
RTL_TEXTENCODING_ASCII_US);
SbxDataType t;
if( ImpScan( aVal, aData.nDouble, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( aVal, aData.nDouble, t, nullptr ) != ERRCODE_NONE )
{
aData.nDouble = 0.0;
return false;
......
......@@ -512,7 +512,7 @@ bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer )
rStrm, RTL_TEXTENCODING_ASCII_US);
double d;
SbxDataType t;
if( ImpScan( aTmpString, d, t, nullptr ) != ERRCODE_SBX_OK || t == SbxDOUBLE )
if( ImpScan( aTmpString, d, t, nullptr ) != ERRCODE_NONE || t == SbxDOUBLE )
{
aTmp.nSingle = 0;
return false;
......@@ -527,7 +527,7 @@ bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer )
aTmpString = read_uInt16_lenPrefixed_uInt8s_ToOUString(rStrm,
RTL_TEXTENCODING_ASCII_US);
SbxDataType t;
if( ImpScan( aTmpString, aTmp.nDouble, t, nullptr ) != ERRCODE_SBX_OK )
if( ImpScan( aTmpString, aTmp.nDouble, t, nullptr ) != ERRCODE_NONE )
{
aTmp.nDouble = 0;
return false;
......
......@@ -128,8 +128,6 @@ enum class SbxNameType { // Type of the questioned name of a variable
// New error codes per define
#define ERRCODE_SBX_OK ERRCODE_NONE // processed
#define ERRCODE_SBX_SYNTAX ErrCode(1UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_COMPILER)
#define ERRCODE_SBX_NOTIMP ErrCode(2UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_NOTSUPPORTED)
#define ERRCODE_SBX_OVERFLOW ErrCode(3UL | ERRCODE_AREA_SBX | ERRCODE_CLASS_SBX) // overflow
......
......@@ -217,7 +217,7 @@ namespace basprov
// call method
SbxVariableRef xReturn = new SbxVariable;
ErrCode nErr = ERRCODE_SBX_OK;
ErrCode nErr = ERRCODE_NONE;
// if it's a document-based script, temporarily reset ThisComponent to the script invocation context
Any aOldThisComponent;
......@@ -236,7 +236,7 @@ namespace basprov
if ( m_documentBasicManager && m_xDocumentScriptContext.is() )
m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", aOldThisComponent );
if ( nErr != ERRCODE_SBX_OK )
if ( nErr != ERRCODE_NONE )
{
// TODO: throw InvocationTargetException ?
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment