LibreOffice Module basic (master) 1
runtime.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <basic/sberrors.hxx>
23#include <basic/sbmeth.hxx>
24#include <basic/sbstar.hxx>
25#include <basic/sbx.hxx>
26
27#include <rtl/ustring.hxx>
28#include <com/sun/star/uno/Sequence.hxx>
29#include <osl/file.hxx>
30#include <i18nlangtag/lang.h>
31
32#include <cmath>
33#include <vector>
34#include <memory>
35#include <optional>
36#include <com/sun/star/lang/XComponent.hpp>
37#include <com/sun/star/container/XEnumeration.hpp>
38#include <com/sun/star/container/XIndexAccess.hpp>
40#include <o3tl/deleter.hxx>
42#include <tools/wldcrd.hxx>
43
44class SbiInstance; // active StarBASIC process
45class SbiRuntime; // active StarBASIC procedure instance
46
47struct SbiArgv; // Argv stack element
48struct SbiGosub; // GOSUB stack element
49class SbiImage; // Code-Image
50class SbiIoSystem;
51class SbiDdeControl;
52class SbiDllMgr;
53class SvNumberFormatter; // time/date functions
54enum class SbiImageFlags;
55
56enum class ForType {
57 To,
62 Error,
63};
64
65struct SbiForStack { // for/next stack:
66 SbiForStack* pNext; // Chain
67 SbxVariableRef refVar; // loop variable
68 SbxVariableRef refEnd; // end expression / for each: Array/BasicCollection object
69 SbxVariableRef refInc; // increment expression
70
71 // For each support
74 std::unique_ptr<sal_Int32[]>
76 std::unique_ptr<sal_Int32[]>
78 std::unique_ptr<sal_Int32[]>
80 css::uno::Reference< css::container::XEnumeration > xEnumeration;
81 css::uno::Reference<css::container::XIndexAccess> xIndexAccess;
82
84 : pNext(nullptr)
87 {}
88};
89
90#define MAXRECURSION 500 //to prevent dead-recursions
91
92enum class SbAttributes {
93 NONE = 0x0000,
94 READONLY = 0x0001,
95 HIDDEN = 0x0002,
96 DIRECTORY = 0x0010
97};
98
99namespace o3tl
100{
101 template<> struct typed_flags<SbAttributes> : is_typed_flags<SbAttributes, 0x13> {};
102}
103
105{
106public:
107
108 std::unique_ptr<osl::Directory> pDir;
111
113 std::optional<WildCard> moWildCard;
114
115 css::uno::Sequence< OUString > aDirSeq;
116
117 SbiRTLData();
118 ~SbiRTLData();
119};
120
121// The instance matches a running StarBASIC. Many basics running at the same
122// time are managed by chained instances. There is all the data that only lives
123// when the BASIC is living too, like the I/O-system.
124
125typedef std::vector< css::uno::Reference< css::lang::XComponent > > ComponentVector_t;
126
127
129{
130 friend class SbiRuntime;
131
133
134 // file system
135 std::unique_ptr<SbiIoSystem, o3tl::default_delete<SbiIoSystem>> pIosys;
136 // DDE
137 std::unique_ptr<SbiDdeControl> pDdeCtrl;
138 // DLL-Calls (DECLARE)
139 std::unique_ptr<SbiDllMgr> pDllMgr;
140 std::shared_ptr<SvNumberFormatter> pNumberFormatter;
145
147 OUString aErrorMsg; // last error message for $ARG
148 sal_Int32 nErl; // current error line
149 bool bReschedule; // Flag: sal_True = Reschedule in main loop
150 bool bCompatibility; // Flag: sal_True = VBA runtime compatibility mode
151
153public:
154 SbiRuntime* pRun; // Call-Stack
155
156 // #31460 new concept for StepInto/Over/Out,
157 // explanation see runtime.cxx at SbiInstance::CalcBreakCallLevel()
158 sal_uInt16 nCallLvl;
159 sal_uInt16 nBreakCallLvl;
161
163 ~SbiInstance();
164
165 void Error( ErrCode ); // trappable Error
166 void Error( ErrCode, const OUString& rMsg ); // trappable Error with message
167 void ErrorVB( sal_Int32 nVBNumber, const OUString& rMsg );
168 void setErrorVB( sal_Int32 nVBNumber );
169 void FatalError( ErrCode ); // non-trappable Error
170 void FatalError( ErrCode, const OUString& ); // non-trappable Error
171 void Abort(); // with current error code
172
173 void Stop();
174 ErrCode const & GetErr() const { return nErr; }
175 const OUString& GetErrorMsg() const { return aErrorMsg; }
176 sal_Int32 GetErl() const { return nErl; }
177 void EnableReschedule( bool bEnable ) { bReschedule = bEnable; }
178 bool IsReschedule() const { return bReschedule; }
179 void EnableCompatibility( bool bEnable ) { bCompatibility = bEnable; }
180 bool IsCompatibility() const { return bCompatibility; }
181
183
184 SbMethod* GetCaller( sal_uInt16 );
186
187 SbiIoSystem* GetIoSystem() { return pIosys.get(); }
189 StarBASIC* GetBasic() { return pBasic; }
192
193 std::shared_ptr<SvNumberFormatter> const & GetNumberFormatter();
194 sal_uInt32 GetStdDateIdx() const { return nStdDateIdx; }
195 sal_uInt32 GetStdTimeIdx() const { return nStdTimeIdx; }
196 sal_uInt32 GetStdDateTimeIdx() const { return nStdDateTimeIdx; }
197
198 // offer NumberFormatter also static
199 static std::shared_ptr<SvNumberFormatter> PrepareNumberFormatter( sal_uInt32 &rnStdDateIdx,
200 sal_uInt32 &rnStdTimeIdx, sal_uInt32 &rnStdDateTimeIdx,
201 LanguageType const * peFormatterLangType=nullptr, DateOrder const * peFormatterDateOrder=nullptr );
202};
203
204// There's one instance of this class for every executed sub-program.
205// This instance is the heart of the BASIC-machine and contains only local data.
206
208{
209 friend void SbRtl_CallByName( StarBASIC* pBasic, SbxArray& rPar, bool bWrite );
210
211 typedef void( SbiRuntime::*pStep0 )();
212 typedef void( SbiRuntime::*pStep1 )( sal_uInt32 nOp1 );
213 typedef void( SbiRuntime::*pStep2 )( sal_uInt32 nOp1, sal_uInt32 nOp2 );
214 static const pStep0 aStep0[]; // opcode-table group 0
215 static const pStep1 aStep1[];
216 static const pStep2 aStep2[];
217
218 StarBASIC& rBasic; // StarBASIC instance
219 SbiInstance* pInst; // current thread
220 SbModule* pMod; // current module
221 SbMethod* pMeth; // method instance
222 SbiIoSystem* pIosys; // I/O-System
223 const SbiImage* pImg; // Code-Image
224 SbxArrayRef refExprStk; // expression stack
225 SbxArrayRef refCaseStk; // CASE expression stack
226 SbxArrayRef refRedimpArray; // Array saved to use for REDIM PRESERVE
227 SbxVariableRef refRedim; // Array saved to use for REDIM
228 SbxVariableRef xDummyVar; // substitute for variables that weren't found
229 SbxVariable* mpExtCaller = nullptr; // Caller ( external - e.g. button name, shape, range object etc. - only in vba mode )
230 SbiForStack* pForStk = nullptr; // FOR/NEXT-Stack
231 sal_uInt16 nExprLvl = 0; // depth of the expr-stack
232 sal_uInt16 nForLvl = 0; // #118235: Maintain for level
233 const sal_uInt8* pCode; // current Code-Pointer
234 const sal_uInt8* pStmnt; // beginning of the last statement
235 const sal_uInt8* pError = nullptr; // address of the current error handler
236 const sal_uInt8* pRestart = nullptr; // restart-address
237 const sal_uInt8* pErrCode = nullptr; // restart-address RESUME NEXT
238 const sal_uInt8* pErrStmnt = nullptr; // restart-address RESUME 0
239 OUString aLibName; // Lib-name for declare-call
240 SbxArrayRef refParams; // current procedure parameters
241 SbxArrayRef refLocals; // local variable
243 // #74254, one refSaveObj is not enough! new: pRefSaveList (see above)
244 short nArgc = 0;
245 bool bRun = true;
246 bool bError = true; // true: handle errors
247 bool bInError = false; // true: in an error handler
248 bool bBlocked = false; // true: blocked by next call level, #i48868
250 BasicDebugFlags nFlags; // Debugging-Flags
252 sal_uInt16 nOps = 0; // opcode counter
253
254 std::vector<SbxVariableRef> aRefSaved; // #74254 save temporary references
255 std::vector<SbiGosub> pGosubStk; // GOSUB stack
256 std::vector<SbiArgv> pArgvStk; // ARGV-Stack
257
258
260 ( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, ErrCode, bool bLocal, bool bStatic = false );
261 void SetupArgs( SbxVariable*, sal_uInt32 );
263
264 void PushVar( SbxVariable* );
267 void TOSMakeTemp();
268 void ClearExprStack();
269
270 void PushGosub( const sal_uInt8* );
271 void PopGosub();
272
273 void PushArgv();
274 void PopArgv();
275 void ClearArgvStack();
276
277 void PushFor();
278 void PushForEach();
279 void PopFor();
280 void ClearForStack();
281
282 void StepArith( SbxOperator );
283 void StepUnary( SbxOperator );
284 void StepCompare( SbxOperator );
285
286 void SetParameters( SbxArray* );
287
288 // HAS TO BE IMPLEMENTED SOME TIME
289 void DllCall( std::u16string_view, std::u16string_view, SbxArray*, SbxDataType, bool );
290
291 // #56204 swap out DIM-functionality into help method (step0.cxx)
292 void DimImpl(const SbxVariableRef& refVar);
294
295 static bool implIsClass( SbxObject const * pObj, const OUString& aClass );
296
297 void StepSETCLASS_impl( sal_uInt32 nOp1, bool bHandleDflt );
298
299 // the following routines are called by the single
300 // stepper and implement the single opcodes
301 void StepNOP(), StepEXP(), StepMUL(), StepDIV();
302 void StepMOD(), StepPLUS(), StepMINUS(), StepNEG();
303 void StepEQ(), StepNE(), StepLT(), StepGT();
304 void StepLE(), StepGE(), StepIDIV(), StepAND();
305 void StepOR(), StepXOR(), StepEQV(), StepIMP();
306 void StepNOT(), StepCAT(), StepLIKE(), StepIS();
307 void StepARGC();
308 void StepARGV(), StepINPUT(), StepLINPUT(), StepSTOP();
309 void StepGET(), StepSET(), StepVBASET(), StepPUT(), StepPUTC();
310 void StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, bool bDefaultHandling = false );
311 void StepDIM(), StepREDIM(), StepREDIMP(), StepERASE();
313 void StepCASE(), StepENDCASE(), StepSTDERROR();
316 void StepRESTART(), StepEMPTY(), StepLEAVE();
318 void StepARRAYACCESS(), StepBYVAL();
319 // all opcodes with one operand
320 void StepLOADNC( sal_uInt32 ), StepLOADSC( sal_uInt32 ), StepLOADI( sal_uInt32 );
321 void StepARGN( sal_uInt32 ), StepBASED( sal_uInt32 ), StepPAD( sal_uInt32 );
322 void StepJUMP( sal_uInt32 ), StepJUMPT( sal_uInt32 );
323 void StepJUMPF( sal_uInt32 ), StepONJUMP( sal_uInt32 );
324 void StepGOSUB( sal_uInt32 ), StepRETURN( sal_uInt32 );
325 void StepTESTFOR( sal_uInt32 ), StepCASETO( sal_uInt32 ), StepERRHDL( sal_uInt32 );
326 void StepRESUME( sal_uInt32 ), StepSETCLASS( sal_uInt32 ), StepVBASETCLASS( sal_uInt32 ), StepTESTCLASS( sal_uInt32 ), StepLIB( sal_uInt32 );
327 bool checkClass_Impl( const SbxVariableRef& refVal, const OUString& aClass, bool bRaiseErrors, bool bDefault );
328 void StepCLOSE( sal_uInt32 ), StepPRCHAR( sal_uInt32 ), StepARGTYP( sal_uInt32 );
329 // all opcodes with two operands
330 void StepRTL( sal_uInt32, sal_uInt32 ), StepPUBLIC( sal_uInt32, sal_uInt32 ), StepPUBLIC_P( sal_uInt32, sal_uInt32 );
331 void StepPUBLIC_Impl( sal_uInt32, sal_uInt32, bool bUsedForClassModule );
332 void StepFIND_Impl( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, ErrCode, bool bStatic = false );
333 void StepFIND( sal_uInt32, sal_uInt32 ), StepELEM( sal_uInt32, sal_uInt32 );
334 void StepGLOBAL( sal_uInt32, sal_uInt32 ), StepLOCAL( sal_uInt32, sal_uInt32 );
335 void StepPARAM( sal_uInt32, sal_uInt32), StepCREATE( sal_uInt32, sal_uInt32 );
336 void StepCALL( sal_uInt32, sal_uInt32 ), StepCALLC( sal_uInt32, sal_uInt32 );
337 void StepCASEIS( sal_uInt32, sal_uInt32 ), StepSTMNT( sal_uInt32, sal_uInt32 );
339 OUString const & aName, SbxDataType t, sal_uInt32 nOp2 );
340 void StepOPEN( sal_uInt32, sal_uInt32 ), StepSTATIC( sal_uInt32, sal_uInt32 );
341 void StepTCREATE(sal_uInt32,sal_uInt32), StepDCREATE(sal_uInt32,sal_uInt32);
342 void StepGLOBAL_P( sal_uInt32, sal_uInt32 ),StepFIND_G( sal_uInt32, sal_uInt32 );
343 void StepDCREATE_REDIMP(sal_uInt32,sal_uInt32), StepDCREATE_IMPL(sal_uInt32,sal_uInt32);
344 void StepFIND_CM( sal_uInt32, sal_uInt32 );
345 void StepFIND_STATIC( sal_uInt32, sal_uInt32 );
346 static void implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, sal_uInt32 nOp2 );
347public:
348 void SetVBAEnabled( bool bEnabled );
349 bool IsImageFlag( SbiImageFlags n ) const;
350 sal_uInt16 GetBase() const;
351 sal_Int32 nLine = 0, nCol1 = 0, nCol2 = 0;
352 SbiRuntime* pNext = nullptr; // Stack-Chain
353
354 // tdf#79426, tdf#125180 - adds the information about a missing parameter
355 static void SetIsMissing( SbxVariable* );
356 // tdf#79426, tdf#125180 - checks if a variable contains the information about a missing parameter
357 static bool IsMissing( SbxVariable*, sal_uInt16 );
358
359 SbiRuntime( SbModule*, SbMethod*, sal_uInt32 );
360 ~SbiRuntime();
361 void Error( ErrCode, bool bVBATranslationAlreadyDone = false ); // set error if != 0
362 void Error( ErrCode, const OUString& ); // set error if != 0
363 void FatalError( ErrCode ); // error handling = standard, set error
364 void FatalError( ErrCode, const OUString& ); // error handling = standard, set error
365 static sal_Int32 translateErrorToVba( ErrCode nError, OUString& rMsg );
366 bool Step(); // single step (one opcode)
367 void Stop() { bRun = false; }
368 void block() { bBlocked = true; }
369 void unblock() { bBlocked = false; }
370 SbModule* GetModule() { return pMod; }
372 void SetDebugFlags( BasicDebugFlags nFl ) { nFlags = nFl; }
375
376 SbiForStack* FindForStackItemForCollection( class BasicCollection const * pCollection );
377
378 SbxBase* FindElementExtern( const OUString& rName );
379 static bool isVBAEnabled();
380
381};
382
383inline void checkArithmeticOverflow( double d )
384{
385 if( !std::isfinite( d ) )
387}
388
389inline void checkArithmeticOverflow( SbxVariable const * pVar )
390{
391 if( pVar->GetType() == SbxDOUBLE )
392 {
393 double d = pVar->GetDouble();
395 }
396}
397
398
400
401// Returns true if UNO is available, otherwise the old
402// file system implementation has to be used
403// (Implemented in iosys.cxx)
404bool hasUno();
405
406// Converts possibly relative paths to absolute paths
407// according to the setting done by ChDir/ChDrive
408// (Implemented in methods.cxx)
409OUString getFullPath( const OUString& aRelPath );
410
411// Implementation of StepRENAME with UCB
412// (Implemented in methods.cxx, so step0.cxx
413// has not to be infected with UNO)
414void implStepRenameUCB( const OUString& aSource, const OUString& aDest );
415
416void implStepRenameOSL( const OUString& aSource, const OUString& aDest );
418
420
421/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
double d
sal_uInt16 nBreakCallLvl
Definition: runtime.hxx:159
std::shared_ptr< SvNumberFormatter > pNumberFormatter
Definition: runtime.hxx:140
sal_uInt16 nCallLvl
Definition: runtime.hxx:158
void Error(ErrCode)
Definition: runtime.cxx:490
void Stop()
Definition: runtime.cxx:474
const OUString & GetErrorMsg() const
Definition: runtime.hxx:175
sal_uInt32 GetStdDateTimeIdx() const
Definition: runtime.hxx:196
sal_Int32 nErl
Definition: runtime.hxx:148
SbiRTLData & GetRTLData()
Definition: runtime.hxx:191
void CalcBreakCallLevel(BasicDebugFlags nFlags)
Definition: runtime.cxx:304
SbiIoSystem * GetIoSystem()
Definition: runtime.hxx:187
void FatalError(ErrCode)
Definition: runtime.cxx:534
SbiRuntime * pRun
Definition: runtime.hxx:154
bool IsReschedule() const
Definition: runtime.hxx:178
SbModule * GetActiveModule()
Definition: runtime.cxx:565
bool IsCompatibility() const
Definition: runtime.hxx:180
void ErrorVB(sal_Int32 nVBNumber, const OUString &rMsg)
Definition: runtime.cxx:504
sal_uInt32 nStdDateTimeIdx
Definition: runtime.hxx:144
static std::shared_ptr< SvNumberFormatter > PrepareNumberFormatter(sal_uInt32 &rnStdDateIdx, sal_uInt32 &rnStdTimeIdx, sal_uInt32 &rnStdDateTimeIdx, LanguageType const *peFormatterLangType=nullptr, DateOrder const *peFormatterDateOrder=nullptr)
Definition: runtime.cxx:404
SbiRTLData aRTLData
Definition: runtime.hxx:132
SbiInstance(StarBASIC *)
Definition: runtime.cxx:323
sal_uInt32 GetStdTimeIdx() const
Definition: runtime.hxx:195
std::unique_ptr< SbiDllMgr > pDllMgr
Definition: runtime.hxx:139
OUString aErrorMsg
Definition: runtime.hxx:147
std::shared_ptr< SvNumberFormatter > const & GetNumberFormatter()
Definition: runtime.cxx:380
std::unique_ptr< SbiIoSystem, o3tl::default_delete< SbiIoSystem > > pIosys
Definition: runtime.hxx:135
LanguageType meFormatterLangType
Definition: runtime.hxx:142
sal_Int32 GetErl() const
Definition: runtime.hxx:176
ComponentVector_t ComponentVector
Definition: runtime.hxx:152
void Abort()
Definition: runtime.cxx:544
SbiDllMgr * GetDllMgr()
Definition: runtime.cxx:370
void EnableReschedule(bool bEnable)
Definition: runtime.hxx:177
bool bReschedule
Definition: runtime.hxx:149
DateOrder meFormatterDateOrder
Definition: runtime.hxx:143
sal_uInt32 GetStdDateIdx() const
Definition: runtime.hxx:194
SbiDdeControl * GetDdeControl()
Definition: runtime.hxx:188
sal_uInt32 nStdDateIdx
Definition: runtime.hxx:144
void EnableCompatibility(bool bEnable)
Definition: runtime.hxx:179
ComponentVector_t & getComponentVector()
Definition: runtime.hxx:182
void setErrorVB(sal_Int32 nVBNumber)
Definition: runtime.cxx:520
bool bCompatibility
Definition: runtime.hxx:150
StarBASIC * pBasic
Definition: runtime.hxx:141
StarBASIC * GetBasic()
Definition: runtime.hxx:189
sal_uInt32 nStdTimeIdx
Definition: runtime.hxx:144
ErrCode nErr
Definition: runtime.hxx:146
std::unique_ptr< SbiDdeControl > pDdeCtrl
Definition: runtime.hxx:137
ErrCode const & GetErr() const
Definition: runtime.hxx:174
SbMethod * GetCaller(sal_uInt16)
Definition: runtime.cxx:577
SbAttributes nDirFlags
Definition: runtime.hxx:109
short nCurDirPos
Definition: runtime.hxx:110
std::unique_ptr< osl::Directory > pDir
Definition: runtime.hxx:108
std::optional< WildCard > moWildCard
Definition: runtime.hxx:113
OUString sFullNameToBeChecked
Definition: runtime.hxx:112
css::uno::Sequence< OUString > aDirSeq
Definition: runtime.hxx:115
void FatalError(ErrCode)
Definition: runtime.cxx:952
void StepPRCHAR(sal_uInt32)
Definition: runtime.cxx:3324
void(SbiRuntime::* pStep0)()
Definition: runtime.hxx:211
void StepSTOP()
Definition: runtime.cxx:2597
void StepENDCASE()
Definition: runtime.cxx:2649
SbiInstance * pInst
Definition: runtime.hxx:219
void StepPRINTF()
Definition: runtime.cxx:2721
void StepGLOBAL_P(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4705
void StepSET()
Definition: runtime.cxx:2024
void StepARGC()
Definition: runtime.cxx:2439
void SetupArgs(SbxVariable *, sal_uInt32)
Definition: runtime.cxx:3805
SbxVariable * CheckArray(SbxVariable *)
Definition: runtime.cxx:3944
void StepPUT()
Definition: runtime.cxx:1692
std::vector< SbiArgv > pArgvStk
Definition: runtime.hxx:256
friend void SbRtl_CallByName(StarBASIC *pBasic, SbxArray &rPar, bool bWrite)
void StepDIM()
Definition: runtime.cxx:2129
void DllCall(std::u16string_view, std::u16string_view, SbxArray *, SbxDataType, bool)
Definition: runtime.cxx:1261
void PushForEach()
Definition: runtime.cxx:1140
void StepGLOBAL(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4662
void SetDebugFlags(BasicDebugFlags nFl)
Definition: runtime.hxx:372
void StepJUMP(sal_uInt32)
Definition: runtime.cxx:2991
void TOSMakeTemp()
Definition: runtime.cxx:1039
SbxVariableRef xDummyVar
Definition: runtime.hxx:228
static bool isVBAEnabled()
Definition: runtime.cxx:115
void PopFor()
Definition: runtime.cxx:1221
void PushFor()
Definition: runtime.cxx:1122
static sal_Int32 translateErrorToVba(ErrCode nError, OUString &rMsg)
Definition: runtime.cxx:964
void StepVBASETCLASS(sal_uInt32)
Definition: runtime.cxx:3431
SbMethod * pMeth
Definition: runtime.hxx:221
void StepERASE_CLEAR()
Definition: runtime.cxx:2406
void StepPRINT()
Definition: runtime.cxx:2707
bool bError
Definition: runtime.hxx:246
const sal_uInt8 * pError
Definition: runtime.hxx:235
void StepLE()
Definition: runtime.cxx:1432
SbiForStack * FindForStackItemForCollection(class BasicCollection const *pCollection)
Definition: runtime.cxx:1241
void StepREDIMP()
Definition: runtime.cxx:2296
void PopGosub()
Definition: runtime.cxx:1078
void StepIDIV()
Definition: runtime.cxx:1414
SbxBase * FindElementExtern(const OUString &rName)
Definition: runtime.cxx:3732
void StepCHANNEL0()
Definition: runtime.cxx:2702
sal_uInt16 nForLvl
Definition: runtime.hxx:232
bool EvaluateTopOfStackAsBool()
Definition: runtime.cxx:3002
SbxVariable * StepSTATIC_Impl(OUString const &aName, SbxDataType t, sal_uInt32 nOp2)
Definition: runtime.cxx:4737
void StepCAT()
Definition: runtime.cxx:1418
void StepLINPUT()
Definition: runtime.cxx:2586
sal_Int32 nLine
Definition: runtime.hxx:351
void StepCLOSE(sal_uInt32)
Definition: runtime.cxx:3305
sal_uInt16 nOps
Definition: runtime.hxx:252
void StepCASETO(sal_uInt32)
Definition: runtime.cxx:3246
void StepAND()
Definition: runtime.cxx:1419
void StepEMPTY()
Definition: runtime.cxx:2798
void StepPLUS()
Definition: runtime.cxx:1416
void StepREDIMP_ERASE()
Definition: runtime.cxx:2313
static void SetIsMissing(SbxVariable *)
Definition: runtime.cxx:627
void StepRENAME()
Definition: runtime.cxx:2763
sal_uInt16 GetBase() const
Definition: runtime.cxx:1282
static const pStep2 aStep2[]
Definition: runtime.hxx:216
void StepRSET()
Definition: runtime.cxx:2078
void StepNOP()
Definition: runtime.cxx:1287
void Stop()
Definition: runtime.hxx:367
void StepSTATIC(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4759
sal_Int32 nCol2
Definition: runtime.hxx:351
void StepDCREATE(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4472
void SetVBAEnabled(bool bEnabled)
Definition: runtime.cxx:610
void StepEXP()
Definition: runtime.cxx:1411
void StepFIND_G(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4717
void StepPUTC()
Definition: runtime.cxx:2116
StarBASIC & rBasic
Definition: runtime.hxx:218
void StepIMP()
Definition: runtime.cxx:1423
void StepARGTYP(sal_uInt32)
Definition: runtime.cxx:2924
SbxArrayRef refRedimpArray
Definition: runtime.hxx:226
void StepNE()
Definition: runtime.cxx:1429
void StepOR()
Definition: runtime.cxx:1420
void StepMINUS()
Definition: runtime.cxx:1417
void StepCREATE(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4452
void PopArgv()
Definition: runtime.cxx:1100
SbiForStack * pForStk
Definition: runtime.hxx:230
void SetParameters(SbxArray *)
Definition: runtime.cxx:644
void StepGOSUB(sal_uInt32)
Definition: runtime.cxx:3077
void StepLIB(sal_uInt32)
Definition: runtime.cxx:3455
void StepFIND_CM(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4144
void StepDCREATE_IMPL(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4483
BasicDebugFlags nFlags
Definition: runtime.hxx:250
void ClearArgvStack()
Definition: runtime.cxx:1111
void StepNEG()
Definition: runtime.cxx:1425
void StepARRAYACCESS()
Definition: runtime.cxx:2411
static void implHandleSbxFlags(SbxVariable *pVar, SbxDataType t, sal_uInt32 nOp2)
Definition: runtime.cxx:4565
void DimImpl(const SbxVariableRef &refVar)
Definition: runtime.cxx:2136
SbxArrayRef refArgv
Definition: runtime.hxx:242
sal_uInt16 nExprLvl
Definition: runtime.hxx:231
void StepLT()
Definition: runtime.cxx:1430
void StepINPUT()
Definition: runtime.cxx:2473
void StepMUL()
Definition: runtime.cxx:1412
void StepSETCLASS(sal_uInt32)
Definition: runtime.cxx:3436
BasicDebugFlags GetDebugFlags() const
Definition: runtime.hxx:371
void StepPUBLIC(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4644
void PushVar(SbxVariable *)
Definition: runtime.cxx:985
bool checkClass_Impl(const SbxVariableRef &refVal, const OUString &aClass, bool bRaiseErrors, bool bDefault)
Definition: runtime.cxx:3360
void StepCompare(SbxOperator)
Definition: runtime.cxx:1323
void StepTESTCLASS(sal_uInt32)
Definition: runtime.cxx:3441
void StepWRITE()
Definition: runtime.cxx:2736
void StepEQV()
Definition: runtime.cxx:1422
void unblock()
Definition: runtime.hxx:369
void StepNOERROR()
Definition: runtime.cxx:2672
void StepPUBLIC_Impl(sal_uInt32, sal_uInt32, bool bUsedForClassModule)
Definition: runtime.cxx:4614
void StepARGV()
Definition: runtime.cxx:2448
ErrCode nError
Definition: runtime.hxx:251
SbxArrayRef refLocals
Definition: runtime.hxx:241
const sal_uInt8 * pErrStmnt
Definition: runtime.hxx:238
void StepERROR()
Definition: runtime.cxx:2813
void StepINITFOR()
Definition: runtime.cxx:2603
bool Step()
Definition: runtime.cxx:764
bool bVBAEnabled
Definition: runtime.hxx:249
bool bBlocked
Definition: runtime.hxx:248
void StepFIND_STATIC(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4160
void StepCALLC(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4319
void StepCASE()
Definition: runtime.cxx:2637
void StepTESTFOR(sal_uInt32)
Definition: runtime.cxx:3096
static bool implIsClass(SbxObject const *pObj, const OUString &aClass)
Definition: runtime.cxx:3333
const sal_uInt8 * pCode
Definition: runtime.hxx:233
void StepDIV()
Definition: runtime.cxx:1413
void StepNEXT()
Definition: runtime.cxx:2615
void Error(ErrCode, bool bVBATranslationAlreadyDone=false)
Definition: runtime.cxx:913
void StepGE()
Definition: runtime.cxx:1433
void StepUnary(SbxOperator)
Definition: runtime.cxx:1310
void StepVBASET()
Definition: runtime.cxx:2031
void StepELEM(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4168
SbxVariable * mpExtCaller
Definition: runtime.hxx:229
void StepLOADNC(sal_uInt32)
Definition: runtime.cxx:2830
const SbiImage * pImg
Definition: runtime.hxx:223
void StepJUMPF(sal_uInt32)
Definition: runtime.cxx:3044
std::vector< SbxVariableRef > aRefSaved
Definition: runtime.hxx:254
static const pStep0 aStep0[]
Definition: runtime.hxx:214
void StepXOR()
Definition: runtime.cxx:1421
void StepFIND_Impl(SbxObject *pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, ErrCode, bool bStatic=false)
Definition: runtime.cxx:4127
OUString aLibName
Definition: runtime.hxx:239
void StepCASEIS(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4281
void StepPARAM(sal_uInt32, sal_uInt32)
Loading of a parameter (+offset+type) If the data type is wrong, create a copy and search for optiona...
Definition: runtime.cxx:4202
void StepBASED(sal_uInt32)
Definition: runtime.cxx:3464
static const pStep1 aStep1[]
Definition: runtime.hxx:215
void StepCALL(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4301
void StepFIND(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4138
void StepREDIM()
Definition: runtime.cxx:2201
void StepSTMNT(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4338
SbiRuntime * pNext
Definition: runtime.hxx:352
void PushGosub(const sal_uInt8 *)
Definition: runtime.cxx:1069
SbxVariableRef refRedim
Definition: runtime.hxx:227
void StepEQ()
Definition: runtime.cxx:1428
void StepRETURN(sal_uInt32)
Definition: runtime.cxx:3087
void StepSET_Impl(SbxVariableRef &refVal, SbxVariableRef &refVar, bool bDefaultHandling=false)
Definition: runtime.cxx:1805
void StepArith(SbxOperator)
Definition: runtime.cxx:1290
const sal_uInt8 * pStmnt
Definition: runtime.hxx:234
void StepRESTART()
Definition: runtime.cxx:2791
SbxVariableRef PopVar()
Definition: runtime.cxx:993
void PushArgv()
Definition: runtime.cxx:1093
void StepMOD()
Definition: runtime.cxx:1415
bool IsImageFlag(SbiImageFlags n) const
Definition: runtime.cxx:1277
SbiRuntime(SbModule *, SbMethod *, sal_uInt32)
Definition: runtime.cxx:591
void StepCHANNEL()
Definition: runtime.cxx:2694
SbxArrayRef refExprStk
Definition: runtime.hxx:224
void StepLOADI(sal_uInt32)
Definition: runtime.cxx:2888
void StepGET()
Definition: runtime.cxx:1606
void StepERRHDL(sal_uInt32)
Definition: runtime.cxx:3261
void StepERASE()
Definition: runtime.cxx:2400
void StepIS()
Definition: runtime.cxx:1575
void StepINITFOREACH()
Definition: runtime.cxx:2608
void StepJUMPT(sal_uInt32)
Definition: runtime.cxx:3034
const sal_uInt8 * pRestart
Definition: runtime.hxx:236
bool bInError
Definition: runtime.hxx:247
SbxArrayRef refParams
Definition: runtime.hxx:240
static bool IsMissing(SbxVariable *, sal_uInt16)
Definition: runtime.cxx:635
SbModule * GetModule()
Definition: runtime.hxx:370
void StepONJUMP(sal_uInt32)
Definition: runtime.cxx:3060
bool bRun
Definition: runtime.hxx:245
short nArgc
Definition: runtime.hxx:244
void StepRESUME(sal_uInt32)
Definition: runtime.cxx:3276
SbxArrayRef refCaseStk
Definition: runtime.hxx:225
const sal_uInt8 * pErrCode
Definition: runtime.hxx:237
void StepSETCLASS_impl(sal_uInt32 nOp1, bool bHandleDflt)
Definition: runtime.cxx:3418
void StepARGN(sal_uInt32)
Definition: runtime.cxx:2897
SbiIoSystem * pIosys
Definition: runtime.hxx:222
SbModule * pMod
Definition: runtime.hxx:220
void(SbiRuntime::* pStep1)(sal_uInt32 nOp1)
Definition: runtime.hxx:212
void StepLEAVE()
Definition: runtime.cxx:2684
void StepRTL(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4122
void StepLOADSC(sal_uInt32)
Definition: runtime.cxx:2878
void StepLOCAL(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4595
std::vector< SbiGosub > pGosubStk
Definition: runtime.hxx:255
void StepPUBLIC_P(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4649
SbMethod * GetCaller()
Definition: runtime.hxx:373
void StepLSET()
Definition: runtime.cxx:2040
void StepPROMPT()
Definition: runtime.cxx:2782
void ClearExprStack()
Definition: runtime.cxx:1012
void StepPAD(sal_uInt32)
Definition: runtime.cxx:2969
void StepGT()
Definition: runtime.cxx:1431
void StepLIKE()
Definition: runtime.cxx:1539
void StepSTDERROR()
Definition: runtime.cxx:2662
void block()
Definition: runtime.hxx:368
void StepOPEN(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4437
void ClearForStack()
Definition: runtime.cxx:1233
void StepTCREATE(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4549
sal_Int32 nCol1
Definition: runtime.hxx:351
void StepDCREATE_REDIMP(sal_uInt32, sal_uInt32)
Definition: runtime.cxx:4477
SbxVariable * GetTOS()
Definition: runtime.cxx:1025
SbxVariable * GetExternalCaller()
Definition: runtime.hxx:374
void(SbiRuntime::* pStep2)(sal_uInt32 nOp1, sal_uInt32 nOp2)
Definition: runtime.hxx:213
void StepNOT()
Definition: runtime.cxx:1426
SbxVariable * FindElement(SbxObject *pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, ErrCode, bool bLocal, bool bStatic=false)
Definition: runtime.cxx:3488
void StepBYVAL()
Definition: runtime.cxx:2423
Definition: sbx.hxx:95
double GetDouble() const
Definition: sbxvar.hxx:150
virtual SbxDataType GetType() const override
Definition: sbxvar.cxx:321
static void Error(ErrCode, const OUString &rMsg={})
Definition: sb.cxx:1683
const bool READONLY
#define ERRCODE_NONE
SbiImageFlags
Definition: image.hxx:33
DateOrder
HIDDEN
NONE
Error
OUString getFullPath(const OUString &aRelPath)
void removeDimAsNewRecoverItem(SbxVariable *pVar)
Definition: runtime.cxx:1790
bool hasUno()
Definition: iosys.cxx:133
void implStepRenameUCB(const OUString &aSource, const OUString &aDest)
ForType
Definition: runtime.hxx:56
@ EachCollection
@ EachXIndexAccess
@ EachXEnumeration
void implStepRenameOSL(const OUString &aSource, const OUString &aDest)
bool IsBaseIndexOne()
StarBASIC * GetCurrentBasic(StarBASIC *pRTBasic)
Definition: runtime.cxx:552
SbAttributes
Definition: runtime.hxx:92
void checkArithmeticOverflow(double d)
Definition: runtime.hxx:383
std::vector< css::uno::Reference< css::lang::XComponent > > ComponentVector_t
Definition: runtime.hxx:125
BasicDebugFlags
Definition: sbdef.hxx:46
#define ERRCODE_BASIC_MATH_OVERFLOW
Definition: sberrors.hxx:27
SbxOperator
Definition: sbxdef.hxx:92
SbxDataType
Definition: sbxdef.hxx:37
@ SbxDOUBLE
Definition: sbxdef.hxx:43
std::unique_ptr< sal_Int32[]> pArrayCurIndices
Definition: runtime.hxx:75
SbxVariableRef refVar
Definition: runtime.hxx:67
sal_Int32 nCurCollectionIndex
Definition: runtime.hxx:73
SbxVariableRef refInc
Definition: runtime.hxx:69
ForType eForType
Definition: runtime.hxx:72
SbiForStack * pNext
Definition: runtime.hxx:66
std::unique_ptr< sal_Int32[]> pArrayUpperBounds
Definition: runtime.hxx:79
css::uno::Reference< css::container::XIndexAccess > xIndexAccess
Definition: runtime.hxx:81
SbxVariableRef refEnd
Definition: runtime.hxx:68
std::unique_ptr< sal_Int32[]> pArrayLowerBounds
Definition: runtime.hxx:77
css::uno::Reference< css::container::XEnumeration > xEnumeration
Definition: runtime.hxx:80
unsigned char sal_uInt8