Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / basic / source / runtime / stdobj.cxx
blob234deed57ea0b9d145273ac66c1cac35ebd8dc11
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <runtime.hxx>
22 #include <stdobj.hxx>
23 #include <sbstdobj.hxx>
24 #include <rtlproto.hxx>
25 #include <sbintern.hxx>
26 // The nArgs-field of a table entry is encrypted as follows:
27 // At the moment it is assumed that properties don't need any
28 // parameters!
30 // previously ARGSMASK_ was 0x007F ( e.g. up to 127 args ) however 63 should be
31 // enough, if not we need to increase the size of nArgs member in the Methods
32 // struct below.
33 // note: the limitation of 63 args is only for RTL functions defined here and
34 // does NOT impose a limit on User defined procedures ). This changes is to
35 // allow us space for a flag to blacklist some functions in vba mode
37 #define ARGSMASK_ 0x003F // 63 Arguments
38 #define COMPTMASK_ 0x00C0 // COMPATIBILITY mask
39 #define COMPATONLY_ 0x0080 // procedure is visible in vba mode only
40 #define NORMONLY_ 0x0040 // procedure is visible in normal mode only
42 #define RWMASK_ 0x0F00 // mask for R/W-bits
43 #define TYPEMASK_ 0xF000 // mask for the entry's type
45 #define OPT_ 0x0400 // parameter is optional
46 #define CONST_ 0x0800 // property is const
47 #define METHOD_ 0x3000
48 #define PROPERTY_ 0x4000
49 #define OBJECT_ 0x8000
50 // combination of bits above:
51 #define FUNCTION_ 0x1100
52 #define LFUNCTION_ 0x1300 // mask for function which also works as Lvalue
53 #define SUB_ 0x2100
54 #define ROPROP_ 0x4100 // mask Read Only-Property
55 #define RWPROP_ 0x4300 // mask Read/Write-Property
56 #define CPROP_ 0x4900 // mask for constant
58 struct Methods {
59 const char* pName;
60 SbxDataType eType;
61 short nArgs;
62 RtlCall pFunc;
63 sal_uInt16 nHash;
66 static Methods aMethods[] = {
68 { "Abs", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Abs),0 },
69 { "number", SbxDOUBLE, 0,nullptr,0 },
70 { "Array", SbxOBJECT, FUNCTION_, RTLNAME(Array),0 },
71 { "Asc", SbxLONG, 1 | FUNCTION_, RTLNAME(Asc),0 },
72 { "string", SbxSTRING, 0,nullptr,0 },
73 { "AscW", SbxLONG, 1 | FUNCTION_ | COMPATONLY_, RTLNAME(Asc),0},
74 { "string", SbxSTRING, 0,nullptr,0 },
75 { "Atn", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Atn),0 },
76 { "number", SbxDOUBLE, 0,nullptr,0 },
77 { "ATTR_ARCHIVE", SbxINTEGER, CPROP_, RTLNAME(ATTR_ARCHIVE),0 },
78 { "ATTR_DIRECTORY", SbxINTEGER, CPROP_, RTLNAME(ATTR_DIRECTORY),0 },
79 { "ATTR_HIDDEN", SbxINTEGER, CPROP_, RTLNAME(ATTR_HIDDEN),0 },
80 { "ATTR_NORMAL", SbxINTEGER, CPROP_, RTLNAME(ATTR_NORMAL),0 },
81 { "ATTR_READONLY", SbxINTEGER, CPROP_, RTLNAME(ATTR_READONLY),0 },
82 { "ATTR_SYSTEM", SbxINTEGER, CPROP_, RTLNAME(ATTR_SYSTEM),0 },
83 { "ATTR_VOLUME", SbxINTEGER, CPROP_, RTLNAME(ATTR_VOLUME),0 },
85 { "Beep", SbxNULL, FUNCTION_, RTLNAME(Beep),0 },
86 { "Blue", SbxINTEGER, 1 | FUNCTION_ | NORMONLY_, RTLNAME(Blue),0 },
87 { "RGB-Value", SbxLONG, 0,nullptr,0 },
89 { "CallByName", SbxVARIANT, 3 | FUNCTION_, RTLNAME(CallByName),0 },
90 { "Object", SbxOBJECT, 0,nullptr,0 },
91 { "ProcedureName",SbxSTRING, 0,nullptr,0 },
92 { "CallType", SbxINTEGER, 0,nullptr,0 },
93 { "CBool", SbxBOOL, 1 | FUNCTION_, RTLNAME(CBool),0 },
94 { "expression", SbxVARIANT, 0,nullptr,0 },
95 { "CByte", SbxBYTE, 1 | FUNCTION_, RTLNAME(CByte),0 },
96 { "expression", SbxVARIANT, 0,nullptr,0 },
97 { "CCur", SbxCURRENCY, 1 | FUNCTION_, RTLNAME(CCur),0 },
98 { "expression", SbxVARIANT, 0,nullptr,0 },
99 { "CDate", SbxDATE, 1 | FUNCTION_, RTLNAME(CDate),0 },
100 { "expression", SbxVARIANT, 0,nullptr,0 },
101 { "CDateFromUnoDate", SbxDATE, 1 | FUNCTION_, RTLNAME(CDateFromUnoDate),0 },
102 { "UnoDate", SbxOBJECT, 0,nullptr,0 },
103 { "CDateToUnoDate", SbxOBJECT, 1 | FUNCTION_, RTLNAME(CDateToUnoDate),0 },
104 { "Date", SbxDATE, 0,nullptr,0 },
105 { "CDateFromUnoTime", SbxDATE, 1 | FUNCTION_, RTLNAME(CDateFromUnoTime),0 },
106 { "UnoTime", SbxOBJECT, 0,nullptr,0 },
107 { "CDateToUnoTime", SbxOBJECT, 1 | FUNCTION_, RTLNAME(CDateToUnoTime),0 },
108 { "Time", SbxDATE, 0,nullptr,0 },
109 { "CDateFromUnoDateTime", SbxDATE, 1 | FUNCTION_, RTLNAME(CDateFromUnoDateTime),0 },
110 { "UnoDateTime", SbxOBJECT, 0,nullptr,0 },
111 { "CDateToUnoDateTime", SbxOBJECT, 1 | FUNCTION_, RTLNAME(CDateToUnoDateTime),0 },
112 { "DateTime", SbxDATE, 0,nullptr,0 },
113 { "CDateFromIso", SbxDATE, 1 | FUNCTION_, RTLNAME(CDateFromIso),0 },
114 { "IsoDate", SbxSTRING, 0,nullptr,0 },
115 { "CDateToIso", SbxSTRING, 1 | FUNCTION_, RTLNAME(CDateToIso),0 },
116 { "Date", SbxDATE, 0,nullptr,0 },
117 { "CDec", SbxDECIMAL, 1 | FUNCTION_, RTLNAME(CDec),0 },
118 { "expression", SbxVARIANT, 0,nullptr,0 },
119 { "CDbl", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(CDbl),0 },
120 { "expression", SbxVARIANT, 0,nullptr,0 },
121 { "CF_BITMAP", SbxINTEGER, CPROP_, RTLNAME(CF_BITMAP),0 },
122 { "CF_METAFILEPICT",SbxINTEGER, CPROP_, RTLNAME(CF_METAFILEPICT),0 },
123 { "CF_TEXT", SbxINTEGER, CPROP_, RTLNAME(CF_TEXT),0 },
124 { "ChDir", SbxNULL, 1 | FUNCTION_, RTLNAME(ChDir),0 },
125 { "string", SbxSTRING, 0,nullptr,0 },
126 { "ChDrive", SbxNULL, 1 | FUNCTION_, RTLNAME(ChDrive),0 },
127 { "string", SbxSTRING, 0,nullptr,0 },
129 { "Choose", SbxVARIANT, 2 | FUNCTION_, RTLNAME(Choose),0 },
130 { "Index", SbxINTEGER, 0,nullptr,0 },
131 { "Expression", SbxVARIANT, 0,nullptr,0 },
133 { "Chr", SbxSTRING, 1 | FUNCTION_, RTLNAME(Chr),0 },
134 { "string", SbxINTEGER, 0,nullptr,0 },
135 { "ChrW", SbxSTRING, 1 | FUNCTION_ | COMPATONLY_, RTLNAME(ChrW),0},
136 { "string", SbxINTEGER, 0,nullptr,0 },
138 { "CInt", SbxINTEGER, 1 | FUNCTION_, RTLNAME(CInt),0 },
139 { "expression", SbxVARIANT, 0,nullptr,0 },
140 { "CLEAR_ALLTABS", SbxINTEGER, CPROP_, RTLNAME(CLEAR_ALLTABS),0 },
141 { "CLEAR_TAB", SbxINTEGER, CPROP_, RTLNAME(CLEAR_TAB),0 },
142 { "CLng", SbxLONG, 1 | FUNCTION_, RTLNAME(CLng),0 },
143 { "expression", SbxVARIANT, 0,nullptr,0 },
144 { "CompatibilityMode", SbxBOOL, 1 | FUNCTION_, RTLNAME(CompatibilityMode),0},
145 { "bEnable", SbxBOOL, 0,nullptr,0 },
146 { "ConvertFromUrl", SbxSTRING, 1 | FUNCTION_, RTLNAME(ConvertFromUrl),0 },
147 { "Url", SbxSTRING, 0,nullptr,0 },
148 { "ConvertToUrl", SbxSTRING, 1 | FUNCTION_, RTLNAME(ConvertToUrl),0 },
149 { "SystemPath", SbxSTRING, 0,nullptr,0 },
150 { "Cos", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Cos),0 },
151 { "number", SbxDOUBLE, 0,nullptr,0 },
152 { "CreateObject", SbxOBJECT, 1 | FUNCTION_, RTLNAME( CreateObject ),0 },
153 { "class", SbxSTRING, 0,nullptr,0 },
154 { "CreateUnoListener",SbxOBJECT, 1 | FUNCTION_, RTLNAME( CreateUnoListener ),0 },
155 { "prefix", SbxSTRING, 0,nullptr,0 },
156 { "typename", SbxSTRING, 0,nullptr,0 },
157 { "CreateUnoDialog",SbxOBJECT, 2 | FUNCTION_, RTLNAME( CreateUnoDialog ),0 },
158 { "dialoglibrary",SbxOBJECT, 0,nullptr,0 },
159 { "dialogname", SbxSTRING, 0,nullptr,0 },
160 { "CreateUnoService",SbxOBJECT, 1 | FUNCTION_, RTLNAME( CreateUnoService ),0 },
161 { "servicename", SbxSTRING, 0,nullptr,0 },
162 { "CreateUnoServiceWithArguments",SbxOBJECT, 2 | FUNCTION_, RTLNAME( CreateUnoServiceWithArguments ),0 },
163 { "servicename", SbxSTRING, 0,nullptr,0 },
164 { "arguments", SbxARRAY, 0,nullptr,0 },
165 { "CreateUnoStruct",SbxOBJECT, 1 | FUNCTION_, RTLNAME( CreateUnoStruct ),0 },
166 { "classname", SbxSTRING, 0,nullptr,0 },
167 { "CreateUnoValue", SbxOBJECT, 2 | FUNCTION_, RTLNAME( CreateUnoValue ),0 },
168 { "type", SbxSTRING, 0,nullptr,0 },
169 { "value", SbxVARIANT, 0,nullptr,0 },
170 { "CreatePropertySet",SbxOBJECT, 1 | FUNCTION_, RTLNAME( CreatePropertySet ),0 },
171 { "values", SbxARRAY, 0,nullptr,0 },
172 { "CSng", SbxSINGLE, 1 | FUNCTION_, RTLNAME(CSng),0 },
173 { "expression", SbxVARIANT, 0,nullptr,0 },
174 { "CStr", SbxSTRING, 1 | FUNCTION_, RTLNAME(CStr),0 },
175 { "expression", SbxVARIANT, 0,nullptr,0 },
176 { "CurDir", SbxSTRING, 1 | FUNCTION_, RTLNAME(CurDir),0 },
177 { "string", SbxSTRING, 0,nullptr,0 },
178 { "CVar", SbxVARIANT, 1 | FUNCTION_, RTLNAME(CVar),0 },
179 { "expression", SbxVARIANT, 0,nullptr,0 },
180 { "CVErr", SbxVARIANT, 1 | FUNCTION_, RTLNAME(CVErr),0 },
181 { "expression", SbxVARIANT, 0,nullptr,0 },
182 { "DDB", SbxDOUBLE, 5 | FUNCTION_ | COMPATONLY_, RTLNAME(DDB),0 },
183 { "Cost", SbxDOUBLE, 0, nullptr,0 },
184 { "Salvage", SbxDOUBLE, 0, nullptr,0 },
185 { "Life", SbxDOUBLE, 0, nullptr,0 },
186 { "Period", SbxDOUBLE, 0, nullptr,0 },
187 { "Factor", SbxVARIANT, OPT_, nullptr,0 },
188 { "Date", SbxDATE, LFUNCTION_,RTLNAME(Date),0 },
189 { "DateAdd", SbxDATE, 3 | FUNCTION_, RTLNAME(DateAdd),0 },
190 { "Interval", SbxSTRING, 0,nullptr,0 },
191 { "Number", SbxLONG, 0,nullptr,0 },
192 { "Date", SbxDATE, 0,nullptr,0 },
193 { "DateDiff", SbxDOUBLE, 5 | FUNCTION_, RTLNAME(DateDiff),0 },
194 { "Interval", SbxSTRING, 0,nullptr,0 },
195 { "Date1", SbxDATE, 0,nullptr,0 },
196 { "Date2", SbxDATE, 0,nullptr,0 },
197 { "Firstdayofweek" , SbxINTEGER, OPT_,nullptr,0 },
198 { "Firstweekofyear", SbxINTEGER, OPT_,nullptr,0 },
199 { "DatePart", SbxLONG, 4 | FUNCTION_, RTLNAME(DatePart),0 },
200 { "Interval", SbxSTRING, 0,nullptr,0 },
201 { "Date", SbxDATE, 0,nullptr,0 },
202 { "Firstdayofweek" , SbxINTEGER, OPT_, nullptr,0 },
203 { "Firstweekofyear", SbxINTEGER, OPT_, nullptr,0 },
204 { "DateSerial", SbxDATE, 3 | FUNCTION_, RTLNAME(DateSerial),0 },
205 { "Year", SbxINTEGER, 0,nullptr,0 },
206 { "Month", SbxINTEGER, 0,nullptr,0 },
207 { "Day", SbxINTEGER, 0,nullptr,0 },
208 { "DateValue", SbxDATE, 1 | FUNCTION_, RTLNAME(DateValue),0 },
209 { "String", SbxSTRING, 0,nullptr,0 },
210 { "Day", SbxINTEGER, 1 | FUNCTION_, RTLNAME(Day),0 },
211 { "Date", SbxDATE, 0,nullptr,0 },
212 { "Ddeexecute", SbxNULL, 2 | FUNCTION_, RTLNAME(DDEExecute),0 },
213 { "Channel", SbxLONG, 0,nullptr,0 },
214 { "Command", SbxSTRING, 0,nullptr,0 },
215 { "Ddeinitiate", SbxINTEGER, 2 | FUNCTION_, RTLNAME(DDEInitiate),0 },
216 { "Application", SbxSTRING, 0,nullptr,0 },
217 { "Topic", SbxSTRING, 0,nullptr,0 },
218 { "Ddepoke", SbxNULL, 3 | FUNCTION_, RTLNAME(DDEPoke),0 },
219 { "Channel", SbxLONG, 0,nullptr,0 },
220 { "Item", SbxSTRING, 0,nullptr,0 },
221 { "Data", SbxSTRING, 0,nullptr,0 },
222 { "Dderequest", SbxSTRING, 2 | FUNCTION_, RTLNAME(DDERequest),0 },
223 { "Channel", SbxLONG, 0,nullptr,0 },
224 { "Item", SbxSTRING, 0,nullptr,0 },
225 { "Ddeterminate", SbxNULL, 1 | FUNCTION_, RTLNAME(DDETerminate),0 },
226 { "Channel", SbxLONG, 0,nullptr,0 },
227 { "Ddeterminateall", SbxNULL, FUNCTION_, RTLNAME(DDETerminateAll),0 },
228 { "DimArray", SbxOBJECT, FUNCTION_, RTLNAME(DimArray),0 },
229 { "Dir", SbxSTRING, 2 | FUNCTION_, RTLNAME(Dir),0 },
230 { "FileSpec", SbxSTRING, OPT_, nullptr,0 },
231 { "attrmask", SbxINTEGER, OPT_, nullptr,0 },
232 { "DoEvents", SbxINTEGER, FUNCTION_, RTLNAME(DoEvents),0 },
233 { "DumpAllObjects", SbxEMPTY, 2 | SUB_, RTLNAME(DumpAllObjects),0 },
234 { "FileSpec", SbxSTRING, 0,nullptr,0 },
235 { "DumpAll", SbxINTEGER, OPT_, nullptr,0 },
237 { "Empty", SbxVARIANT, CPROP_, RTLNAME(Empty),0 },
238 { "EqualUnoObjects",SbxBOOL, 2 | FUNCTION_, RTLNAME(EqualUnoObjects),0 },
239 { "Variant", SbxVARIANT, 0,nullptr,0 },
240 { "Variant", SbxVARIANT, 0,nullptr,0 },
241 { "EnableReschedule", SbxNULL, 1 | FUNCTION_, RTLNAME(EnableReschedule),0},
242 { "bEnable", SbxBOOL, 0,nullptr,0 },
243 { "Environ", SbxSTRING, 1 | FUNCTION_, RTLNAME(Environ),0 },
244 { "Environmentstring",SbxSTRING, 0,nullptr,0 },
245 { "EOF", SbxBOOL, 1 | FUNCTION_, RTLNAME(EOF),0 },
246 { "Channel", SbxINTEGER, 0,nullptr,0 },
247 { "Erl", SbxLONG, ROPROP_, RTLNAME( Erl ),0 },
248 { "Err", SbxVARIANT, RWPROP_, RTLNAME( Err ),0 },
249 { "Error", SbxSTRING, 1 | FUNCTION_, RTLNAME( Error ),0 },
250 { "code", SbxLONG, 0,nullptr,0 },
251 { "Exp", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Exp),0 },
252 { "number", SbxDOUBLE, 0,nullptr,0 },
254 { "False", SbxBOOL, CPROP_, RTLNAME(False),0 },
255 { "FileAttr", SbxINTEGER, 2 | FUNCTION_, RTLNAME(FileAttr),0 },
256 { "Channel", SbxINTEGER, 0,nullptr,0 },
257 { "Attributes", SbxINTEGER, 0,nullptr,0 },
258 { "FileCopy", SbxNULL, 2 | FUNCTION_, RTLNAME(FileCopy),0 },
259 { "Source", SbxSTRING, 0,nullptr,0 },
260 { "Destination", SbxSTRING, 0,nullptr,0 },
261 { "FileDateTime", SbxSTRING, 1 | FUNCTION_, RTLNAME(FileDateTime),0 },
262 { "filename", SbxSTRING, 0,nullptr,0 },
263 { "FileExists", SbxBOOL, 1 | FUNCTION_, RTLNAME(FileExists),0 },
264 { "filename", SbxSTRING, 0,nullptr,0 },
265 { "FileLen", SbxLONG, 1 | FUNCTION_, RTLNAME(FileLen),0 },
266 { "filename", SbxSTRING, 0,nullptr,0 },
267 { "FindObject", SbxOBJECT, 1 | FUNCTION_, RTLNAME(FindObject),0 },
268 { "Name", SbxSTRING, 0,nullptr,0 },
269 { "FindPropertyObject", SbxOBJECT, 2 | FUNCTION_, RTLNAME(FindPropertyObject),0 },
270 { "Object", SbxOBJECT, 0,nullptr,0 },
271 { "Name", SbxSTRING, 0,nullptr,0 },
272 { "Fix", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Fix),0 },
273 { "number", SbxDOUBLE, 0,nullptr,0 },
274 { "Format", SbxSTRING, 2 | FUNCTION_, RTLNAME(Format),0 },
275 { "expression", SbxVARIANT, 0,nullptr,0 },
276 { "format", SbxSTRING, OPT_, nullptr,0 },
277 { "FormatDateTime", SbxSTRING, 2 | FUNCTION_ | COMPATONLY_, RTLNAME(FormatDateTime),0 },
278 { "Date", SbxDATE, 0,nullptr,0 },
279 { "NamedFormat", SbxINTEGER, OPT_, nullptr,0 },
280 { "FormatNumber", SbxSTRING, 5 | FUNCTION_ | COMPATONLY_, RTLNAME(FormatNumber), 0 },
281 { "expression", SbxDOUBLE, 0, nullptr, 0 },
282 { "numDigitsAfterDecimal", SbxINTEGER, OPT_, nullptr, 0 },
283 { "includeLeadingDigit", SbxINTEGER, OPT_, nullptr, 0 }, // vbTriState
284 { "useParensForNegativeNumbers", SbxINTEGER, OPT_, nullptr, 0 }, // vbTriState
285 { "groupDigits", SbxINTEGER, OPT_, nullptr, 0 }, // vbTriState
286 { "Frac", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Frac),0 },
287 { "number", SbxDOUBLE, 0,nullptr,0 },
288 { "FRAMEANCHORCHAR", SbxINTEGER, CPROP_, RTLNAME(FRAMEANCHORCHAR),0 },
289 { "FRAMEANCHORPAGE", SbxINTEGER, CPROP_, RTLNAME(FRAMEANCHORPAGE),0 },
290 { "FRAMEANCHORPARA", SbxINTEGER, CPROP_, RTLNAME(FRAMEANCHORPARA),0 },
291 { "FreeFile", SbxINTEGER, FUNCTION_, RTLNAME(FreeFile),0 },
292 { "FreeLibrary", SbxNULL, 1 | FUNCTION_, RTLNAME(FreeLibrary),0 },
293 { "Modulename", SbxSTRING, 0,nullptr,0 },
295 { "FV", SbxDOUBLE, 5 | FUNCTION_ | COMPATONLY_, RTLNAME(FV),0 },
296 { "Rate", SbxDOUBLE, 0, nullptr,0 },
297 { "NPer", SbxDOUBLE, 0, nullptr,0 },
298 { "Pmt", SbxDOUBLE, 0, nullptr,0 },
299 { "PV", SbxVARIANT, OPT_, nullptr,0 },
300 { "Due", SbxVARIANT, OPT_, nullptr,0 },
301 { "Get", SbxNULL, 3 | FUNCTION_, RTLNAME(Get),0 },
302 { "filenumber", SbxINTEGER, 0,nullptr,0 },
303 { "recordnumber", SbxLONG, 0,nullptr,0 },
304 { "variablename", SbxVARIANT, 0,nullptr,0 },
305 { "GetAttr", SbxINTEGER, 1 | FUNCTION_, RTLNAME(GetAttr),0 },
306 { "filename", SbxSTRING, 0,nullptr,0 },
307 { "GetDefaultContext", SbxOBJECT, 0 | FUNCTION_, RTLNAME(GetDefaultContext),0 },
308 { "GetDialogZoomFactorX", SbxDOUBLE, FUNCTION_,RTLNAME(GetDialogZoomFactorX),0 },
309 { "GetDialogZoomFactorY", SbxDOUBLE, FUNCTION_,RTLNAME(GetDialogZoomFactorY),0 },
310 { "GetGUIType", SbxINTEGER, FUNCTION_,RTLNAME(GetGUIType),0 },
311 { "GetGUIVersion", SbxLONG, FUNCTION_,RTLNAME(GetGUIVersion),0 },
312 { "GetPathSeparator", SbxSTRING, FUNCTION_,RTLNAME(GetPathSeparator),0 },
313 { "GetProcessServiceManager", SbxOBJECT, 0 | FUNCTION_, RTLNAME(GetProcessServiceManager),0 },
314 { "GetSolarVersion", SbxLONG, FUNCTION_,RTLNAME(GetSolarVersion),0 },
315 { "GetSystemTicks", SbxLONG, FUNCTION_,RTLNAME(GetSystemTicks),0 },
316 { "GetSystemType", SbxINTEGER, FUNCTION_,RTLNAME(GetSystemType),0 },
317 { "GlobalScope", SbxOBJECT, FUNCTION_,RTLNAME(GlobalScope),0 },
318 { "Green", SbxINTEGER, 1 | FUNCTION_ | NORMONLY_, RTLNAME(Green),0 },
319 { "RGB-Value", SbxLONG, 0,nullptr,0 },
321 { "HasUnoInterfaces", SbxBOOL, 1 | FUNCTION_, RTLNAME(HasUnoInterfaces),0},
322 { "InterfaceName",SbxSTRING, 0,nullptr,0 },
323 { "Hex", SbxSTRING, 1 | FUNCTION_, RTLNAME(Hex),0 },
324 { "number", SbxLONG, 0,nullptr,0 },
325 { "Hour", SbxINTEGER, 1 | FUNCTION_, RTLNAME(Hour),0 },
326 { "Date", SbxDATE, 0,nullptr,0 },
328 { "IDABORT", SbxINTEGER, CPROP_, RTLNAME(IDABORT),0 },
329 { "IDCANCEL", SbxINTEGER, CPROP_, RTLNAME(IDCANCEL),0 },
330 { "IDNO", SbxINTEGER, CPROP_, RTLNAME(IDNO),0 },
331 { "IDOK", SbxINTEGER, CPROP_, RTLNAME(IDOK),0 },
332 { "IDRETRY", SbxINTEGER, CPROP_, RTLNAME(IDRETRY),0 },
333 { "IDYES", SbxINTEGER, CPROP_, RTLNAME(IDYES),0 },
335 { "Iif", SbxVARIANT, 3 | FUNCTION_, RTLNAME(Iif),0 },
336 { "Bool", SbxBOOL, 0,nullptr,0 },
337 { "Variant1", SbxVARIANT, 0,nullptr,0 },
338 { "Variant2", SbxVARIANT, 0,nullptr,0 },
340 { "Input", SbxSTRING, 2 | FUNCTION_ | COMPATONLY_, RTLNAME(Input),0},
341 { "Number", SbxLONG, 0,nullptr,0 },
342 { "FileNumber", SbxLONG, 0,nullptr,0 },
343 { "InputBox", SbxSTRING, 5 | FUNCTION_, RTLNAME(InputBox),0 },
344 { "Prompt", SbxSTRING, 0,nullptr,0 },
345 { "Title", SbxSTRING, OPT_, nullptr,0 },
346 { "Default", SbxSTRING, OPT_, nullptr,0 },
347 { "XPosTwips", SbxLONG, OPT_, nullptr,0 },
348 { "YPosTwips", SbxLONG, OPT_, nullptr,0 },
349 { "InStr", SbxLONG, 4 | FUNCTION_, RTLNAME(InStr),0 },
350 { "Start", SbxSTRING, OPT_, nullptr,0 },
351 { "String1", SbxSTRING, 0,nullptr,0 },
352 { "String2", SbxSTRING, 0,nullptr,0 },
353 { "Compare", SbxINTEGER, OPT_, nullptr,0 },
354 { "InStrRev", SbxLONG, 4 | FUNCTION_ | COMPATONLY_, RTLNAME(InStrRev),0},
355 { "String1", SbxSTRING, 0,nullptr,0 },
356 { "String2", SbxSTRING, 0,nullptr,0 },
357 { "Start", SbxSTRING, OPT_, nullptr,0 },
358 { "Compare", SbxINTEGER, OPT_, nullptr,0 },
359 { "Int", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Int),0 },
360 { "number", SbxDOUBLE, 0,nullptr,0 },
361 { "IPmt", SbxDOUBLE, 6 | FUNCTION_ | COMPATONLY_, RTLNAME(IPmt),0 },
362 { "Rate", SbxDOUBLE, 0, nullptr,0 },
363 { "Per", SbxDOUBLE, 0, nullptr,0 },
364 { "NPer", SbxDOUBLE, 0, nullptr,0 },
365 { "PV", SbxDOUBLE, 0, nullptr,0 },
366 { "FV", SbxVARIANT, OPT_, nullptr,0 },
367 { "Due", SbxVARIANT, OPT_, nullptr,0 },
368 { "IRR", SbxDOUBLE, 2 | FUNCTION_ | COMPATONLY_, RTLNAME(IRR),0 },
369 { "ValueArray", SbxARRAY, 0, nullptr,0 },
370 { "Guess", SbxVARIANT, OPT_, nullptr,0 },
371 { "IsArray", SbxBOOL, 1 | FUNCTION_, RTLNAME(IsArray),0 },
372 { "Variant", SbxVARIANT, 0,nullptr,0 },
373 { "IsDate", SbxBOOL, 1 | FUNCTION_, RTLNAME(IsDate),0 },
374 { "Variant", SbxVARIANT, 0,nullptr,0 },
375 { "IsEmpty", SbxBOOL, 1 | FUNCTION_, RTLNAME(IsEmpty),0 },
376 { "Variant", SbxVARIANT, 0,nullptr,0 },
377 { "IsError", SbxBOOL, 1 | FUNCTION_, RTLNAME(IsError),0 },
378 { "Variant", SbxVARIANT, 0,nullptr,0 },
379 { "IsMissing", SbxBOOL, 1 | FUNCTION_, RTLNAME(IsMissing),0 },
380 { "Variant", SbxVARIANT, 0,nullptr,0 },
381 { "IsNull", SbxBOOL, 1 | FUNCTION_, RTLNAME(IsNull),0 },
382 { "Variant", SbxVARIANT, 0,nullptr,0 },
383 { "IsNumeric", SbxBOOL, 1 | FUNCTION_, RTLNAME(IsNumeric),0 },
384 { "Variant", SbxVARIANT, 0,nullptr,0 },
385 { "IsObject", SbxBOOL, 1 | FUNCTION_, RTLNAME(IsObject),0 },
386 { "Variant", SbxVARIANT, 0,nullptr,0 },
387 { "IsUnoStruct", SbxBOOL, 1 | FUNCTION_, RTLNAME(IsUnoStruct),0 },
388 { "Variant", SbxVARIANT, 0,nullptr,0 },
389 { "Join", SbxSTRING, 2 | FUNCTION_, RTLNAME(Join),0 },
390 { "list", SbxOBJECT, 0,nullptr,0 },
391 { "delimiter", SbxSTRING, 0,nullptr,0 },
392 { "Kill", SbxNULL, 1 | FUNCTION_, RTLNAME(Kill),0 },
393 { "filespec", SbxSTRING, 0,nullptr,0 },
394 { "LBound", SbxLONG, 1 | FUNCTION_, RTLNAME(LBound),0 },
395 { "Variant", SbxVARIANT, 0,nullptr,0 },
396 { "LCase", SbxSTRING, 1 | FUNCTION_, RTLNAME(LCase),0 },
397 { "string", SbxSTRING, 0,nullptr,0 },
398 { "Left", SbxSTRING, 2 | FUNCTION_, RTLNAME(Left),0 },
399 { "String", SbxSTRING, 0,nullptr,0 },
400 { "Count", SbxLONG, 0,nullptr,0 },
401 { "Len", SbxLONG, 1 | FUNCTION_, RTLNAME(Len),0 },
402 { "StringOrVariant", SbxVARIANT, 0,nullptr,0 },
403 { "LenB", SbxLONG, 1 | FUNCTION_, RTLNAME(Len),0 },
404 { "StringOrVariant", SbxVARIANT, 0,nullptr,0 },
405 { "Load", SbxNULL, 1 | FUNCTION_, RTLNAME(Load),0 },
406 { "object", SbxOBJECT, 0,nullptr,0 },
407 { "LoadPicture", SbxOBJECT, 1 | FUNCTION_, RTLNAME(LoadPicture),0 },
408 { "string", SbxSTRING, 0,nullptr,0 },
409 { "Loc", SbxLONG, 1 | FUNCTION_, RTLNAME(Loc),0 },
410 { "Channel", SbxINTEGER, 0,nullptr,0 },
411 { "Lof", SbxLONG, 1 | FUNCTION_, RTLNAME(Lof),0 },
412 { "Channel", SbxINTEGER, 0,nullptr,0 },
413 { "Log", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Log),0 },
414 { "number", SbxDOUBLE, 0,nullptr,0 },
415 { "LTrim", SbxSTRING, 1 | FUNCTION_, RTLNAME(LTrim),0 },
416 { "string", SbxSTRING, 0,nullptr,0 },
418 { "MB_ABORTRETRYIGNORE", SbxINTEGER, CPROP_, RTLNAME(MB_ABORTRETRYIGNORE),0},
419 { "MB_APPLMODAL", SbxINTEGER, CPROP_, RTLNAME(MB_APPLMODAL),0 },
420 { "MB_DEFBUTTON1", SbxINTEGER, CPROP_, RTLNAME(MB_DEFBUTTON1),0 },
421 { "MB_DEFBUTTON2", SbxINTEGER, CPROP_, RTLNAME(MB_DEFBUTTON2),0 },
422 { "MB_DEFBUTTON3", SbxINTEGER, CPROP_, RTLNAME(MB_DEFBUTTON3),0 },
423 { "MB_ICONEXCLAMATION", SbxINTEGER, CPROP_, RTLNAME(MB_ICONEXCLAMATION),0},
424 { "MB_ICONINFORMATION", SbxINTEGER, CPROP_, RTLNAME(MB_ICONINFORMATION),0},
425 { "MB_ICONQUESTION",SbxINTEGER, CPROP_, RTLNAME(MB_ICONQUESTION),0 },
426 { "MB_ICONSTOP", SbxINTEGER, CPROP_, RTLNAME(MB_ICONSTOP),0 },
427 { "MB_OK", SbxINTEGER, CPROP_, RTLNAME(MB_OK),0 },
428 { "MB_OKCANCEL", SbxINTEGER, CPROP_, RTLNAME(MB_OKCANCEL),0 },
429 { "MB_RETRYCANCEL", SbxINTEGER, CPROP_, RTLNAME(MB_RETRYCANCEL),0 },
430 { "MB_SYSTEMMODAL", SbxINTEGER, CPROP_, RTLNAME(MB_SYSTEMMODAL),0 },
431 { "MB_YESNO", SbxINTEGER, CPROP_, RTLNAME(MB_YESNO),0 },
432 { "MB_YESNOCANCEL", SbxINTEGER, CPROP_, RTLNAME(MB_YESNOCANCEL),0 },
434 { "Me", SbxOBJECT, 0 | FUNCTION_ | COMPATONLY_, RTLNAME(Me),0 },
435 { "Mid", SbxSTRING, 3 | LFUNCTION_,RTLNAME(Mid),0 },
436 { "String", SbxSTRING, 0,nullptr,0 },
437 { "StartPos", SbxLONG, 0,nullptr,0 },
438 { "Length", SbxLONG, OPT_, nullptr,0 },
439 { "Minute", SbxINTEGER, 1 | FUNCTION_, RTLNAME(Minute),0 },
440 { "Date", SbxDATE, 0,nullptr,0 },
441 { "MIRR", SbxDOUBLE, 2 | FUNCTION_ | COMPATONLY_, RTLNAME(MIRR),0 },
442 { "ValueArray", SbxARRAY, 0, nullptr,0 },
443 { "FinanceRate", SbxDOUBLE, 0, nullptr,0 },
444 { "ReinvestRate", SbxDOUBLE, 0, nullptr,0 },
445 { "MkDir", SbxNULL, 1 | FUNCTION_, RTLNAME(MkDir),0 },
446 { "pathname", SbxSTRING, 0,nullptr,0 },
447 { "Month", SbxINTEGER, 1 | FUNCTION_, RTLNAME(Month),0 },
448 { "Date", SbxDATE, 0,nullptr,0 },
449 { "MonthName", SbxSTRING, 2 | FUNCTION_ | COMPATONLY_, RTLNAME(MonthName),0 },
450 { "Month", SbxINTEGER, 0,nullptr,0 },
451 { "Abbreviate", SbxBOOL, OPT_, nullptr,0 },
452 { "MsgBox", SbxINTEGER, 5 | FUNCTION_, RTLNAME(MsgBox),0 },
453 { "Prompt", SbxSTRING, 0,nullptr,0 },
454 { "Buttons", SbxINTEGER, OPT_, nullptr,0 },
455 { "Title", SbxSTRING, OPT_, nullptr,0 },
456 { "Helpfile", SbxSTRING, OPT_, nullptr,0 },
457 { "Context", SbxINTEGER, OPT_, nullptr,0 },
459 { "Nothing", SbxOBJECT, CPROP_, RTLNAME(Nothing),0 },
460 { "Now", SbxDATE, FUNCTION_, RTLNAME(Now),0 },
461 { "NPer", SbxDOUBLE, 5 | FUNCTION_ | COMPATONLY_, RTLNAME(NPer),0 },
462 { "Rate", SbxDOUBLE, 0, nullptr,0 },
463 { "Pmt", SbxDOUBLE, 0, nullptr,0 },
464 { "PV", SbxDOUBLE, 0, nullptr,0 },
465 { "FV", SbxVARIANT, OPT_, nullptr,0 },
466 { "Due", SbxVARIANT, OPT_, nullptr,0 },
467 { "NPV", SbxDOUBLE, 2 | FUNCTION_ | COMPATONLY_, RTLNAME(NPV),0 },
468 { "Rate", SbxDOUBLE, 0, nullptr,0 },
469 { "ValueArray", SbxARRAY, 0, nullptr,0 },
470 { "Null", SbxNULL, CPROP_, RTLNAME(Null),0 },
472 { "Oct", SbxSTRING, 1 | FUNCTION_, RTLNAME(Oct),0 },
473 { "number", SbxLONG, 0,nullptr,0 },
475 { "Partition", SbxSTRING, 4 | FUNCTION_, RTLNAME(Partition),0 },
476 { "number", SbxLONG, 0,nullptr,0 },
477 { "start", SbxLONG, 0,nullptr,0 },
478 { "stop", SbxLONG, 0,nullptr,0 },
479 { "interval", SbxLONG, 0,nullptr,0 },
480 { "Pi", SbxDOUBLE, CPROP_, RTLNAME(PI),0 },
482 { "Pmt", SbxDOUBLE, 5 | FUNCTION_ | COMPATONLY_, RTLNAME(Pmt),0 },
483 { "Rate", SbxDOUBLE, 0, nullptr,0 },
484 { "NPer", SbxDOUBLE, 0, nullptr,0 },
485 { "PV", SbxDOUBLE, 0, nullptr,0 },
486 { "FV", SbxVARIANT, OPT_, nullptr,0 },
487 { "Due", SbxVARIANT, OPT_, nullptr,0 },
489 { "PPmt", SbxDOUBLE, 6 | FUNCTION_ | COMPATONLY_, RTLNAME(PPmt),0 },
490 { "Rate", SbxDOUBLE, 0, nullptr,0 },
491 { "Per", SbxDOUBLE, 0, nullptr,0 },
492 { "NPer", SbxDOUBLE, 0, nullptr,0 },
493 { "PV", SbxDOUBLE, 0, nullptr,0 },
494 { "FV", SbxVARIANT, OPT_, nullptr,0 },
495 { "Due", SbxVARIANT, OPT_, nullptr,0 },
497 { "Put", SbxNULL, 3 | FUNCTION_, RTLNAME(Put),0 },
498 { "filenumber", SbxINTEGER, 0,nullptr,0 },
499 { "recordnumber", SbxLONG, 0,nullptr,0 },
500 { "variablename", SbxVARIANT, 0,nullptr,0 },
502 { "PV", SbxDOUBLE, 5 | FUNCTION_ | COMPATONLY_, RTLNAME(PV),0 },
503 { "Rate", SbxDOUBLE, 0, nullptr,0 },
504 { "NPer", SbxDOUBLE, 0, nullptr,0 },
505 { "Pmt", SbxDOUBLE, 0, nullptr,0 },
506 { "FV", SbxVARIANT, OPT_, nullptr,0 },
507 { "Due", SbxVARIANT, OPT_, nullptr,0 },
509 { "QBColor", SbxLONG, 1 | FUNCTION_, RTLNAME(QBColor),0 },
510 { "number", SbxINTEGER, 0,nullptr,0 },
512 { "Randomize", SbxNULL, 1 | FUNCTION_, RTLNAME(Randomize),0 },
513 { "Number", SbxDOUBLE, OPT_, nullptr,0 },
514 { "Rate", SbxDOUBLE, 6 | FUNCTION_ | COMPATONLY_, RTLNAME(Rate),0 },
515 { "NPer", SbxDOUBLE, 0, nullptr,0 },
516 { "Pmt", SbxDOUBLE, 0, nullptr,0 },
517 { "PV", SbxDOUBLE, 0, nullptr,0 },
518 { "FV", SbxVARIANT, OPT_, nullptr,0 },
519 { "Due", SbxVARIANT, OPT_, nullptr,0 },
520 { "Guess", SbxVARIANT, OPT_, nullptr,0 },
521 { "Red", SbxINTEGER, 1 | FUNCTION_ | NORMONLY_, RTLNAME(Red),0 },
522 { "RGB-Value", SbxLONG, 0,nullptr,0 },
523 { "Reset", SbxNULL, 0 | FUNCTION_, RTLNAME(Reset),0 },
524 { "ResolvePath", SbxSTRING, 1 | FUNCTION_, RTLNAME(ResolvePath),0 },
525 { "Path", SbxSTRING, 0,nullptr,0 },
526 { "RGB", SbxLONG, 3 | FUNCTION_, RTLNAME(RGB),0 },
527 { "Red", SbxINTEGER, 0,nullptr,0 },
528 { "Green", SbxINTEGER, 0,nullptr,0 },
529 { "Blue", SbxINTEGER, 0,nullptr,0 },
530 { "Replace", SbxSTRING, 6 | FUNCTION_, RTLNAME(Replace),0 },
531 { "Expression", SbxSTRING, 0,nullptr,0 },
532 { "Find", SbxSTRING, 0,nullptr,0 },
533 { "Replace", SbxSTRING, 0,nullptr,0 },
534 { "Start", SbxINTEGER, OPT_, nullptr,0 },
535 { "Count", SbxINTEGER, OPT_, nullptr,0 },
536 { "Compare", SbxINTEGER, OPT_, nullptr,0 },
537 { "Right", SbxSTRING, 2 | FUNCTION_, RTLNAME(Right),0 },
538 { "String", SbxSTRING, 0,nullptr,0 },
539 { "Count", SbxLONG, 0,nullptr,0 },
540 { "RmDir", SbxNULL, 1 | FUNCTION_, RTLNAME(RmDir),0 },
541 { "pathname", SbxSTRING, 0,nullptr,0 },
542 { "Round", SbxDOUBLE, 2 | FUNCTION_ | COMPATONLY_, RTLNAME(Round),0},
543 { "Expression", SbxDOUBLE, 0,nullptr,0 },
544 { "Numdecimalplaces", SbxINTEGER, OPT_, nullptr,0 },
545 { "Rnd", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Rnd),0 },
546 { "Number", SbxDOUBLE, OPT_, nullptr,0 },
547 { "RTL", SbxOBJECT, 0 | FUNCTION_ | COMPATONLY_, RTLNAME(RTL),0},
548 { "RTrim", SbxSTRING, 1 | FUNCTION_, RTLNAME(RTrim),0 },
549 { "string", SbxSTRING, 0,nullptr,0 },
551 { "SavePicture", SbxNULL, 2 | FUNCTION_, RTLNAME(SavePicture),0 },
552 { "object", SbxOBJECT, 0,nullptr,0 },
553 { "string", SbxSTRING, 0,nullptr,0 },
554 { "Second", SbxINTEGER, 1 | FUNCTION_, RTLNAME(Second),0 },
555 { "Date", SbxDATE, 0,nullptr,0 },
556 { "Seek", SbxLONG, 1 | FUNCTION_, RTLNAME(Seek),0 },
557 { "Channel", SbxINTEGER, 0,nullptr,0 },
558 { "SendKeys", SbxNULL, 2 | FUNCTION_, RTLNAME(SendKeys),0 },
559 { "String", SbxSTRING, 0,nullptr,0 },
560 { "Wait", SbxBOOL, OPT_, nullptr,0 },
561 { "SetAttr", SbxNULL, 2 | FUNCTION_, RTLNAME(SetAttr),0 },
562 { "File" , SbxSTRING, 0,nullptr,0 },
563 { "Attributes", SbxINTEGER, 0,nullptr,0 },
564 { "SET_OFF", SbxINTEGER, CPROP_, RTLNAME(SET_OFF),0 },
565 { "SET_ON", SbxINTEGER, CPROP_, RTLNAME(SET_ON),0 },
566 { "SET_TAB", SbxINTEGER, CPROP_, RTLNAME(SET_TAB),0 },
567 { "Sgn", SbxINTEGER, 1 | FUNCTION_, RTLNAME(Sgn),0 },
568 { "number", SbxDOUBLE, 0,nullptr,0 },
569 { "Shell", SbxLONG, 2 | FUNCTION_, RTLNAME(Shell),0 },
570 { "Commandstring",SbxSTRING, 0,nullptr,0 },
571 { "WindowStyle", SbxINTEGER, OPT_, nullptr,0 },
572 { "Sin", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Sin),0 },
573 { "number", SbxDOUBLE, 0,nullptr,0 },
574 { "SLN", SbxDOUBLE, 2 | FUNCTION_ | COMPATONLY_, RTLNAME(SLN),0 },
575 { "Cost", SbxDOUBLE, 0,nullptr,0 },
576 { "Double", SbxDOUBLE, 0,nullptr,0 },
577 { "Life", SbxDOUBLE, 0,nullptr,0 },
578 { "SYD", SbxDOUBLE, 2 | FUNCTION_ | COMPATONLY_, RTLNAME(SYD),0 },
579 { "Cost", SbxDOUBLE, 0,nullptr,0 },
580 { "Salvage", SbxDOUBLE, 0,nullptr,0 },
581 { "Life", SbxDOUBLE, 0,nullptr,0 },
582 { "Period", SbxDOUBLE, 0,nullptr,0 },
583 { "Space", SbxSTRING, 1 | FUNCTION_, RTLNAME(Space),0 },
584 { "string", SbxLONG, 0,nullptr,0 },
585 { "Spc", SbxSTRING, 1 | FUNCTION_, RTLNAME(Spc),0 },
586 { "Count", SbxLONG, 0,nullptr,0 },
587 { "Split", SbxOBJECT, 3 | FUNCTION_, RTLNAME(Split),0 },
588 { "expression", SbxSTRING, 0,nullptr,0 },
589 { "delimiter", SbxSTRING, 0,nullptr,0 },
590 { "count", SbxLONG, 0,nullptr,0 },
591 { "Sqr", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Sqr),0 },
592 { "number", SbxDOUBLE, 0,nullptr,0 },
593 { "Str", SbxSTRING, 1 | FUNCTION_, RTLNAME(Str),0 },
594 { "number", SbxDOUBLE, 0,nullptr,0 },
595 { "StrComp", SbxINTEGER, 3 | FUNCTION_, RTLNAME(StrComp),0 },
596 { "String1", SbxSTRING, 0,nullptr,0 },
597 { "String2", SbxSTRING, 0,nullptr,0 },
598 { "Compare", SbxINTEGER, OPT_, nullptr,0 },
599 { "StrConv", SbxOBJECT, 3 | FUNCTION_, RTLNAME(StrConv),0 },
600 { "String", SbxSTRING, 0,nullptr,0 },
601 { "Conversion", SbxSTRING, 0,nullptr,0 },
602 { "LCID", SbxINTEGER, OPT_,nullptr,0 },
603 { "String", SbxSTRING, 2 | FUNCTION_, RTLNAME(String),0 },
604 { "Count", SbxLONG, 0,nullptr,0 },
605 { "Filler", SbxVARIANT, 0,nullptr,0 },
606 { "StrReverse", SbxSTRING, 1 | FUNCTION_ | COMPATONLY_, RTLNAME(StrReverse),0 },
607 { "String1", SbxSTRING, 0,nullptr,0 },
608 { "Switch", SbxVARIANT, 2 | FUNCTION_, RTLNAME(Switch),0 },
609 { "Expression", SbxVARIANT, 0,nullptr,0 },
610 { "Value", SbxVARIANT, 0,nullptr,0 },
611 { "Tab", SbxSTRING, 1 | FUNCTION_, RTLNAME(Tab),0 },
612 { "Count", SbxLONG, 0,nullptr,0 },
613 { "Tan", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Tan),0 },
614 { "number", SbxDOUBLE, 0,nullptr,0 },
615 { "Time", SbxVARIANT, LFUNCTION_,RTLNAME(Time),0 },
616 { "Timer", SbxDATE, FUNCTION_, RTLNAME(Timer),0 },
617 { "TimeSerial", SbxDATE, 3 | FUNCTION_, RTLNAME(TimeSerial),0 },
618 { "Hour", SbxLONG, 0,nullptr,0 },
619 { "Minute", SbxLONG, 0,nullptr,0 },
620 { "Second", SbxLONG, 0,nullptr,0 },
621 { "TimeValue", SbxDATE, 1 | FUNCTION_, RTLNAME(TimeValue),0 },
622 { "String", SbxSTRING, 0,nullptr,0 },
623 { "TOGGLE", SbxINTEGER, CPROP_, RTLNAME(TOGGLE),0 },
624 { "Trim", SbxSTRING, 1 | FUNCTION_, RTLNAME(Trim),0 },
625 { "String", SbxSTRING, 0,nullptr,0 },
626 { "True", SbxBOOL, CPROP_, RTLNAME(True),0 },
627 { "TwipsPerPixelX", SbxLONG, FUNCTION_, RTLNAME(TwipsPerPixelX),0 },
628 { "TwipsPerPixelY", SbxLONG, FUNCTION_, RTLNAME(TwipsPerPixelY),0 },
630 { "TYP_AUTHORFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_AUTHORFLD),0 },
631 { "TYP_CHAPTERFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_CHAPTERFLD),0 },
632 { "TYP_CONDTXTFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_CONDTXTFLD),0 },
633 { "TYP_DATEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_DATEFLD),0 },
634 { "TYP_DBFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_DBFLD),0 },
635 { "TYP_DBNAMEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_DBNAMEFLD),0 },
636 { "TYP_DBNEXTSETFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_DBNEXTSETFLD),0 },
637 { "TYP_DBNUMSETFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_DBNUMSETFLD),0 },
638 { "TYP_DBSETNUMBERFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_DBSETNUMBERFLD),0 },
639 { "TYP_DDEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_DDEFLD),0 },
640 { "TYP_DOCINFOFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_DOCINFOFLD),0 },
641 { "TYP_DOCSTATFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_DOCSTATFLD),0 },
642 { "TYP_EXTUSERFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_EXTUSERFLD),0 },
643 { "TYP_FILENAMEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_FILENAMEFLD),0 },
644 { "TYP_FIXDATEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_FIXDATEFLD),0 },
645 { "TYP_FIXTIMEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_FIXTIMEFLD),0 },
646 { "TYP_FORMELFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_FORMELFLD),0 },
647 { "TYP_GETFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_GETFLD),0 },
648 { "TYP_GETREFFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_GETREFFLD),0 },
649 { "TYP_GETREFPAGEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_GETREFPAGEFLD),0 },
650 { "TYP_HIDDENPARAFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_HIDDENPARAFLD),0 },
651 { "TYP_HIDDENTXTFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_HIDDENTXTFLD),0 },
652 { "TYP_INPUTFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_INPUTFLD),0 },
653 { "TYP_INTERNETFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_INTERNETFLD),0 },
654 { "TYP_JUMPEDITFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_JUMPEDITFLD),0 },
655 { "TYP_MACROFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_MACROFLD),0 },
656 { "TYP_NEXTPAGEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_NEXTPAGEFLD),0 },
657 { "TYP_PAGENUMBERFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_PAGENUMBERFLD),0 },
658 { "TYP_POSTITFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_POSTITFLD),0 },
659 { "TYP_PREVPAGEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_PREVPAGEFLD),0 },
660 { "TYP_SEQFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_SEQFLD),0 },
661 { "TYP_SETFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_SETFLD),0 },
662 { "TYP_SETINPFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_SETINPFLD),0 },
663 { "TYP_SETREFFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_SETREFFLD),0 },
664 { "TYP_SETREFPAGEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_SETREFPAGEFLD),0 },
665 { "TYP_TEMPLNAMEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_TEMPLNAMEFLD),0},
666 { "TYP_TIMEFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_TIMEFLD),0 },
667 { "TYP_USERFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_USERFLD),0 },
668 { "TYP_USRINPFLD", SbxINTEGER, CPROP_, RTLNAME(TYP_USRINPFLD),0 },
670 { "TypeLen", SbxINTEGER, 1 | FUNCTION_, RTLNAME(TypeLen),0 },
671 { "Var", SbxVARIANT, 0,nullptr,0 },
672 { "TypeName", SbxSTRING, 1 | FUNCTION_, RTLNAME(TypeName),0 },
673 { "Var", SbxVARIANT, 0,nullptr,0 },
675 { "UBound", SbxLONG, 1 | FUNCTION_, RTLNAME(UBound),0 },
676 { "Var", SbxVARIANT, 0,nullptr,0 },
677 { "UCase", SbxSTRING, 1 | FUNCTION_, RTLNAME(UCase),0 },
678 { "String", SbxSTRING, 0,nullptr,0 },
679 { "Unload", SbxNULL, 1 | FUNCTION_, RTLNAME(Unload),0 },
680 { "Dialog", SbxOBJECT, 0,nullptr,0 },
682 { "Val", SbxDOUBLE, 1 | FUNCTION_, RTLNAME(Val),0 },
683 { "String", SbxSTRING, 0,nullptr,0 },
684 { "VarType", SbxINTEGER, 1 | FUNCTION_, RTLNAME(VarType),0 },
685 { "Var", SbxVARIANT, 0,nullptr,0 },
686 { "V_EMPTY", SbxINTEGER, CPROP_, RTLNAME(V_EMPTY),0 },
687 { "V_NULL", SbxINTEGER, CPROP_, RTLNAME(V_NULL),0 },
688 { "V_INTEGER", SbxINTEGER, CPROP_, RTLNAME(V_INTEGER),0 },
689 { "V_LONG", SbxINTEGER, CPROP_, RTLNAME(V_LONG),0 },
690 { "V_SINGLE", SbxINTEGER, CPROP_, RTLNAME(V_SINGLE),0 },
691 { "V_DOUBLE", SbxINTEGER, CPROP_, RTLNAME(V_DOUBLE),0 },
692 { "V_CURRENCY", SbxINTEGER, CPROP_, RTLNAME(V_CURRENCY),0 },
693 { "V_DATE", SbxINTEGER, CPROP_, RTLNAME(V_DATE),0 },
694 { "V_STRING", SbxINTEGER, CPROP_, RTLNAME(V_STRING),0 },
696 { "Wait", SbxNULL, 1 | FUNCTION_, RTLNAME(Wait),0 },
697 { "Milliseconds", SbxLONG, 0,nullptr,0 },
698 { "FuncCaller", SbxVARIANT, FUNCTION_, RTLNAME(FuncCaller),0 },
699 //#i64882#
700 { "WaitUntil", SbxNULL, 1 | FUNCTION_, RTLNAME(WaitUntil),0 },
701 { "Date", SbxDOUBLE, 0,nullptr,0 },
702 { "Weekday", SbxINTEGER, 2 | FUNCTION_, RTLNAME(Weekday),0 },
703 { "Date", SbxDATE, 0,nullptr,0 },
704 { "Firstdayofweek", SbxINTEGER, OPT_, nullptr,0 },
705 { "WeekdayName", SbxSTRING, 3 | FUNCTION_ | COMPATONLY_, RTLNAME(WeekdayName),0 },
706 { "Weekday", SbxINTEGER, 0,nullptr,0 },
707 { "Abbreviate", SbxBOOL, OPT_, nullptr,0 },
708 { "Firstdayofweek", SbxINTEGER, OPT_, nullptr,0 },
709 { "Year", SbxINTEGER, 1 | FUNCTION_, RTLNAME(Year),0 },
710 { "Date", SbxDATE, 0,nullptr,0 },
712 { nullptr, SbxNULL, -1,nullptr,0 }}; // end of the table
714 SbiStdObject::SbiStdObject( const OUString& r, StarBASIC* pb ) : SbxObject( r )
716 // do we have to initialize the hashcodes?
717 Methods* p = aMethods;
718 if( !p->nHash )
719 while( p->nArgs != -1 )
721 OUString aName_ = OUString::createFromAscii( p->pName );
722 p->nHash = SbxVariable::MakeHashCode( aName_ );
723 p += ( p->nArgs & ARGSMASK_ ) + 1;
726 // #i92642: Remove default properties
727 Remove( "Name", SbxClassType::DontCare );
728 Remove( "Parent", SbxClassType::DontCare );
730 SetParent( pb );
732 pStdFactory.reset( new SbStdFactory );
733 SbxBase::AddFactory( pStdFactory.get() );
735 Insert( new SbStdClipboard );
738 SbiStdObject::~SbiStdObject()
740 SbxBase::RemoveFactory( pStdFactory.get() );
741 pStdFactory.reset();
744 // Finding an element:
745 // It runs linearly through the method table here until an
746 // adequate method is has been found. Because of the bits in
747 // the nArgs-field the adequate instance of an SbxObjElement
748 // is created then. If the method/property hasn't been found,
749 // return NULL without error code, so that a whole chain of
750 // objects can be asked for the method/property.
752 SbxVariable* SbiStdObject::Find( const OUString& rName, SbxClassType t )
754 // entered already?
755 SbxVariable* pVar = SbxObject::Find( rName, t );
756 if( !pVar )
758 // else search one
759 sal_uInt16 nHash_ = SbxVariable::MakeHashCode( rName );
760 Methods* p = aMethods;
761 bool bFound = false;
762 short nIndex = 0;
763 sal_uInt16 nSrchMask = TYPEMASK_;
764 switch( t )
766 case SbxClassType::Method: nSrchMask = METHOD_; break;
767 case SbxClassType::Property: nSrchMask = PROPERTY_; break;
768 case SbxClassType::Object: nSrchMask = OBJECT_; break;
769 default: break;
771 while( p->nArgs != -1 )
773 if( ( p->nArgs & nSrchMask )
774 && ( p->nHash == nHash_ )
775 && ( rName.equalsIgnoreAsciiCaseAscii( p->pName ) ) )
777 bFound = true;
778 if( p->nArgs & COMPTMASK_ )
780 bool bCompatibility = false;
781 SbiInstance* pInst = GetSbData()->pInst;
782 if (pInst)
784 bCompatibility = pInst->IsCompatibility();
786 else
788 // No instance running => compiling a source on module level.
789 const SbModule* pModule = GetSbData()->pCompMod;
790 if (pModule)
791 bCompatibility = pModule->IsVBACompat();
793 if ((bCompatibility && (NORMONLY_ & p->nArgs)) || (!bCompatibility && (COMPATONLY_ & p->nArgs)))
794 bFound = false;
796 break;
798 nIndex += ( p->nArgs & ARGSMASK_ ) + 1;
799 p = aMethods + nIndex;
802 if( bFound )
804 // isolate Args-fields:
805 SbxFlagBits nAccess = static_cast<SbxFlagBits>(( p->nArgs & RWMASK_ ) >> 8);
806 short nType = ( p->nArgs & TYPEMASK_ );
807 if( p->nArgs & CONST_ )
808 nAccess |= SbxFlagBits::Const;
809 OUString aName_ = OUString::createFromAscii( p->pName );
810 SbxClassType eCT = SbxClassType::Object;
811 if( nType & PROPERTY_ )
813 eCT = SbxClassType::Property;
815 else if( nType & METHOD_ )
817 eCT = SbxClassType::Method;
819 pVar = Make( aName_, eCT, p->eType, ( p->nArgs & FUNCTION_ ) == FUNCTION_ );
820 pVar->SetUserData( nIndex + 1 );
821 pVar->SetFlags( nAccess );
824 return pVar;
827 // SetModified must be pinched off at the RTL
828 void SbiStdObject::SetModified( bool )
833 void SbiStdObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
836 const SbxHint* pHint = dynamic_cast<const SbxHint*>(&rHint);
837 if( pHint )
839 SbxVariable* pVar = pHint->GetVar();
840 SbxArray* pPar_ = pVar->GetParameters();
841 const sal_uInt16 nCallId = static_cast<sal_uInt16>(pVar->GetUserData());
842 if( nCallId )
844 const SfxHintId t = pHint->GetId();
845 if( t == SfxHintId::BasicInfoWanted )
846 pVar->SetInfo( GetInfo( static_cast<short>(pVar->GetUserData()) ) );
847 else
849 bool bWrite = false;
850 if( t == SfxHintId::BasicDataChanged )
851 bWrite = true;
852 if( t == SfxHintId::BasicDataWanted || bWrite )
854 RtlCall p = aMethods[ nCallId-1 ].pFunc;
855 SbxArrayRef rPar( pPar_ );
856 if( !pPar_ )
858 rPar = pPar_ = new SbxArray;
859 pPar_->Put( pVar, 0 );
861 p( static_cast<StarBASIC*>(GetParent()), *pPar_, bWrite );
862 return;
866 SbxObject::Notify( rBC, rHint );
870 // building the info-structure for single elements
871 // if nIdx = 0, don't create anything (Std-Props!)
873 SbxInfo* SbiStdObject::GetInfo( short nIdx )
875 if( !nIdx )
876 return nullptr;
877 Methods* p = &aMethods[ --nIdx ];
878 SbxInfo* pInfo_ = new SbxInfo;
879 short nPar = p->nArgs & ARGSMASK_;
880 for( short i = 0; i < nPar; i++ )
882 p++;
883 OUString aName_ = OUString::createFromAscii( p->pName );
884 SbxFlagBits nFlags_ = static_cast<SbxFlagBits>(( p->nArgs >> 8 ) & 0x03);
885 if( p->nArgs & OPT_ )
887 nFlags_ |= SbxFlagBits::Optional;
889 pInfo_->AddParam( aName_, p->eType, nFlags_ );
891 return pInfo_;
894 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */