diff options
Diffstat (limited to 'basic/source/inc/runtime.hxx')
-rw-r--r-- | basic/source/inc/runtime.hxx | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index d09db071a1a9..662a7d696859 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -32,12 +32,14 @@ #include <cmath> #include <vector> #include <memory> +#include <optional> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/container/XEnumeration.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <unotools/localedatawrapper.hxx> #include <o3tl/deleter.hxx> #include <o3tl/typed_flags_set.hxx> +#include <tools/wldcrd.hxx> class SbiInstance; // active StarBASIC process class SbiRuntime; // active StarBASIC procedure instance @@ -99,8 +101,6 @@ namespace o3tl template<> struct typed_flags<SbAttributes> : is_typed_flags<SbAttributes, 0x13> {}; } -class WildCard; - class SbiRTLData { public: @@ -110,7 +110,7 @@ public: short nCurDirPos; OUString sFullNameToBeChecked; - std::unique_ptr<WildCard> pWildCard; + std::optional<WildCard> moWildCard; css::uno::Sequence< OUString > aDirSeq; @@ -188,7 +188,7 @@ public: SbiDdeControl* GetDdeControl() { return pDdeCtrl.get(); } StarBASIC* GetBasic() { return pBasic; } SbiDllMgr* GetDllMgr(); - SbiRTLData& GetRTLData() const { return const_cast<SbiRTLData&>(aRTLData); } + SbiRTLData& GetRTLData() { return aRTLData; } std::shared_ptr<SvNumberFormatter> const & GetNumberFormatter(); sal_uInt32 GetStdDateIdx() const { return nStdDateIdx; } @@ -226,31 +226,30 @@ class SbiRuntime 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 + SbxVariable* mpExtCaller = nullptr; // Caller ( external - e.g. button name, shape, range object etc. - only in vba mode ) + SbiForStack* pForStk = nullptr; // FOR/NEXT-Stack + sal_uInt16 nExprLvl = 0; // depth of the expr-stack + sal_uInt16 nForLvl = 0; // #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-address RESUME NEXT - const sal_uInt8* pErrStmnt; // restart-address RESUME 0 + const sal_uInt8* pError = nullptr; // address of the current error handler + const sal_uInt8* pRestart = nullptr; // restart-address + const sal_uInt8* pErrCode = nullptr; // restart-address RESUME NEXT + const sal_uInt8* pErrStmnt = nullptr; // restart-address RESUME 0 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 + short nArgc = 0; + bool bRun = true; + bool bError = true; // true: handle errors + bool bInError = false; // true: in an error handler + bool bBlocked = false; // true: blocked by next call level, #i48868 bool bVBAEnabled; BasicDebugFlags nFlags; // Debugging-Flags - ErrCode nError; - sal_uInt16 nOps; // opcode counter - sal_uInt32 m_nLastTime; + ErrCode nError = ERRCODE_NONE; + sal_uInt16 nOps = 0; // opcode counter std::vector<SbxVariableRef> aRefSaved; // #74254 save temporary references std::vector<SbiGosub> pGosubStk; // GOSUB stack @@ -349,8 +348,8 @@ public: void SetVBAEnabled( bool bEnabled ); bool IsImageFlag( SbiImageFlags n ) const; sal_uInt16 GetBase() const; - sal_Int32 nLine,nCol1,nCol2; - SbiRuntime* pNext; // Stack-Chain + sal_Int32 nLine = 0, nCol1 = 0, nCol2 = 0; + SbiRuntime* pNext = nullptr; // Stack-Chain // tdf#79426, tdf#125180 - adds the information about a missing parameter static void SetIsMissing( SbxVariable* ); |