[Libreoffice-commits] core.git: basic/source include/basic

Noel Grandin noel.grandin at collabora.co.uk
Thu Jun 15 06:25:50 UTC 2017


 basic/source/classes/sb.cxx          |   38 +++++++++++-----------
 basic/source/classes/sbunoobj.cxx    |    4 +-
 basic/source/comp/parser.cxx         |    2 -
 basic/source/comp/scanner.cxx        |    2 -
 basic/source/comp/token.cxx          |    4 +-
 basic/source/inc/iosys.hxx           |   16 ++++-----
 basic/source/inc/runtime.hxx         |   28 ++++++++--------
 basic/source/inc/sbintern.hxx        |    2 -
 basic/source/inc/scanner.hxx         |    2 -
 basic/source/inc/token.hxx           |    6 +--
 basic/source/runtime/ddectrl.cxx     |   18 +++++-----
 basic/source/runtime/ddectrl.hxx     |   14 ++++----
 basic/source/runtime/dllmgr-none.cxx |    6 +--
 basic/source/runtime/dllmgr-x64.cxx  |   58 +++++++++++++++++------------------
 basic/source/runtime/dllmgr-x86.cxx  |   58 +++++++++++++++++------------------
 basic/source/runtime/dllmgr.hxx      |    2 -
 basic/source/runtime/iosys.cxx       |   18 +++++-----
 basic/source/runtime/methods.cxx     |   14 ++++----
 basic/source/runtime/methods1.cxx    |    8 ++--
 basic/source/runtime/runtime.cxx     |   44 +++++++++++++-------------
 include/basic/sberrors.hxx           |    4 --
 include/basic/sbstar.hxx             |   24 +++++++-------
 22 files changed, 184 insertions(+), 188 deletions(-)

New commits:
commit 3059ede409bd8136be0397f532b644855bb9d07a
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Jun 14 14:16:48 2017 +0200

    drop SbError typedef
    
    in favour of ErrCode.
    Part of a larger patch to convert ErrCode to strong_int
    
    Change-Id: Ia846bfc93c58c85c6a6cec79e9d19b9ecbd1c05f
    Reviewed-on: https://gerrit.libreoffice.org/38783
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index ecbf1525beea..2474beb9bd48 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -275,7 +275,7 @@ SbxVariable* StarBASIC::VBAFind( const OUString& rName, SbxClassType t )
 struct SFX_VB_ErrorItem
 {
     sal_uInt16  nErrorVB;
-    SbError nErrorSFX;
+    ErrCode nErrorSFX;
 };
 
 const SFX_VB_ErrorItem SFX_VB_ErrorTab[] =
@@ -1362,7 +1362,7 @@ bool StarBASIC::Call( const OUString& rName, SbxArray* pParam )
         SbxBase::ResetError();
         if( eErr != ERRCODE_SBX_OK )
         {
-            RTError( (SbError)eErr, OUString(), 0, 0, 0 );
+            RTError( (ErrCode)eErr, OUString(), 0, 0, 0 );
         }
     }
     return bRes;
@@ -1469,7 +1469,7 @@ sal_uInt16 StarBASIC::GetCol1()     { return GetSbData()->nCol1; }
 sal_uInt16 StarBASIC::GetCol2()     { return GetSbData()->nCol2; }
 
 // Specific to error handler
-SbError StarBASIC::GetErrorCode()       { return GetSbData()->nCode; }
+ErrCode StarBASIC::GetErrorCode()       { return GetSbData()->nCode; }
 const OUString& StarBASIC::GetErrorText() { return GetSbData()->aErrMsg; }
 
 // From 1996-03-29:
@@ -1480,7 +1480,7 @@ const OUString& StarBASIC::GetErrorText() { return GetSbData()->aErrMsg; }
 // binary search by VB Error -> Error SFX.
 
 // Map back new error codes to old, Sbx-compatible
-sal_uInt16 StarBASIC::GetVBErrorCode( SbError nError )
+sal_uInt16 StarBASIC::GetVBErrorCode( ErrCode nError )
 {
     sal_uInt16 nRet = 0;
 
@@ -1522,9 +1522,9 @@ sal_uInt16 StarBASIC::GetVBErrorCode( SbError nError )
     return nRet;
 }
 
