diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-23 12:31:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-24 08:05:55 +0200 |
commit | 06dd5b9c9e34ad932b0a111c0ecb9f1e99008a19 (patch) | |
tree | eb0b6b1a7fca8a1747745541a048cacfd2fb092e /include/basic | |
parent | b367c81d06f64e500063ebb814eda5e8d55309ca (diff) |
convert SbDEBUG constants to o3tl::typed_flags
Change-Id: Ifcada5684bacae46ec90c5ce3e58980860fee29f
Diffstat (limited to 'include/basic')
-rw-r--r-- | include/basic/sbdef.hxx | 17 | ||||
-rw-r--r-- | include/basic/sbmeth.hxx | 8 | ||||
-rw-r--r-- | include/basic/sbstar.hxx | 14 |
3 files changed, 23 insertions, 16 deletions
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(); |