summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/basicide/baside2.cxx16
-rw-r--r--basctl/source/basicide/baside2.hxx2
-rw-r--r--basctl/source/basicide/basides1.cxx4
-rw-r--r--basctl/source/basicide/iderdll.cxx6
-rw-r--r--basctl/source/basicide/iderdll2.hxx2
-rw-r--r--basctl/source/inc/basidesh.hxx2
-rw-r--r--basctl/source/inc/bastypes.hxx5
-rw-r--r--basic/source/classes/sb.cxx10
-rw-r--r--basic/source/classes/sbxmod.cxx20
-rw-r--r--basic/source/inc/runtime.hxx68
-rw-r--r--basic/source/inc/sbintern.hxx4
-rw-r--r--basic/source/runtime/runtime.cxx30
-rw-r--r--include/basic/sbdef.hxx17
-rw-r--r--include/basic/sbmeth.hxx8
-rw-r--r--include/basic/sbstar.hxx14
15 files changed, 105 insertions, 103 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index fdd837ecbccc..dbfe9ca19987 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -314,7 +314,7 @@ void ModulWindow::BasicExecute()
if ( XModule().Is() && m_xModule->IsCompiled() && !m_aStatus.bError )
{
if ( GetBreakPoints().size() )
- m_aStatus.nBasicFlags = m_aStatus.nBasicFlags | SbDEBUG_BREAK;
+ m_aStatus.nBasicFlags = m_aStatus.nBasicFlags | BasicDebugFlags::Break;
if ( !m_aStatus.bIsRunning )
{
@@ -369,26 +369,26 @@ void ModulWindow::CompileBasic()
void ModulWindow::BasicRun()
{
- m_aStatus.nBasicFlags = 0;
+ m_aStatus.nBasicFlags = BasicDebugFlags::NONE;
BasicExecute();
}
void ModulWindow::BasicStepOver()
{
- m_aStatus.nBasicFlags = SbDEBUG_STEPINTO | SbDEBUG_STEPOVER;
+ m_aStatus.nBasicFlags = BasicDebugFlags::StepInto | BasicDebugFlags::StepOver;
BasicExecute();
}
void ModulWindow::BasicStepInto()
{
- m_aStatus.nBasicFlags = SbDEBUG_STEPINTO;
+ m_aStatus.nBasicFlags = BasicDebugFlags::StepInto;
BasicExecute();
}
void ModulWindow::BasicStepOut()
{
- m_aStatus.nBasicFlags = SbDEBUG_STEPOUT;
+ m_aStatus.nBasicFlags = BasicDebugFlags::StepOut;
BasicExecute();
}
@@ -515,7 +515,7 @@ void ModulWindow::ToggleBreakPoint( sal_uLong nLine )
{
SbMethod* pMethod = static_cast<SbMethod*>(m_xModule->GetMethods()->Get( nMethod ));
assert(pMethod && "Methode nicht gefunden! (NULL)");
- pMethod->SetDebugFlags( pMethod->GetDebugFlags() | SbDEBUG_BREAK );
+ pMethod->SetDebugFlags( pMethod->GetDebugFlags() | BasicDebugFlags::Break );
}
}
}
@@ -626,7 +626,7 @@ bool ModulWindow::BasicErrorHdl( StarBASIC * pBasic )
return false;
}
-long ModulWindow::BasicBreakHdl( StarBASIC* pBasic )
+BasicDebugFlags ModulWindow::BasicBreakHdl( StarBASIC* pBasic )
{
// #i69280 Required in Window despite normal usage in next command!
(void)pBasic;
@@ -1280,7 +1280,7 @@ void ModulWindow::BasicStarted()
{
SbMethod* pMethod = static_cast<SbMethod*>(m_xModule->GetMethods()->Get( nMethod ));
assert(pMethod && "Methode nicht gefunden! (NULL)");
- pMethod->SetDebugFlags( pMethod->GetDebugFlags() | SbDEBUG_BREAK );
+ pMethod->SetDebugFlags( pMethod->GetDebugFlags() | BasicDebugFlags::Break );
}
}
}
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index e631d8ee8987..3463fbb73a6f 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -360,7 +360,7 @@ public:
void BasicAddWatch();
bool BasicErrorHdl( StarBASIC* pBasic );
- long BasicBreakHdl( StarBASIC* pBasic );
+ BasicDebugFlags BasicBreakHdl( StarBASIC* pBasic );
void AssertValidEditEngine();
void LoadBasic();
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 3f8f34c48624..251c91652598 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -1109,9 +1109,9 @@ bool Shell::CallBasicErrorHdl( StarBASIC* pBasic )
return bRet;
}
-long Shell::CallBasicBreakHdl( StarBASIC* pBasic )
+BasicDebugFlags Shell::CallBasicBreakHdl( StarBASIC* pBasic )
{
- long nRet = 0;
+ BasicDebugFlags nRet = BasicDebugFlags::NONE;
VclPtr<ModulWindow> pModWin = ShowActiveModuleWindow( pBasic );
if ( pModWin )
{
diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx
index 1be7cb330105..1faeb46ae634 100644
--- a/basctl/source/basicide/iderdll.cxx
+++ b/basctl/source/basicide/iderdll.cxx
@@ -170,9 +170,9 @@ void ExtraData::SetSearchItem (const SvxSearchItem& rItem)
pSearchItem.reset(static_cast<SvxSearchItem*>(rItem.Clone()));
}
-IMPL_STATIC_LINK(ExtraData, GlobalBasicBreakHdl, StarBASIC *, pBasic, sal_uInt16)
+IMPL_STATIC_LINK(ExtraData, GlobalBasicBreakHdl, StarBASIC *, pBasic, BasicDebugFlags)
{
- sal_uInt16 nRet = 0;
+ BasicDebugFlags nRet = BasicDebugFlags::NONE;
if (Shell* pShell = GetShell())
{
if (BasicManager* pBasMgr = FindBasicManager(pBasic))
@@ -193,7 +193,7 @@ IMPL_STATIC_LINK(ExtraData, GlobalBasicBreakHdl, StarBASIC *, pBasic, sal_uInt16
if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) )
{
// a step-out should get me out of the protected area...
- nRet = SbDEBUG_STEPOUT;
+ nRet = BasicDebugFlags::StepOut;
}
else
{
diff --git a/basctl/source/basicide/iderdll2.hxx b/basctl/source/basicide/iderdll2.hxx
index 1409dc4cd958..cd2484011039 100644
--- a/basctl/source/basicide/iderdll2.hxx
+++ b/basctl/source/basicide/iderdll2.hxx
@@ -48,7 +48,7 @@ private:
bool bShellInCriticalSection;
protected:
- DECL_STATIC_LINK( ExtraData, GlobalBasicBreakHdl, StarBASIC *, sal_uInt16 );
+ DECL_STATIC_LINK( ExtraData, GlobalBasicBreakHdl, StarBASIC *, BasicDebugFlags );
public:
ExtraData();
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index aa41e8bba462..d6f02ea6468c 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -178,7 +178,7 @@ public:
virtual bool HasUIFeature(SfxShellFeature nFeature) const override;
bool CallBasicErrorHdl( StarBASIC* pBasic );
- long CallBasicBreakHdl( StarBASIC* pBasic );
+ BasicDebugFlags CallBasicBreakHdl( StarBASIC* pBasic );
VclPtr<BaseWindow> FindWindow( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rName, ItemType nType, bool bFindSuspended = false );
VclPtr<DialogWindow> FindDlgWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rName, bool bCreateIfNotExist = false, bool bFindSuspended = false );
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index 20f9f8f1471f..b487d40153f4 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -25,6 +25,7 @@
#include <iderid.hxx>
#include <svtools/tabbar.hxx>
#include <vcl/toolbox.hxx>
+#include <basic/sbdef.hxx>
#include <unordered_map>
@@ -63,13 +64,13 @@ struct BasicStatus
bool bIsRunning : 1;
bool bError : 1;
bool bIsInReschedule : 1;
- sal_uInt16 nBasicFlags;
+ BasicDebugFlags nBasicFlags;
BasicStatus():
bIsRunning(false),
bError(false),
bIsInReschedule(false),
- nBasicFlags(0) { }
+ nBasicFlags(BasicDebugFlags::NONE) { }
};
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index b4e21a4c6e71..d03eaa35c34b 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1430,7 +1430,7 @@ SbModule* StarBASIC::GetActiveModule()
}
}
-sal_uInt16 StarBASIC::BreakPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
+BasicDebugFlags StarBASIC::BreakPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
{
SetErrorData( 0, l, c1, c2 );
bBreak = true;
@@ -1444,7 +1444,7 @@ sal_uInt16 StarBASIC::BreakPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
}
}
-sal_uInt16 StarBASIC::StepPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
+BasicDebugFlags StarBASIC::StepPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
{
SetErrorData( 0, l, c1, c2 );
bBreak = false;
@@ -1458,9 +1458,9 @@ sal_uInt16 StarBASIC::StepPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
}
}
-sal_uInt16 StarBASIC::BreakHdl()
+BasicDebugFlags StarBASIC::BreakHdl()
{
- return aBreakHdl.IsSet() ? aBreakHdl.Call( this ) : SbDEBUG_CONTINUE;
+ return aBreakHdl.IsSet() ? aBreakHdl.Call( this ) : BasicDebugFlags::Continue;
}
// Calls for error handler and break handler
@@ -1802,7 +1802,7 @@ void StarBASIC::SetGlobalErrorHdl( const Link<StarBASIC*,bool>& rLink )
GetSbData()->aErrHdl = rLink;
}
-void StarBASIC::SetGlobalBreakHdl( const Link<StarBASIC*,sal_uInt16>& rLink )
+void StarBASIC::SetGlobalBreakHdl( const Link<StarBASIC*,BasicDebugFlags>& rLink )
{
GetSbData()->aBreakHdl = rLink;
}
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index fef122064dc2..8b5b97ec3cc8 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1181,10 +1181,10 @@ void SbModule::Run( SbMethod* pMeth )
GetSbData()->pInst->nCallLvl--; // Call-Level down again
// Exist an higher-ranking runtime instance?
- // Then take over SbDEBUG_BREAK, if set
+ // Then take over BasicDebugFlags::Break, if set
SbiRuntime* pRtNext = pRt->pNext;
- if( pRtNext && (pRt->GetDebugFlags() & SbDEBUG_BREAK) )
- pRtNext->SetDebugFlags( SbDEBUG_BREAK );
+ if( pRtNext && (pRt->GetDebugFlags() & BasicDebugFlags::Break) )
+ pRtNext->SetDebugFlags( BasicDebugFlags::Break );
delete pRt;
GetSbData()->pMod = pOldMod;
@@ -1558,9 +1558,9 @@ bool SbModule::SetBP( sal_uInt16 nLine )
}
pBreaks->insert( pBreaks->begin() + i, nLine );
- // #38568: Set during runtime as well here SbDEBUG_BREAK
+ // #38568: Set during runtime as well here BasicDebugFlags::Break
if( GetSbData()->pInst && GetSbData()->pInst->pRun )
- GetSbData()->pInst->pRun->SetDebugFlags( SbDEBUG_BREAK );
+ GetSbData()->pInst->pRun->SetDebugFlags( BasicDebugFlags::Break );
return IsBreakable( nLine );
}
@@ -1975,12 +1975,12 @@ SbMethod::SbMethod( const OUString& r, SbxDataType t, SbModule* p )
: SbxMethod( r, t ), pMod( p )
{
bInvalid = true;
- nStart =
- nDebugFlags =
- nLine1 =
+ nStart = 0;
+ nDebugFlags = BasicDebugFlags::NONE;
+ nLine1 = 0;
nLine2 = 0;
- refStatics = new SbxArray;
- mCaller = nullptr;
+ refStatics = new SbxArray;
+ mCaller = nullptr;
// HACK due to 'Referenz could not be saved'
SetFlag( SbxFlagBits::NoModify );
}
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index 5a1e8c211d24..cf6d32a1e755 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -159,7 +159,7 @@ public:
// explanation see runtime.cxx at SbiInstance::CalcBreakCallLevel()
sal_uInt16 nCallLvl;
sal_uInt16 nBreakCallLvl;
- void CalcBreakCallLevel( sal_uInt16 nFlags );
+ void CalcBreakCallLevel( BasicDebugFlags nFlags );
SbiInstance( StarBASIC* );
~SbiInstance();
@@ -217,46 +217,46 @@ class SbiRuntime
static pStep1 aStep1[];
static pStep2 aStep2[];
- StarBASIC& rBasic; // StarBASIC instance
- SbiInstance* pInst; // current thread
- SbModule* pMod; // current module
- SbMethod* pMeth; // method instance
- SbiIoSystem* pIosys; // I/O-System
- const SbiImage* pImg; // Code-Image
- SbxArrayRef refExprStk; // expression stack
- SbxArrayRef refCaseStk; // CASE expression stack
- SbxArrayRef refRedimpArray; // Array saved to use for REDIM PRESERVE
- SbxVariableRef refRedim; // Array saved to use for REDIM
- SbxVariableRef xDummyVar; // substitute for variables that weren't found
- SbxVariable* mpExtCaller; // Caller ( external - e.g. button name, shape, range object etc. - only in vba mode )
- SbiForStack* pForStk; // FOR/NEXT-Stack
- sal_uInt16 nExprLvl; // depth of the expr-stack
- sal_uInt16 nForLvl; // #118235: Maintain for level
+ StarBASIC& rBasic; // StarBASIC instance
+ SbiInstance* pInst; // current thread
+ SbModule* pMod; // current module
+ SbMethod* pMeth; // method instance
+ SbiIoSystem* pIosys; // I/O-System
+ const SbiImage* pImg; // Code-Image
+ SbxArrayRef refExprStk; // expression stack
+ SbxArrayRef refCaseStk; // CASE expression stack
+ SbxArrayRef refRedimpArray; // Array saved to use for REDIM PRESERVE
+ SbxVariableRef refRedim; // Array saved to use for REDIM
+ SbxVariableRef xDummyVar; // substitute for variables that weren't found
+ SbxVariable* mpExtCaller; // Caller ( external - e.g. button name, shape, range object etc. - only in vba mode )
+ SbiForStack* pForStk; // FOR/NEXT-Stack
+ sal_uInt16 nExprLvl; // depth of the expr-stack
+ sal_uInt16 nForLvl; // #118235: Maintain for level
const sal_uInt8* pCode; // current Code-Pointer
const sal_uInt8* pStmnt; // beginning of the last statement
const sal_uInt8* pError; // address of the current error handler
const sal_uInt8* pRestart; // restart-address
const sal_uInt8* pErrCode; // restart-adresse RESUME NEXT
const sal_uInt8* pErrStmnt; // Restart-Adresse RESUME 0
- OUString aLibName; // Lib-name for declare-call
- SbxArrayRef refParams; // current procedure parameters
- SbxArrayRef refLocals; // local variable
- SbxArrayRef refArgv;
+ OUString aLibName; // Lib-name for declare-call
+ SbxArrayRef refParams; // current procedure parameters
+ SbxArrayRef refLocals; // local variable
+ SbxArrayRef refArgv;
// #74254, one refSaveObj is not enough! new: pRefSaveList (see above)
- short nArgc;
- bool bRun;
- bool bError; // true: handle errors
- bool bInError; // true: in an error handler
- bool bBlocked; // true: blocked by next call level, #i48868
- bool bVBAEnabled;
- sal_uInt16 nFlags; // Debugging-Flags
- SbError nError;
- sal_uInt16 nOps; // opcode counter
- sal_uInt32 m_nLastTime;
+ short nArgc;
+ bool bRun;
+ bool bError; // true: handle errors
+ bool bInError; // true: in an error handler
+ bool bBlocked; // true: blocked by next call level, #i48868
+ bool bVBAEnabled;
+ BasicDebugFlags nFlags; // Debugging-Flags
+ SbError nError;
+ sal_uInt16 nOps; // opcode counter
+ sal_uInt32 m_nLastTime;
std::vector<SbxVariableRef> aRefSaved; // #74254 save temporary references
- std::vector<SbiGosub> pGosubStk; // GOSUB stack
- std::vector<SbiArgv> pArgvStk; // ARGV-Stack
+ std::vector<SbiGosub> pGosubStk; // GOSUB stack
+ std::vector<SbiArgv> pArgvStk; // ARGV-Stack
SbxVariable* FindElement
@@ -364,8 +364,8 @@ public:
void block() { bBlocked = true; }
void unblock() { bBlocked = false; }
SbModule* GetModule() { return pMod; }
- sal_uInt16 GetDebugFlags() { return nFlags; }
- void SetDebugFlags( sal_uInt16 nFl ) { nFlags = nFl; }
+ BasicDebugFlags GetDebugFlags() { return nFlags; }
+ void SetDebugFlags( BasicDebugFlags nFl ) { nFlags = nFl; }
SbMethod* GetCaller() { return pMeth;}
SbxVariable* GetExternalCaller(){ return mpExtCaller; }
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index 03ce05a3b2ac..900679f7b699 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -89,8 +89,8 @@ struct SbiGlobals
SbModule* pMod; // currently active module
SbModule* pCompMod; // currently compiled module
short nInst; // number of BASICs
- Link<StarBASIC*,bool> aErrHdl; // global error handler
- Link<StarBASIC*,sal_uInt16> aBreakHdl; // global break handler
+ Link<StarBASIC*,bool> aErrHdl; // global error handler
+ Link<StarBASIC*,BasicDebugFlags> aBreakHdl; // global break handler
SbError nCode;
sal_Int32 nLine;
sal_Int32 nCol1,nCol2; // from... to...
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 67108d849f31..030a75f39986 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -283,26 +283,20 @@ SbiRTLData::~SbiRTLData()
// (also have a look at: step2.cxx, SbiRuntime::StepSTMNT() )
-void SbiInstance::CalcBreakCallLevel( sal_uInt16 nFlags )
+void SbiInstance::CalcBreakCallLevel( BasicDebugFlags nFlags )
{
- nFlags &= ~((sal_uInt16)SbDEBUG_BREAK);
+ nFlags &= ~BasicDebugFlags::Break;
sal_uInt16 nRet;
- switch( nFlags )
- {
- case SbDEBUG_STEPINTO:
+ if (nFlags == BasicDebugFlags::StepInto) {
nRet = nCallLvl + 1; // CallLevel+1 is also stopped
- break;
- case SbDEBUG_STEPOVER | SbDEBUG_STEPINTO:
+ } else if (nFlags == (BasicDebugFlags::StepOver | BasicDebugFlags::StepInto)) {
nRet = nCallLvl; // current CallLevel is stopped
- break;
- case SbDEBUG_STEPOUT:
+ } else if (nFlags == BasicDebugFlags::StepOut) {
nRet = nCallLvl - 1; // smaller CallLevel is stopped
- break;
- case SbDEBUG_CONTINUE:
- // Basic-IDE returns 0 instead of SbDEBUG_CONTINUE, so also default=continue
- default:
+ } else {
+ // Basic-IDE returns 0 instead of BasicDebugFlags::Continue, so also default=continue
nRet = 0; // CallLevel is always > 0 -> no StepPoint
}
nBreakCallLvl = nRet; // take result
@@ -448,7 +442,7 @@ SvNumberFormatter* SbiInstance::PrepareNumberFormatter( sal_uInt32 &rnStdDateIdx
}
-// Let engine run. If Flags == SbDEBUG_CONTINUE, take Flags over
+// Let engine run. If Flags == BasicDebugFlags::Continue, take Flags over
void SbiInstance::Stop()
{
@@ -572,7 +566,7 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, sal_uInt32 nStart )
: rBasic( *static_cast<StarBASIC*>(pm->pParent) ), pInst( GetSbData()->pInst ),
pMod( pm ), pMeth( pe ), pImg( pMod->pImage ), mpExtCaller(nullptr), m_nLastTime(0)
{
- nFlags = pe ? pe->GetDebugFlags() : 0;
+ nFlags = pe ? pe->GetDebugFlags() : BasicDebugFlags::NONE;
pIosys = pInst->GetIoSystem();
pForStk = nullptr;
pError = nullptr;
@@ -4228,18 +4222,18 @@ void SbiRuntime::StepSTMNT( sal_uInt32 nOp1, sal_uInt32 nOp2 )
if( pInst->nCallLvl <= pInst->nBreakCallLvl )
{
StarBASIC* pStepBasic = GetCurrentBasic( &rBasic );
- sal_uInt16 nNewFlags = pStepBasic->StepPoint( nLine, nCol1, nCol2 );
+ BasicDebugFlags nNewFlags = pStepBasic->StepPoint( nLine, nCol1, nCol2 );
pInst->CalcBreakCallLevel( nNewFlags );
}
// break points only at STMNT-commands in a new line!
else if( ( nOp1 != nOld )
- && ( nFlags & SbDEBUG_BREAK )
+ && ( nFlags & BasicDebugFlags::Break )
&& pMod->IsBP( static_cast<sal_uInt16>( nOp1 ) ) )
{
StarBASIC* pBreakBasic = GetCurrentBasic( &rBasic );
- sal_uInt16 nNewFlags = pBreakBasic->BreakPoint( nLine, nCol1, nCol2 );
+ BasicDebugFlags nNewFlags = pBreakBasic->BreakPoint( nLine, nCol1, nCol2 );
pInst->CalcBreakCallLevel( nNewFlags );
}
diff --git a/include/basic/sbdef.hxx b/include/basic/sbdef.hxx
index fa20115b9753..39576fbe7f87 100644
--- a/include/basic/sbdef.hxx
+++ b/include/basic/sbdef.hxx
@@ -23,6 +23,7 @@
#include <basic/sbxdef.hxx>
#include <rtl/ustring.hxx>
#include <basic/basicdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
// Returns type name for Basic type, array flag is ignored
// implementation: basic/source/runtime/methods.cxx
@@ -39,11 +40,17 @@ BASIC_DLLPUBLIC OUString getBasicObjectTypeName( SbxObject* pObj );
BASIC_DLLPUBLIC void setBasicWatchMode( bool bOn );
// Debug Flags:
-#define SbDEBUG_BREAK 0x0001 // Break-Callback
-#define SbDEBUG_STEPINTO 0x0002 // Single Step-Callback
-#define SbDEBUG_STEPOVER 0x0004 // Additional flag Step Over
-#define SbDEBUG_CONTINUE 0x0008 // Do not change flags
-#define SbDEBUG_STEPOUT 0x0010 // Leave Sub
+enum class BasicDebugFlags {
+ NONE = 0x0000,
+ Break = 0x0001, // Break-Callback
+ StepInto = 0x0002, // Single Step-Callback
+ StepOver = 0x0004, // Additional flag Step Over
+ Continue = 0x0008, // Do not change flags
+ StepOut = 0x0010, // Leave Sub
+};
+namespace o3tl {
+ template<> struct typed_flags<BasicDebugFlags> : is_typed_flags<BasicDebugFlags, 0x001f> {};
+}
#define SBXID_BASIC 0x6273 // sb: StarBASIC
#define SBXID_BASICMOD 0x6d62 // bm: StarBASIC Module
diff --git a/include/basic/sbmeth.hxx b/include/basic/sbmeth.hxx
index 1eb6654b6bea..e0d57a695d09 100644
--- a/include/basic/sbmeth.hxx
+++ b/include/basic/sbmeth.hxx
@@ -39,7 +39,7 @@ class BASIC_DLLPUBLIC SbMethod : public SbxMethod
SbxVariable* mCaller; // caller
SbModule* pMod;
- sal_uInt16 nDebugFlags;
+ BasicDebugFlags nDebugFlags;
sal_uInt16 nLine1, nLine2;
sal_uInt32 nStart;
bool bInvalid;
@@ -55,9 +55,9 @@ public:
virtual SbxInfo* GetInfo() override;
SbxArray* GetStatics();
void ClearStatics();
- SbModule* GetModule() { return pMod; }
- sal_uInt16 GetDebugFlags() { return nDebugFlags; }
- void SetDebugFlags( sal_uInt16 n ) { nDebugFlags = n; }
+ SbModule* GetModule() { return pMod; }
+ BasicDebugFlags GetDebugFlags() { return nDebugFlags; }
+ void SetDebugFlags( BasicDebugFlags n ) { nDebugFlags = n; }
void GetLineRange( sal_uInt16&, sal_uInt16& );
// Interface to execute a method from the applications
diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx
index aeb7874b5ae9..b48334048ef9 100644
--- a/include/basic/sbstar.hxx
+++ b/include/basic/sbstar.hxx
@@ -54,8 +54,8 @@ class BASIC_DLLPUBLIC StarBASIC : public SbxObject
SbxArrayRef xUnoListeners; // Listener handled by CreateUnoListener
// Handler-Support:
- Link<StarBASIC*,bool> aErrorHdl; // Error handler
- Link<StarBASIC*,sal_uInt16> aBreakHdl; // Breakpoint handler
+ Link<StarBASIC*,bool> aErrorHdl; // Error handler
+ Link<StarBASIC*,BasicDebugFlags> aBreakHdl; // Breakpoint handler
bool bNoRtl; // if true: do not search RTL
bool bBreak; // if true: Break, otherwise Step
bool bDocBasic;
@@ -72,14 +72,14 @@ protected:
bool CError( SbError, 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 sal_uInt16 BreakPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
- BASIC_DLLPRIVATE sal_uInt16 StepPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
+ 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;
virtual bool StoreData( SvStream& ) const override;
protected:
- bool ErrorHdl();
- sal_uInt16 BreakHdl();
+ bool ErrorHdl();
+ BasicDebugFlags BreakHdl();
virtual ~StarBASIC() override;
public:
@@ -140,7 +140,7 @@ public:
static Link<StarBASIC*,bool> GetGlobalErrorHdl();
static void SetGlobalErrorHdl( const Link<StarBASIC*,bool>& rNewHdl );
- static void SetGlobalBreakHdl( const Link<StarBASIC*,sal_uInt16>& rNewHdl );
+ static void SetGlobalBreakHdl( const Link<StarBASIC*,BasicDebugFlags>& rNewHdl );
SbxArrayRef const & getUnoListeners();