-SbError StarBASIC::GetSfxFromVBError( sal_uInt16 nError )
+ErrCode StarBASIC::GetSfxFromVBError( sal_uInt16 nError )
 {
-    SbError nRet = 0;
+    ErrCode nRet = 0;
 
     if( SbiRuntime::isVBAEnabled() )
     {
@@ -1574,7 +1574,7 @@ SbError StarBASIC::GetSfxFromVBError( sal_uInt16 nError )
 }
 
 // set Error- / Break-data
-void StarBASIC::SetErrorData( SbError nCode, sal_uInt16 nLine,
+void StarBASIC::SetErrorData( ErrCode nCode, sal_uInt16 nLine,
                               sal_uInt16 nCol1, sal_uInt16 nCol2 )
 {
     SbiGlobals& aGlobals = *GetSbData();
@@ -1584,7 +1584,7 @@ void StarBASIC::SetErrorData( SbError nCode, sal_uInt16 nLine,
     aGlobals.nCol2 = nCol2;
 }
 
-void StarBASIC::MakeErrorText( SbError nId, const OUString& aMsg )
+void StarBASIC::MakeErrorText( ErrCode nId, const OUString& aMsg )
 {
     SolarMutexGuard aSolarGuard;
     sal_uInt16 nOldID = GetVBErrorCode( nId );
@@ -1620,7 +1620,7 @@ void StarBASIC::MakeErrorText( SbError nId, const OUString& aMsg )
     }
 }
 
-bool StarBASIC::CError( SbError code, const OUString& rMsg,
+bool StarBASIC::CError( ErrCode code, const OUString& rMsg,
                             sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
 {
     SolarMutexGuard aSolarGuard;
@@ -1646,7 +1646,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 = (ErrCode)*new StringErrorInfo( code, rMsg );
     }
     SetErrorData( code, l, c1, c2 );
     GetSbData()->bCompilerError = true;
@@ -1663,11 +1663,11 @@ bool StarBASIC::CError( SbError code, const OUString& rMsg,
     return bRet;
 }
 
-bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
+bool StarBASIC::RTError( ErrCode code, const OUString& rMsg, sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
 {
     SolarMutexGuard aSolarGuard;
 
-    SbError c = code;
+    ErrCode c = code;
     if( (c & ERRCODE_CLASS_MASK) == ERRCODE_CLASS_COMPILER )
     {
         c = 0;
@@ -1685,11 +1685,11 @@ bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_In
         {
             OUString aTmp = "\'" + OUString::number(SbxErrObject::getUnoErrObject()->getNumber()) +
                             "\'\n" + (!GetSbData()->aErrMsg.isEmpty() ? GetSbData()->aErrMsg : rMsg);
-            code = (SbError)*new StringErrorInfo( code, aTmp );
+            code = (ErrCode)*new StringErrorInfo( code, aTmp );
         }
         else
         {
-            code = (SbError)*new StringErrorInfo( code, rMsg );
+            code = (ErrCode)*new StringErrorInfo( code, rMsg );
         }
     }
 
@@ -1704,12 +1704,12 @@ bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_In
     }
 }
 
-void StarBASIC::Error( SbError n )
+void StarBASIC::Error( ErrCode n )
 {
     Error( n, OUString() );
 }
 
-void StarBASIC::Error( SbError n, const OUString& rMsg )
+void StarBASIC::Error( ErrCode n, const OUString& rMsg )
 {
     if( GetSbData()->pInst )
     {
@@ -1717,7 +1717,7 @@ void StarBASIC::Error( SbError n, const OUString& rMsg )
     }
 }
 
-void StarBASIC::FatalError( SbError n )
+void StarBASIC::FatalError( ErrCode n )
 {
     if( GetSbData()->pInst )
     {
@@ -1725,7 +1725,7 @@ void StarBASIC::FatalError( SbError n )
     }
 }
 
-void StarBASIC::FatalError( SbError _errCode, const OUString& _details )
+void StarBASIC::FatalError( ErrCode _errCode, const OUString& _details )
 {
     if( GetSbData()->pInst )
     {
@@ -1733,7 +1733,7 @@ void StarBASIC::FatalError( SbError _errCode, const OUString& _details )
     }
 }
 
-SbError StarBASIC::GetErrBasic()
+ErrCode StarBASIC::GetErrBasic()
 {
     if( GetSbData()->pInst )
     {
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 0bd472e61394..f102e4efa694 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -364,7 +364,7 @@ OUString implGetExceptionMsg( const EXCEPTION& e )
 
 void implHandleBasicErrorException( BasicErrorException& e )
 {
-    SbError nError = StarBASIC::GetSfxFromVBError( (sal_uInt16)e.ErrorCode );
+    ErrCode nError = StarBASIC::GetSfxFromVBError( (sal_uInt16)e.ErrorCode );
     StarBASIC::Error( nError, e.ErrorMessageArgument );
 }
 
@@ -380,7 +380,7 @@ void implHandleWrappedTargetException( const Any& _rWrappedTargetException )
 
     BasicErrorException aBasicError;
 
-    SbError nError( ERRCODE_BASIC_EXCEPTION );
+    ErrCode nError( ERRCODE_BASIC_EXCEPTION );
     OUStringBuffer aMessageBuf;
 
     // strip any other WrappedTargetException instances, but this time preserve the error messages.
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index ae4baf704488..21131edbf6f8 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -438,7 +438,7 @@ bool SbiParser::Parse()
                 if( nSbxErr )
                 {
                     SbxBase::ResetError();
-                    Error( (SbError)nSbxErr );
+                    Error( (ErrCode)nSbxErr );
                 }
             }
         }
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index c851384a342b..e906cfb19c52 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -68,7 +68,7 @@ void SbiScanner::UnlockColumn()
         nColLock--;
 }
 
-void SbiScanner::GenError( SbError code )
+void SbiScanner::GenError( ErrCode code )
 {
     if( GetSbData()->bBlockCompilerError )
     {
diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx
index 65ae069fd3eb..44dcebcd95ee 100644
--- a/basic/source/comp/token.cxx
+++ b/basic/source/comp/token.cxx
@@ -230,13 +230,13 @@ void SbiTokenizer::Push( SbiToken t )
     else ePush = t;
 }
 
-void SbiTokenizer::Error( SbError code, const OUString &aMsg )
+void SbiTokenizer::Error( ErrCode code, const OUString &aMsg )
 {
     aError = aMsg;
     Error( code );
 }
 
-void SbiTokenizer::Error( SbError code, SbiToken tok )
+void SbiTokenizer::Error( ErrCode code, SbiToken tok )
 {
     aError = Symbol( tok );
     Error( code );
diff --git a/basic/source/inc/iosys.hxx b/basic/source/inc/iosys.hxx
index 81d9e4e32042..d13da0ee0014 100644
--- a/basic/source/inc/iosys.hxx
+++ b/basic/source/inc/iosys.hxx
@@ -55,17 +55,17 @@ class SbiStream
     short  nLen;                    // buffer length
     SbiStreamFlags  nMode;
     short  nChan;
-    SbError nError;
+    ErrCode nError;
     void   MapError();
 
 public:
     SbiStream();
    ~SbiStream();
-    SbError Open( short, const OString&, StreamMode, SbiStreamFlags, short );
-    SbError Close();
-    SbError Read(OString&, sal_uInt16 = 0, bool bForceReadingPerByte=false);
-    SbError Read( char& );
-    SbError Write( const OString& );
+    ErrCode Open( short, const OString&, StreamMode, SbiStreamFlags, short );
+    ErrCode Close();
+    ErrCode Read(OString&, sal_uInt16 = 0, bool bForceReadingPerByte=false);
+    ErrCode Read( char& );
+    ErrCode Write( const OString& );
 
     bool IsText() const     { return !bool(nMode & SbiStreamFlags::Binary); }
     bool IsRandom() const   { return bool(nMode & SbiStreamFlags::Random); }
@@ -87,13 +87,13 @@ class SbiIoSystem
     OString aIn;
     OUString aOut;
     short     nChan;
-    SbError   nError;
+    ErrCode   nError;
     void      ReadCon(OString&);
     void      WriteCon(const OUString&);
 public:
     SbiIoSystem();
    ~SbiIoSystem();
-    SbError GetError();
+    ErrCode GetError();
     void  Shutdown();
     void  SetPrompt(const OString& r) { aPrompt = r; }
     void  SetChannel( short n  )       { nChan = n;   }
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index f80d07322690..4c7dfa965c9d 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -145,7 +145,7 @@ class SbiInstance
     DateOrder       meFormatterDateOrder;
     sal_uInt32      nStdDateIdx, nStdTimeIdx, nStdDateTimeIdx;
 
-    SbError         nErr;
+    ErrCode         nErr;
     OUString        aErrorMsg;      // last error message for $ARG
     sal_Int32       nErl;           // current error line
     bool        bReschedule;    // Flag: sal_True = Reschedule in main loop
@@ -164,16 +164,16 @@ public:
     SbiInstance( StarBASIC* );
    ~SbiInstance();
 
-    void Error( SbError );                      // trappable Error
-    void Error( SbError, const OUString& rMsg );  // trappable Error with message
+    void Error( ErrCode );                      // trappable Error
+    void Error( ErrCode, const OUString& rMsg );  // trappable Error with message
     void ErrorVB( sal_Int32 nVBNumber, const OUString& rMsg );
     void setErrorVB( sal_Int32 nVBNumber );
-    void FatalError( SbError );                 // non-trappable Error
-    void FatalError( SbError, const OUString& );  // non-trappable Error
+    void FatalError( ErrCode );                 // non-trappable Error
+    void FatalError( ErrCode, const OUString& );  // non-trappable Error
     void Abort();                               // with current error code
 
     void    Stop();
-    SbError GetErr()                { return nErr; }
+    ErrCode GetErr()                { return nErr; }
     const OUString& GetErrorMsg()           { return aErrorMsg; }
     sal_Int32 GetErl()             { return nErl; }
     void    EnableReschedule( bool bEnable ) { bReschedule = bEnable; }
@@ -250,7 +250,7 @@ class SbiRuntime
     bool               bBlocked;         // true: blocked by next call level, #i48868
     bool               bVBAEnabled;
     BasicDebugFlags    nFlags;           // Debugging-Flags
-    SbError            nError;
+    ErrCode            nError;
     sal_uInt16         nOps;             // opcode counter
     sal_uInt32         m_nLastTime;
 
@@ -260,7 +260,7 @@ class SbiRuntime
 
 
     SbxVariable* FindElement
-    ( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, SbError, bool bLocal, bool bStatic = false );
+    ( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, ErrCode, bool bLocal, bool bStatic = false );
     void SetupArgs( SbxVariable*, sal_uInt32 );
     SbxVariable* CheckArray( SbxVariable* );
 
@@ -331,7 +331,7 @@ class SbiRuntime
     // all opcodes with two operands
     void StepRTL( sal_uInt32, sal_uInt32 ),     StepPUBLIC( sal_uInt32, sal_uInt32 ),   StepPUBLIC_P( sal_uInt32, sal_uInt32 );
     void StepPUBLIC_Impl( sal_uInt32, sal_uInt32, bool bUsedForClassModule );
-    void StepFIND_Impl( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, SbError, bool bStatic = false );
+    void StepFIND_Impl( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, ErrCode, bool bStatic = false );
     void StepFIND( sal_uInt32, sal_uInt32 ),    StepELEM( sal_uInt32, sal_uInt32 );
     void StepGLOBAL( sal_uInt32, sal_uInt32 ),  StepLOCAL( sal_uInt32, sal_uInt32 );
     void StepPARAM( sal_uInt32, sal_uInt32),    StepCREATE( sal_uInt32, sal_uInt32 );
@@ -355,11 +355,11 @@ public:
 
     SbiRuntime( SbModule*, SbMethod*, sal_uInt32 );
    ~SbiRuntime();
-    void Error( SbError, bool bVBATranslationAlreadyDone = false );     // set error if != 0
-    void Error( SbError, const OUString& );       // set error if != 0
-    void FatalError( SbError );                 // error handling = standard, set error
-    void FatalError( SbError, const OUString& );  // error handling = standard, set error
-    static sal_Int32 translateErrorToVba( SbError nError, OUString& rMsg );
+    void Error( ErrCode, bool bVBATranslationAlreadyDone = false );     // set error if != 0
+    void Error( ErrCode, const OUString& );       // set error if != 0
+    void FatalError( ErrCode );                 // error handling = standard, set error
+    void FatalError( ErrCode, const OUString& );  // error handling = standard, set error
+    static sal_Int32 translateErrorToVba( ErrCode nError, OUString& rMsg );
     bool Step();                    // single step (one opcode)
     void Stop()            { bRun = false;   }
     void block()     { bBlocked = true; }
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index 900679f7b699..7b5dd97384e7 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -91,7 +91,7 @@ struct SbiGlobals
     short           nInst;          // number of BASICs
     Link<StarBASIC*,bool>            aErrHdl;        // global error handler
     Link<StarBASIC*,BasicDebugFlags> aBreakHdl;      // global break handler
-    SbError         nCode;
+    ErrCode         nCode;
     sal_Int32       nLine;
     sal_Int32       nCol1,nCol2;    // from... to...
     bool            bCompilerError; // flag for compiler error
diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx
index a7f1377d7bc1..15e37b25cd2e 100644
--- a/basic/source/inc/scanner.hxx
+++ b/basic/source/inc/scanner.hxx
@@ -63,7 +63,7 @@ protected:
     bool   bPrevLineExtentsComment;     // true: Previous line is comment and ends on "... _"
 
     bool   bInStatement;
-    void   GenError( SbError );
+    void   GenError( ErrCode );
 public:
     SbiScanner( const OUString&, StarBASIC* = nullptr );
    ~SbiScanner();
diff --git a/basic/source/inc/token.hxx b/basic/source/inc/token.hxx
index ef30d955eed1..3f265cefb83e 100644
--- a/basic/source/inc/token.hxx
+++ b/basic/source/inc/token.hxx
@@ -124,9 +124,9 @@ public:
     SbiToken Next();                    // read a token
     bool MayBeLabel( bool= false );
 
-    void Error( SbError c ) { GenError( c ); }
-    void Error( SbError, SbiToken );
-    void Error( SbError, const OUString &);
+    void Error( ErrCode c ) { GenError( c ); }
+    void Error( ErrCode, SbiToken );
+    void Error( ErrCode, const OUString &);
 
     static bool IsEoln( SbiToken t )
         { return t == EOS || t == EOLN || t == REM; }
diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx
index 24484b274109..3c77fcbe26c0 100644
--- a/basic/source/runtime/ddectrl.cxx
+++ b/basic/source/runtime/ddectrl.cxx
@@ -27,7 +27,7 @@
 #define DDE_FIRSTERR    0x4000
 #define DDE_LASTERR     0x4011
 
-static const SbError nDdeErrMap[] =
+static const ErrCode nDdeErrMap[] =
 {
     /* DMLERR_ADVACKTIMEOUT       */  0x4000, ERRCODE_BASIC_DDE_TIMEOUT,
     /* DMLERR_BUSY                */  0x4001, ERRCODE_BASIC_DDE_BUSY,
@@ -49,7 +49,7 @@ static const SbError nDdeErrMap[] =
     /* DMLERR_UNFOUND_QUEUE_ID    */  0x4011, ERRCODE_BASIC_DDE_NO_CHANNEL
 };
 
-SbError SbiDdeControl::GetLastErr( DdeConnection* pConv )
+ErrCode SbiDdeControl::GetLastErr( DdeConnection* pConv )
 {
     if( !pConv )
     {
@@ -98,10 +98,10 @@ size_t SbiDdeControl::GetFreeChannel()
     return nChannel+1;
 }
 
-SbError SbiDdeControl::Initiate( const OUString& rService, const OUString& rTopic,
+ErrCode SbiDdeControl::Initiate( const OUString& rService, const OUString& rTopic,
                                  size_t& rnHandle )
 {
-    SbError nErr;
+    ErrCode nErr;
     DdeConnection* pConv = new DdeConnection( rService, rTopic );
     nErr = GetLastErr( pConv );
     if( nErr )
@@ -118,7 +118,7 @@ SbError SbiDdeControl::Initiate( const OUString& rService, const OUString& rTopi
     return ERRCODE_NONE;
 }
 
-SbError SbiDdeControl::Terminate( size_t nChannel )
+ErrCode SbiDdeControl::Terminate( size_t nChannel )
 {
     if (!nChannel || nChannel > aConvList.size())
     {
@@ -136,7 +136,7 @@ SbError SbiDdeControl::Terminate( size_t nChannel )
     return ERRCODE_NONE;
 }
 
-SbError SbiDdeControl::TerminateAll()
+ErrCode SbiDdeControl::TerminateAll()
 {
     for (DdeConnection* conv : aConvList)
     {
@@ -151,7 +151,7 @@ SbError SbiDdeControl::TerminateAll()
     return ERRCODE_NONE;
 }
 
-SbError SbiDdeControl::Request( size_t nChannel, const OUString& rItem, OUString& rResult )
+ErrCode SbiDdeControl::Request( size_t nChannel, const OUString& rItem, OUString& rResult )
 {
     if (!nChannel || nChannel > aConvList.size())
     {
@@ -172,7 +172,7 @@ SbError SbiDdeControl::Request( size_t nChannel, const OUString& rItem, OUString
     return GetLastErr( pConv );
 }
 
-SbError SbiDdeControl::Execute( size_t nChannel, const OUString& rCommand )
+ErrCode SbiDdeControl::Execute( size_t nChannel, const OUString& rCommand )
 {
     if (!nChannel || nChannel > aConvList.size())
     {
@@ -190,7 +190,7 @@ SbError SbiDdeControl::Execute( size_t nChannel, const OUString& rCommand )
     return GetLastErr( pConv );
 }
 
-SbError SbiDdeControl::Poke( size_t nChannel, const OUString& rItem, const OUString& rData )
+ErrCode SbiDdeControl::Poke( size_t nChannel, const OUString& rItem, const OUString& rData )
 {
     if (!nChannel || nChannel > aConvList.size())
     {
diff --git a/basic/source/runtime/ddectrl.hxx b/basic/source/runtime/ddectrl.hxx
index a961b19b405f..356fe42d684c 100644
--- a/basic/source/runtime/ddectrl.hxx
+++ b/basic/source/runtime/ddectrl.hxx
@@ -30,7 +30,7 @@ class SbiDdeControl
 {
 private:
     DECL_LINK( Data, const DdeData*, void );
-    static SbError GetLastErr( DdeConnection* );
+    static ErrCode GetLastErr( DdeConnection* );
     size_t GetFreeChannel();
     std::vector<DdeConnection*> aConvList;
     OUString aData;
@@ -40,13 +40,13 @@ public:
     SbiDdeControl();
     ~SbiDdeControl();
 
-    SbError Initiate( const OUString& rService, const OUString& rTopic,
+    ErrCode Initiate( const OUString& rService, const OUString& rTopic,
                      size_t& rnHandle );
-    SbError Terminate( size_t nChannel );
-    SbError TerminateAll();
-    SbError Request( size_t nChannel, const OUString& rItem, OUString& rResult );
-    SbError Execute( size_t nChannel, const OUString& rCommand );
-    SbError Poke( size_t nChannel, const OUString& rItem, const OUString& rData );
+    ErrCode Terminate( size_t nChannel );
+    ErrCode TerminateAll();
+    ErrCode Request( size_t nChannel, const OUString& rItem, OUString& rResult );
+    ErrCode Execute( size_t nChannel, const OUString& rCommand );
+    ErrCode Poke( size_t nChannel, const OUString& rItem, const OUString& rData );
 };
 
 #endif
diff --git a/basic/source/runtime/dllmgr-none.cxx b/basic/source/runtime/dllmgr-none.cxx
index c423a95c15e6..c299a4dcdfd0 100644
--- a/basic/source/runtime/dllmgr-none.cxx
+++ b/basic/source/runtime/dllmgr-none.cxx
@@ -39,7 +39,7 @@ struct SbiDllMgr::Impl {};
 namespace {
 
 // Overcome the mess of Currency vs. custom types etc.
-SbError returnInt64InOutArg(SbxArray *pArgs, SbxVariable &rRetVal,
+ErrCode returnInt64InOutArg(SbxArray *pArgs, SbxVariable &rRetVal,
                             sal_Int64 nValue)
 {
     if (!rRetVal.PutLong(1) && !rRetVal.PutInteger(1))
@@ -77,7 +77,7 @@ SbError returnInt64InOutArg(SbxArray *pArgs, SbxVariable &rRetVal,
     return ERRCODE_BASIC_BAD_ARGUMENT;
 }
 
-SbError builtin_kernel32(const OUString &aFuncName, SbxArray *pArgs,
+ErrCode builtin_kernel32(const OUString &aFuncName, SbxArray *pArgs,
                          SbxVariable &rRetVal)
 {
     sal_Int64 nNanoSecsPerSec = 1000.0*1000*1000;
@@ -96,7 +96,7 @@ SbError builtin_kernel32(const OUString &aFuncName, SbxArray *pArgs,
 
 };
 
-SbError SbiDllMgr::Call(
+ErrCode SbiDllMgr::Call(
     const OUString &aFuncName, const OUString &aDllName,
     SbxArray *pArgs, SbxVariable &rRetVal,
     SAL_UNUSED_PARAMETER bool /* bCDecl */)
diff --git a/basic/source/runtime/dllmgr-x64.cxx b/basic/source/runtime/dllmgr-x64.cxx
index 4c8a0409a635..d9242264ae0f 100644
--- a/basic/source/runtime/dllmgr-x64.cxx
+++ b/basic/source/runtime/dllmgr-x64.cxx
@@ -65,7 +65,7 @@ char * address(std::vector< char > & blob) {
     return blob.empty() ? nullptr : &blob[0];
 }
 
-SbError convert(OUString const & source, OString * target) {
+ErrCode convert(OUString const & source, OString * target) {
     return
         source.convertToString(
             target, osl_getThreadTextEncoding(),
@@ -75,7 +75,7 @@ SbError convert(OUString const & source, OString * target) {
         //TODO: more specific errcode?
 }
 
-SbError convert(char const * source, sal_Int32 length, OUString * target) {
+ErrCode convert(char const * source, sal_Int32 length, OUString * target) {
     return
         rtl_convertStringToUString(
             &target->pData, source, length, osl_getThreadTextEncoding(),
@@ -183,16 +183,16 @@ std::size_t alignment(SbxVariable * variable) {
     }
 }
 
-SbError marshal(
+ErrCode marshal(
     bool outer, SbxVariable * variable, bool special,
     std::vector< char > & blob, std::size_t offset, MarshalData & data);
 
-SbError marshalString(
+ErrCode marshalString(
     SbxVariable * variable, bool special, MarshalData & data, void ** buffer)
 {
     OSL_ASSERT(variable != nullptr && buffer != nullptr);
     OString str;
-    SbError e = convert(variable->GetOUString(), &str);
+    ErrCode e = convert(variable->GetOUString(), &str);
     if (e != ERRCODE_NONE) {
         return e;
     }
@@ -203,7 +203,7 @@ SbError marshalString(
     return ERRCODE_NONE;
 }
 
-SbError marshalStruct(
+ErrCode marshalStruct(
     SbxVariable * variable, std::vector< char > & blob, std::size_t offset,
     MarshalData & data)
 {
@@ -211,7 +211,7 @@ SbError marshalStruct(
     SbxArray * props = dynamic_cast<SbxObject*>( variable->GetObject() )->
         GetProperties();
     for (sal_uInt16 i = 0; i < props->Count(); ++i) {
-        SbError e = marshal(false, props->Get(i), false, blob, offset, data);
+        ErrCode e = marshal(false, props->Get(i), false, blob, offset, data);
         if (e != ERRCODE_NONE) {
             return e;
         }
@@ -219,7 +219,7 @@ SbError marshalStruct(
     return ERRCODE_NONE;
 }
 
-SbError marshalArray(
+ErrCode marshalArray(
     SbxVariable * variable, std::vector< char > & blob, std::size_t offset,
     MarshalData & data)
 {
@@ -232,7 +232,7 @@ SbError marshalArray(
         arr->GetDim32(i + 1, low[i], up[i]);
     }
     for (std::vector< sal_Int32 > idx = low;;) {
-        SbError e = marshal(
+        ErrCode e = marshal(
             false, arr->Get32(&idx[0]), false, blob, offset, data);
         if (e != ERRCODE_NONE) {
             return e;
@@ -251,7 +251,7 @@ SbError marshalArray(
 
 // 8-aligned structs are only 4-aligned on stack, so alignment of members in
 // such structs must take that into account via "offset"
-SbError marshal(
+ErrCode marshal(
     bool outer, SbxVariable * variable, bool special,
     std::vector< char > & blob, std::size_t offset, MarshalData & data)
 {
@@ -274,7 +274,7 @@ SbError marshal(
             case SbxSTRING:
                 {
                     void * p;
-                    SbError e = marshalString(variable, special, data, &p);
+                    ErrCode e = marshalString(variable, special, data, &p);
                     if (e != ERRCODE_NONE) {
                         return e;
                     }
@@ -284,7 +284,7 @@ SbError marshal(
             case SbxOBJECT:
                 {
                     align(blob, outer ? 8 : alignment(variable), offset, 0);
-                    SbError e = marshalStruct(variable, blob, offset, data);
+                    ErrCode e = marshalStruct(variable, blob, offset, data);
                     if (e != ERRCODE_NONE) {
                         return e;
                     }
@@ -301,7 +301,7 @@ SbError marshal(
                 break;
             }
         } else {
-            SbError e = marshalArray(variable, blob, offset, data);
+            ErrCode e = marshalArray(variable, blob, offset, data);
             if (e != ERRCODE_NONE) {
                 return e;
             }
@@ -321,7 +321,7 @@ SbError marshal(
                 {
                     std::vector< char > * blob2 = data.newBlob();
                     void * p;
-                    SbError e = marshalString(variable, special, data, &p);
+                    ErrCode e = marshalString(variable, special, data, &p);
                     if (e != ERRCODE_NONE) {
                         return e;
                     }
@@ -332,7 +332,7 @@ SbError marshal(
             case SbxOBJECT:
                 {
                     std::vector< char > * blob2 = data.newBlob();
-                    SbError e = marshalStruct(variable, *blob2, 0, data);
+                    ErrCode e = marshalStruct(variable, *blob2, 0, data);
                     if (e != ERRCODE_NONE) {
                         return e;
                     }
@@ -349,7 +349,7 @@ SbError marshal(
             }
         } else {
             std::vector< char > * blob2 = data.newBlob();
-            SbError e = marshalArray(variable, *blob2, 0, data);
+            ErrCode e = marshalArray(variable, *blob2, 0, data);
             if (e != ERRCODE_NONE) {
                 return e;
             }
@@ -436,7 +436,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
     return data;
 }
 
-SbError unmarshalString(StringData const & data, SbxVariable & result) {
+ErrCode unmarshalString(StringData const & data, SbxVariable & result) {
     OUString str;
     if (data.buffer != nullptr) {
         char const * p = static_cast< char const * >(data.buffer);
@@ -450,7 +450,7 @@ SbError unmarshalString(StringData const & data, SbxVariable & result) {
         } else {
             len = rtl_str_getLength(p);
         }
-        SbError e = convert(p, len, &str);
+        ErrCode e = convert(p, len, &str);
         if (e != ERRCODE_NONE) {
             return e;
         }
@@ -464,7 +464,7 @@ struct ProcData {
     FARPROC proc;
 };
 
-SbError call(
+ErrCode call(
     OUString const & dll, ProcData const & proc, SbxArray * arguments,
     SbxVariable & result)
 {
@@ -482,7 +482,7 @@ SbError call(
         dll.equalsIgnoreAsciiCase("KERNEL32.DLL") &&
         (proc.name == OString("GetLogicalDriveStringsA"));
     for (int i = 1; i < (arguments == nullptr ? 0 : arguments->Count()); ++i) {
-        SbError e = marshal(
+        ErrCode e = marshal(
             true, arguments->Get(i), special && i == 2, stack, stack.size(),
             data);
         if (e != ERRCODE_NONE) {
@@ -579,7 +579,7 @@ SbError call(
         {
             char const * s1 = reinterpret_cast< char const * >(iRetVal);
             OUString s2;
-            SbError e = convert(s1, rtl_str_getLength(s1), &s2);
+            ErrCode e = convert(s1, rtl_str_getLength(s1), &s2);
             if (e != ERRCODE_NONE) {
                 return e;
             }
@@ -611,7 +611,7 @@ SbError call(
     for (std::vector< StringData >::iterator i(data.unmarshalStrings.begin());
          i != data.unmarshalStrings.end(); ++i)
     {
-        SbError e = unmarshalString(*i, result);
+        ErrCode e = unmarshalString(*i, result);
         if (e != ERRCODE_NONE) {
             return e;
         }
@@ -619,7 +619,7 @@ SbError call(
     return ERRCODE_NONE;
 }
 
-SbError getProcData(HMODULE handle, OUString const & name, ProcData * proc)
+ErrCode getProcData(HMODULE handle, OUString const & name, ProcData * proc)
 {
     OSL_ASSERT(proc != nullptr);
     if (name.getLength() != 0 && name[0] == '@') { //TODO: "@" vs. "#"???
@@ -635,7 +635,7 @@ SbError getProcData(HMODULE handle, OUString const & name, ProcData * proc)
         }
     } else {
         OString name8;
-        SbError e = convert(name, &name8);
+        ErrCode e = convert(name, &name8);
         if (e != ERRCODE_NONE) {
             return e;
         }
@@ -682,7 +682,7 @@ private:
 public:
     Dll(): handle(nullptr) {}
 
-    SbError getProc(OUString const & name, ProcData * proc);
+    ErrCode getProc(OUString const & name, ProcData * proc);
 
     HMODULE handle;
     Procs procs;
@@ -694,13 +694,13 @@ Dll::~Dll() {
     }
 }
 
-SbError Dll::getProc(OUString const & name, ProcData * proc) {
+ErrCode Dll::getProc(OUString const & name, ProcData * proc) {
     Procs::iterator i(procs.find(name));
     if (i != procs.end()) {
         *proc = i->second;
         return ERRCODE_NONE;
     }
-    SbError e = getProcData(handle, name, proc);
+    ErrCode e = getProcData(handle, name, proc);
     if (e == ERRCODE_NONE) {
         procs.insert(Procs::value_type(name, *proc));
     }
@@ -745,7 +745,7 @@ Dll * SbiDllMgr::Impl::getDll(OUString const & name) {
     return i->second.get();
 }
 
-SbError SbiDllMgr::Call(
+ErrCode SbiDllMgr::Call(
     OUString const & function, OUString const & library,
     SbxArray * arguments, SbxVariable & result, bool cdeclConvention)
 {
@@ -758,7 +758,7 @@ SbError SbiDllMgr::Call(
         return ERRCODE_BASIC_BAD_DLL_LOAD;
     }
     ProcData proc;
-    SbError e = dll->getProc(function, &proc);
+    ErrCode e = dll->getProc(function, &proc);
     if (e != ERRCODE_NONE) {
         return e;
     }
diff --git a/basic/source/runtime/dllmgr-x86.cxx b/basic/source/runtime/dllmgr-x86.cxx
index 7cc4c91a8552..3d5e9fbcf63d 100644
--- a/basic/source/runtime/dllmgr-x86.cxx
+++ b/basic/source/runtime/dllmgr-x86.cxx
@@ -73,7 +73,7 @@ char * address(std::vector< char > & blob) {
     return blob.empty() ? 0 : &blob[0];
 }
 
-SbError convert(OUString const & source, OString * target) {
+ErrCode convert(OUString const & source, OString * target) {
     return
         source.convertToString(
             target, osl_getThreadTextEncoding(),
@@ -83,7 +83,7 @@ SbError convert(OUString const & source, OString * target) {
         //TODO: more specific errcode?
 }
 
-SbError convert(char const * source, sal_Int32 length, OUString * target) {
+ErrCode convert(char const * source, sal_Int32 length, OUString * target) {
     return
         rtl_convertStringToUString(
             &target->pData, source, length, osl_getThreadTextEncoding(),
@@ -191,16 +191,16 @@ std::size_t alignment(SbxVariable * variable) {
     }
 }
 
-SbError marshal(
+ErrCode marshal(
     bool outer, SbxVariable * variable, bool special,
     std::vector< char > & blob, std::size_t offset, MarshalData & data);
 
-SbError marshalString(
+ErrCode marshalString(
     SbxVariable * variable, bool special, MarshalData & data, void ** buffer)
 {
     OSL_ASSERT(variable != 0 && buffer != 0);
     OString str;
-    SbError e = convert(variable->GetOUString(), &str);
+    ErrCode e = convert(variable->GetOUString(), &str);
     if (e != ERRCODE_NONE) {
         return e;
     }
@@ -212,7 +212,7 @@ SbError marshalString(
     return ERRCODE_NONE;
 }
 
-SbError marshalStruct(
+ErrCode marshalStruct(
     SbxVariable * variable, std::vector< char > & blob, std::size_t offset,
     MarshalData & data)
 {
@@ -220,7 +220,7 @@ SbError marshalStruct(
     SbxArray * props = dynamic_cast<SbxObject*>( variable->GetObject() )->
         GetProperties();
     for (sal_uInt16 i = 0; i < props->Count(); ++i) {
-        SbError e = marshal(false, props->Get(i), false, blob, offset, data);
+        ErrCode e = marshal(false, props->Get(i), false, blob, offset, data);
         if (e != ERRCODE_NONE) {
             return e;
         }
@@ -228,7 +228,7 @@ SbError marshalStruct(
     return ERRCODE_NONE;
 }
 
-SbError marshalArray(
+ErrCode marshalArray(
     SbxVariable * variable, std::vector< char > & blob, std::size_t offset,
     MarshalData & data)
 {
@@ -241,7 +241,7 @@ SbError marshalArray(
         arr->GetDim32(i + 1, low[i], up[i]);
     }
     for (std::vector< sal_Int32 > idx = low;;) {
-        SbError e = marshal(
+        ErrCode e = marshal(
             false, arr->Get32(&idx[0]), false, blob, offset, data);
         if (e != ERRCODE_NONE) {
             return e;
@@ -260,7 +260,7 @@ SbError marshalArray(
 
 // 8-aligned structs are only 4-aligned on stack, so alignment of members in
 // such structs must take that into account via "offset"
-SbError marshal(
+ErrCode marshal(
     bool outer, SbxVariable * variable, bool special,
     std::vector< char > & blob, std::size_t offset, MarshalData & data)
 {
@@ -289,7 +289,7 @@ SbError marshal(
             case SbxSTRING:
                 {
                     void * p;
-                    SbError e = marshalString(variable, special, data, &p);
+                    ErrCode e = marshalString(variable, special, data, &p);
                     if (e != ERRCODE_NONE) {
                         return e;
                     }
@@ -299,7 +299,7 @@ SbError marshal(
             case SbxOBJECT:
                 {
                     align(blob, outer ? 4 : alignment(variable), offset, 0);
-                    SbError e = marshalStruct(variable, blob, offset, data);
+                    ErrCode e = marshalStruct(variable, blob, offset, data);
                     if (e != ERRCODE_NONE) {
                         return e;
                     }
@@ -316,7 +316,7 @@ SbError marshal(
                 break;
             }
         } else {
-            SbError e = marshalArray(variable, blob, offset, data);
+            ErrCode e = marshalArray(variable, blob, offset, data);
             if (e != ERRCODE_NONE) {
                 return e;
             }
@@ -336,7 +336,7 @@ SbError marshal(
                 {
                     std::vector< char > * blob2 = data.newBlob();
                     void * p;
-                    SbError e = marshalString(variable, special, data, &p);
+                    ErrCode e = marshalString(variable, special, data, &p);
                     if (e != ERRCODE_NONE) {
                         return e;
                     }
@@ -347,7 +347,7 @@ SbError marshal(
             case SbxOBJECT:
                 {
                     std::vector< char > * blob2 = data.newBlob();
-                    SbError e = marshalStruct(variable, *blob2, 0, data);
+                    ErrCode e = marshalStruct(variable, *blob2, 0, data);
                     if (e != ERRCODE_NONE) {
                         return e;
                     }
@@ -364,7 +364,7 @@ SbError marshal(
             }
         } else {
             std::vector< char > * blob2 = data.newBlob();
-            SbError e = marshalArray(variable, *blob2, 0, data);
+            ErrCode e = marshalArray(variable, *blob2, 0, data);
             if (e != ERRCODE_NONE) {
                 return e;
             }
@@ -451,7 +451,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) {
     return data;
 }
 
-SbError unmarshalString(StringData const & data, SbxVariable & result) {
+ErrCode unmarshalString(StringData const & data, SbxVariable & result) {
     OUString str;
     if (data.buffer != 0) {
         char const * p = static_cast< char const * >(data.buffer);
@@ -465,7 +465,7 @@ SbError unmarshalString(StringData const & data, SbxVariable & result) {
         } else {
             len = rtl_str_getLength(p);
         }
-        SbError e = convert(p, len, &str);
+        ErrCode e = convert(p, len, &str);
         if (e != ERRCODE_NONE) {
             return e;
         }
@@ -479,7 +479,7 @@ struct ProcData {
     FARPROC proc;
 };
 
-SbError call(
+ErrCode call(
     OUString const & dll, ProcData const & proc, SbxArray * arguments,
     SbxVariable & result)
 {
@@ -492,7 +492,7 @@ SbError call(
     bool special = dll.equalsIgnoreAsciiCase("KERNEL32.DLL") &&
                    (proc.name == OString("GetLogicalDriveStringsA"));
     for (sal_uInt16 i = 1; i < (arguments == 0 ? 0 : arguments->Count()); ++i) {
-        SbError e = marshal(
+        ErrCode e = marshal(
             true, arguments->Get(i), special && i == 2, stack, stack.size(),
             data);
         if (e != ERRCODE_NONE) {
@@ -528,7 +528,7 @@ SbError call(
             char const * s1 = reinterpret_cast< char const * >(
                 DllMgr_call32(proc.proc, address(stack), stack.size()));
             OUString s2;
-            SbError e = convert(s1, rtl_str_getLength(s1), &s2);
+            ErrCode e = convert(s1, rtl_str_getLength(s1), &s2);
             if (e != ERRCODE_NONE) {
                 return e;
             }
@@ -565,7 +565,7 @@ SbError call(
     for (std::vector< StringData >::iterator i(data.unmarshalStrings.begin());
          i != data.unmarshalStrings.end(); ++i)
     {
-        SbError e = unmarshalString(*i, result);
+        ErrCode e = unmarshalString(*i, result);
         if (e != ERRCODE_NONE) {
             return e;
         }
@@ -573,7 +573,7 @@ SbError call(
     return ERRCODE_NONE;
 }
 
-SbError getProcData(HMODULE handle, OUString const & name, ProcData * proc)
+ErrCode getProcData(HMODULE handle, OUString const & name, ProcData * proc)
 {
     OSL_ASSERT(proc != 0);
     if ( !name.isEmpty() && name[0] == '@' ) { //TODO: "@" vs. "#"???
@@ -589,7 +589,7 @@ SbError getProcData(HMODULE handle, OUString const & name, ProcData * proc)
         }
     } else {
         OString name8;
-        SbError e = convert(name, &name8);
+        ErrCode e = convert(name, &name8);
         if (e != ERRCODE_NONE) {
             return e;
         }
@@ -636,7 +636,7 @@ private:
 public:
     Dll(): handle(0) {}
 
-    SbError getProc(OUString const & name, ProcData * proc);
+    ErrCode getProc(OUString const & name, ProcData * proc);
 
     HMODULE handle;
     Procs procs;
@@ -648,13 +648,13 @@ Dll::~Dll() {
     }
 }
 
-SbError Dll::getProc(OUString const & name, ProcData * proc) {
+ErrCode Dll::getProc(OUString const & name, ProcData * proc) {
     Procs::iterator i(procs.find(name));
     if (i != procs.end()) {
         *proc = i->second;
         return ERRCODE_NONE;
     }
-    SbError e = getProcData(handle, name, proc);
+    ErrCode e = getProcData(handle, name, proc);
     if (e == ERRCODE_NONE) {
         procs.insert(Procs::value_type(name, *proc));
     }
@@ -699,7 +699,7 @@ Dll * SbiDllMgr::Impl::getDll(OUString const & name) {
     return i->second.get();
 }
 
-SbError SbiDllMgr::Call(
+ErrCode SbiDllMgr::Call(
     OUString const & function, OUString const & library,
     SbxArray * arguments, SbxVariable & result, bool cdeclConvention)
 {
@@ -712,7 +712,7 @@ SbError SbiDllMgr::Call(
         return ERRCODE_BASIC_BAD_DLL_LOAD;
     }
     ProcData proc;
-    SbError e = dll->getProc(function, &proc);
+    ErrCode e = dll->getProc(function, &proc);
     if (e != ERRCODE_NONE) {
         return e;
     }
diff --git a/basic/source/runtime/dllmgr.hxx b/basic/source/runtime/dllmgr.hxx
index 19587b3fd088..9bd2e9c95424 100644
--- a/basic/source/runtime/dllmgr.hxx
+++ b/basic/source/runtime/dllmgr.hxx
@@ -36,7 +36,7 @@ public:
 
     ~SbiDllMgr();
 
-    SbError Call(
+    ErrCode Call(
         OUString const & function, OUString const &  library,
         SbxArray * arguments, SbxVariable & result, bool cdeclConvention);
 
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 24ea0cba4f3c..fc4868960837 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -459,7 +459,7 @@ void    UCBStream::SetSize( sal_uInt64 nSize )
 }
 
 
-SbError SbiStream::Open
+ErrCode SbiStream::Open
 ( short nCh, const OString& rName, StreamMode nStrmMode, SbiStreamFlags nFlags, short nL )
 {
     nMode   = nFlags;
@@ -526,7 +526,7 @@ SbError SbiStream::Open
     return nError;
 }
 
-SbError SbiStream::Close()
+ErrCode SbiStream::Close()
 {
     if( pStrm )
     {
@@ -537,7 +537,7 @@ SbError SbiStream::Close()
     return nError;
 }
 
-SbError SbiStream::Read(OString& rBuf, sal_uInt16 n, bool bForceReadingPerByte)
+ErrCode SbiStream::Read(OString& rBuf, sal_uInt16 n, bool bForceReadingPerByte)
 {
     nExpandOnWriteTo = 0;
     if( !bForceReadingPerByte && IsText() )
@@ -569,7 +569,7 @@ SbError SbiStream::Read(OString& rBuf, sal_uInt16 n, bool bForceReadingPerByte)
     return nError;
 }
 
-SbError SbiStream::Read( char& ch )
+ErrCode SbiStream::Read( char& ch )
 {
     nExpandOnWriteTo = 0;
     if (aLine.isEmpty())
@@ -614,7 +614,7 @@ namespace
     }
 }
 
-SbError SbiStream::Write( const OString& rBuf )
+ErrCode SbiStream::Write( const OString& rBuf )
 {
     ExpandFile();
     if( IsAppend() )
@@ -666,9 +666,9 @@ SbiIoSystem::~SbiIoSystem()
     Shutdown();
 }
 
-SbError SbiIoSystem::GetError()
+ErrCode SbiIoSystem::GetError()
 {
-    SbError n = nError; nError = 0;
+    ErrCode n = nError; nError = 0;
     return n;
 }
 
@@ -723,7 +723,7 @@ void SbiIoSystem::Shutdown()
     {
         if( pChan[ i ] )
         {
-            SbError n = pChan[ i ]->Close();
+            ErrCode n = pChan[ i ]->Close();
             delete pChan[ i ];
             pChan[ i ] = nullptr;
             if( n && !nError )
@@ -821,7 +821,7 @@ void SbiIoSystem::CloseAll()
     {
         if( pChan[ i ] )
         {
-            SbError n = pChan[ i ]->Close();
+            ErrCode n = pChan[ i ]->Close();
             delete pChan[ i ];
             pChan[ i ] = nullptr;
             if( n && !nError )
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 396ae9e8fc26..59b02467ab37 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -206,7 +206,7 @@ RTLFUNC(Error)
     else
     {
         OUString aErrorMsg;
-        SbError nErr = ERRCODE_NONE;
+        ErrCode nErr = ERRCODE_NONE;
         sal_Int32 nCode = 0;
         if( rPar.Count() == 1 )
         {
@@ -4025,7 +4025,7 @@ RTLFUNC(DDEInitiate)
 
     SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
     size_t nChannel;
-    SbError nDdeErr = pDDE->Initiate( rApp, rTopic, nChannel );
+    ErrCode nDdeErr = pDDE->Initiate( rApp, rTopic, nChannel );
     if( nDdeErr )
     {
         StarBASIC::Error( nDdeErr );
@@ -4050,7 +4050,7 @@ RTLFUNC(DDETerminate)
     }
     size_t nChannel = rPar.Get(1)->GetInteger();
     SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
-    SbError nDdeErr = pDDE->Terminate( nChannel );
+    ErrCode nDdeErr = pDDE->Terminate( nChannel );
     if( nDdeErr )
     {
         StarBASIC::Error( nDdeErr );
@@ -4071,7 +4071,7 @@ RTLFUNC(DDETerminateAll)
     }
 
     SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
-    SbError nDdeErr = pDDE->TerminateAll();
+    ErrCode nDdeErr = pDDE->TerminateAll();
     if( nDdeErr )
     {
         StarBASIC::Error( nDdeErr );
@@ -4093,7 +4093,7 @@ RTLFUNC(DDERequest)
     const OUString& rItem = rPar.Get(2)->GetOUString();
     SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
     OUString aResult;
-    SbError nDdeErr = pDDE->Request( nChannel, rItem, aResult );
+    ErrCode nDdeErr = pDDE->Request( nChannel, rItem, aResult );
     if( nDdeErr )
     {
         StarBASIC::Error( nDdeErr );
@@ -4119,7 +4119,7 @@ RTLFUNC(DDEExecute)
     size_t nChannel = rPar.Get(1)->GetInteger();
     const OUString& rCommand = rPar.Get(2)->GetOUString();
     SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
-    SbError nDdeErr = pDDE->Execute( nChannel, rCommand );
+    ErrCode nDdeErr = pDDE->Execute( nChannel, rCommand );
     if( nDdeErr )
     {
         StarBASIC::Error( nDdeErr );
@@ -4142,7 +4142,7 @@ RTLFUNC(DDEPoke)
     const OUString& rItem = rPar.Get(2)->GetOUString();
     const OUString& rData = rPar.Get(3)->GetOUString();
     SbiDdeControl* pDDE = GetSbData()->pInst->GetDdeControl();
-    SbError nDdeErr = pDDE->Poke( nChannel, rItem, rData );
+    ErrCode nDdeErr = pDDE->Poke( nChannel, rItem, rData );
     if( nDdeErr )
     {
         StarBASIC::Error( nDdeErr );
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 965379d7a49f..8ebcab989e08 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -333,7 +333,7 @@ RTLFUNC(CDbl)  // JSM
         {
             // #41690
             OUString aScanStr = pSbxVariable->GetOUString();
-            SbError Error = SbxValue::ScanNumIntnl( aScanStr, nVal );
+            ErrCode Error = SbxValue::ScanNumIntnl( aScanStr, nVal );
             if( Error != ERRCODE_SBX_OK )
             {
                 StarBASIC::Error( Error );
@@ -402,7 +402,7 @@ RTLFUNC(CSng)  // JSM
             // #41690
             double dVal = 0.0;
             OUString aScanStr = pSbxVariable->GetOUString();
-            SbError Error = SbxValue::ScanNumIntnl( aScanStr, dVal, /*bSingle=*/true );
+            ErrCode Error = SbxValue::ScanNumIntnl( aScanStr, dVal, /*bSingle=*/true );
             if( SbxBase::GetError() == ERRCODE_SBX_OK && Error != ERRCODE_SBX_OK )
             {
                 StarBASIC::Error( Error );
@@ -2283,7 +2283,7 @@ RTLFUNC(DateDiff)
 double implGetDateOfFirstDayInFirstWeek
     ( sal_Int16 nYear, sal_Int16& nFirstDay, sal_Int16& nFirstWeek, bool* pbError = nullptr )
 {
-    SbError nError = ERRCODE_NONE;
+    ErrCode nError = ERRCODE_NONE;
     if( nFirstDay < 0 || nFirstDay > 7 )
         nError = ERRCODE_BASIC_BAD_ARGUMENT;
 
@@ -3256,7 +3256,7 @@ RTLFUNC(Input)
     }
 
     OString aByteBuffer;
-    SbError err = pSbStrm->Read( aByteBuffer, nByteCount, true );
+    ErrCode err = pSbStrm->Read( aByteBuffer, nByteCount, true );
     if( !err )
         err = pIosys->GetError();
 
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 5054c9bf9f6a..13244e39de7d 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -460,12 +460,12 @@ void setBasicWatchMode( bool bOn )
     bWatchMode = bOn;
 }
 
-void SbiInstance::Error( SbError n )
+void SbiInstance::Error( ErrCode n )
 {
     Error( n, OUString() );
 }
 
-void SbiInstance::Error( SbError n, const OUString& rMsg )
+void SbiInstance::Error( ErrCode n, const OUString& rMsg )
 {
     if( !bWatchMode )
     {
@@ -478,7 +478,7 @@ void SbiInstance::ErrorVB( sal_Int32 nVBNumber, const OUString& rMsg )
 {
     if( !bWatchMode )
     {
-        SbError n = StarBASIC::GetSfxFromVBError( static_cast< sal_uInt16 >( nVBNumber ) );
+        ErrCode n = StarBASIC::GetSfxFromVBError( static_cast< sal_uInt16 >( nVBNumber ) );
         if ( !n )
         {
             n = nVBNumber; // force orig number, probably should have a specific table of vb ( localized ) errors
@@ -493,7 +493,7 @@ void SbiInstance::ErrorVB( sal_Int32 nVBNumber, const OUString& rMsg )
 
 void SbiInstance::setErrorVB( sal_Int32 nVBNumber )
 {
-    SbError n = StarBASIC::GetSfxFromVBError( static_cast< sal_uInt16 >( nVBNumber ) );
+    ErrCode n = StarBASIC::GetSfxFromVBError( static_cast< sal_uInt16 >( nVBNumber ) );
     if( !n )
     {
         n = nVBNumber; // force orig number, probably should have a specific table of vb ( localized ) errors
@@ -505,12 +505,12 @@ void SbiInstance::setErrorVB( sal_Int32 nVBNumber )
 }
 
 
-void SbiInstance::FatalError( SbError n )
+void SbiInstance::FatalError( ErrCode n )
 {
     pRun->FatalError( n );
 }
 
-void SbiInstance::FatalError( SbError _errCode, const OUString& _details )
+void SbiInstance::FatalError( ErrCode _errCode, const OUString& _details )
 {
     pRun->FatalError( _errCode, _details );
 }
@@ -774,11 +774,11 @@ bool SbiRuntime::Step()
             StarBASIC::FatalError( ERRCODE_BASIC_INTERNAL_ERROR );
         }
 
-        SbError nSbError = SbxBase::GetError();
-        Error( ERRCODE_TOERROR(nSbError) );
+        ErrCode nErrCode = SbxBase::GetError();
+        Error( ERRCODE_TOERROR(nErrCode) );
 
         // from 13.2.1997, new error handling:
-        // ATTENTION: nError can be set already even if !nSbError
+        // ATTENTION: nError can be set already even if !nErrCode
         // since nError can now also be set from other RT-instances
 
         if( nError )
@@ -790,7 +790,7 @@ bool SbiRuntime::Step()
         // (especially not after compiler errors at the runtime)
         if( nError && bRun )
         {
-            SbError err = nError;
+            ErrCode err = nError;
             ClearExprStack();
             nError = ERRCODE_NONE;
             pInst->nErr = err;
@@ -873,7 +873,7 @@ bool SbiRuntime::Step()
     return bRun;
 }
 
-void SbiRuntime::Error( SbError n, bool bVBATranslationAlreadyDone )
+void SbiRuntime::Error( ErrCode n, bool bVBATranslationAlreadyDone )
 {
     if( n )
     {
@@ -894,7 +894,7 @@ void SbiRuntime::Error( SbError n, bool bVBATranslationAlreadyDone )
     }
 }
 
-void SbiRuntime::Error( SbError _errCode, const OUString& _details )
+void SbiRuntime::Error( ErrCode _errCode, const OUString& _details )
 {
     if ( _errCode )
     {
@@ -912,19 +912,19 @@ void SbiRuntime::Error( SbError _errCode, const OUString& _details )
     }
 }
 
-void SbiRuntime::FatalError( SbError n )
+void SbiRuntime::FatalError( ErrCode n )
 {
     StepSTDERROR();
     Error( n );
 }
 
-void SbiRuntime::FatalError( SbError _errCode, const OUString& _details )
+void SbiRuntime::FatalError( ErrCode _errCode, const OUString& _details )
 {
     StepSTDERROR();
     Error( _errCode, _details );
 }
 
-sal_Int32 SbiRuntime::translateErrorToVba( SbError nError, OUString& rMsg )
+sal_Int32 SbiRuntime::translateErrorToVba( ErrCode nError, OUString& rMsg )
 {
     // If a message is defined use that ( in preference to
     // the defined one for the error ) NB #TODO
@@ -935,7 +935,7 @@ sal_Int32 SbiRuntime::translateErrorToVba( SbError nError, OUString& rMsg )
     {
         // TEST, has to be vb here always
 #ifdef DBG_UTIL
-        SbError nTmp = StarBASIC::GetSfxFromVBError( (sal_uInt16)nError );
+        ErrCode nTmp = StarBASIC::GetSfxFromVBError( (sal_uInt16)nError );
         SAL_WARN_IF( nTmp == 0, "basic", "No VB error!" );
 #endif
 
@@ -1247,7 +1247,7 @@ void SbiRuntime::DllCall
 
     SbxVariable* pRes = new SbxVariable( eResType );
     SbiDllMgr* pDllMgr = pInst->GetDllMgr();
-    SbError nErr = pDllMgr->Call( aFuncName, aDLLName, pArgs, *pRes, bCDecl );
+    ErrCode nErr = pDllMgr->Call( aFuncName, aDLLName, pArgs, *pRes, bCDecl );
     if( nErr )
     {
         Error( nErr );
@@ -2406,7 +2406,7 @@ void SbiRuntime::StepINPUT()
     OUStringBuffer sin;
     OUString s;
     char ch = 0;
-    SbError err;
+    ErrCode err;
     // Skip whitespace
     while( ( err = pIosys->GetError() ) == ERRCODE_NONE )
     {
@@ -2737,7 +2737,7 @@ void SbiRuntime::StepERROR()
 {
     SbxVariableRef refCode = PopVar();
     sal_uInt16 n = refCode->GetUShort();
-    SbError error = StarBASIC::GetSfxFromVBError( n );
+    ErrCode error = StarBASIC::GetSfxFromVBError( n );
     if ( bVBAEnabled )
     {
         pInst->Error( error );
@@ -3120,7 +3120,7 @@ void SbiRuntime::StepRESUME( sal_uInt32 nOp1 )
 // close channel (+channel, 0=all)
 void SbiRuntime::StepCLOSE( sal_uInt32 nOp1 )
 {
-    SbError err;
+    ErrCode err;
     if( !nOp1 )
         pIosys->Shutdown();
     else
@@ -3299,7 +3299,7 @@ void SbiRuntime::StepBASED( sal_uInt32 nOp1 )
 // 0x8000 - Argv is reserved
 
 SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2,
-                                      SbError nNotFound, bool bLocal, bool bStatic )
+                                      ErrCode nNotFound, bool bLocal, bool bStatic )
 {
     bool bIsVBAInterOp = SbiRuntime::isVBAEnabled();
     if( bIsVBAInterOp )
@@ -3932,7 +3932,7 @@ void SbiRuntime::StepRTL( sal_uInt32 nOp1, sal_uInt32 nOp2 )
 }
 
 void SbiRuntime::StepFIND_Impl( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2,
-                                SbError nNotFound, bool bStatic )
+                                ErrCode nNotFound, bool bStatic )
 {
     if( !refLocals.is() )
     {
diff --git a/include/basic/sberrors.hxx b/include/basic/sberrors.hxx
index f1e44a977754..52dc1256835a 100644
--- a/include/basic/sberrors.hxx
+++ b/include/basic/sberrors.hxx
@@ -22,10 +22,6 @@
 
 #include <basic/sbxdef.hxx>
 
-#ifndef __RSC
-typedef ErrCode SbError;
-#endif
-
 // Mapping to SbxError
 #define ERRCODE_BASIC_SYNTAX                ERRCODE_SBX_SYNTAX                  // unspecified syntax error
 #define ERRCODE_BASIC_BAD_ARGUMENT          ERRCODE_SBX_NOTIMP                  // Invalid procedure call
diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx
index b48334048ef9..c625abc4820f 100644
--- a/include/basic/sbstar.hxx
+++ b/include/basic/sbstar.hxx
@@ -69,9 +69,9 @@ class BASIC_DLLPUBLIC StarBASIC : public SbxObject
     BASIC_DLLPRIVATE void implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic );
 
 protected:
-    bool                                CError( SbError, const OUString&, sal_Int32, sal_Int32, sal_Int32 );
+    bool                                CError( ErrCode, const OUString&, sal_Int32, sal_Int32, sal_Int32 );
 private:
-    BASIC_DLLPRIVATE bool               RTError( SbError, const OUString& rMsg, sal_Int32, sal_Int32, sal_Int32 );
+    BASIC_DLLPRIVATE bool               RTError( ErrCode, const OUString& rMsg, sal_Int32, sal_Int32, sal_Int32 );
     BASIC_DLLPRIVATE BasicDebugFlags    BreakPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
     BASIC_DLLPRIVATE BasicDebugFlags    StepPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
     virtual bool LoadData( SvStream&, sal_uInt16 ) override;
@@ -101,12 +101,12 @@ public:
     SbModule*       MakeModule( const OUString& rName, const OUString& rSrc );
     SbModule*       MakeModule( const OUString& rName, const css::script::ModuleInfo& mInfo, const OUString& rSrc );
     static void     Stop();
-    static void     Error( SbError );
-    static void     Error( SbError, const OUString& rMsg );
-    static void     FatalError( SbError );
-    static void     FatalError( SbError, const OUString& rMsg );
+    static void     Error( ErrCode );
+    static void     Error( ErrCode, const OUString& rMsg );
+    static void     FatalError( ErrCode );
+    static void     FatalError( ErrCode, const OUString& rMsg );
     static bool     IsRunning();
-    static SbError  GetErrBasic();
+    static ErrCode  GetErrBasic();
     // #66536 make additional message accessible by RTL function Error
     static OUString GetErrorMsg();
     static sal_Int32 GetErl();
@@ -126,15 +126,15 @@ public:
     static sal_uInt16 GetLine();
     static sal_uInt16 GetCol1();
     static sal_uInt16 GetCol2();
-    static void     SetErrorData( SbError nCode, sal_uInt16 nLine,
+    static void     SetErrorData( ErrCode nCode, sal_uInt16 nLine,
                                   sal_uInt16 nCol1, sal_uInt16 nCol2 );
 
     // Specific to error handler
-    static void     MakeErrorText( SbError, const OUString& aMsg );
+    static void     MakeErrorText( ErrCode, const OUString& aMsg );
     static const    OUString& GetErrorText();
-    static SbError  GetErrorCode();
-    static sal_uInt16 GetVBErrorCode( SbError nError );
-    static SbError  GetSfxFromVBError( sal_uInt16 nError );
+    static ErrCode  GetErrorCode();
+    static sal_uInt16 GetVBErrorCode( ErrCode nError );
+    static ErrCode  GetSfxFromVBError( sal_uInt16 nError );
     bool            IsBreak() const             { return bBreak; }
 
     static Link<StarBASIC*,bool> GetGlobalErrorHdl();


More information about the Libreoffice-commits mailing list