xref: /aoo42x/main/basic/source/runtime/stdobj.cxx (revision 79649792)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_basic.hxx"
26 
27 #include "runtime.hxx"
28 #include "stdobj.hxx"
29 #include <basic/sbstdobj.hxx>
30 #include "rtlproto.hxx"
31 #include "sbintern.hxx"
32 
33 // Das nArgs-Feld eines Tabelleneintrags ist wie folgt verschluesselt:
34 // Zur Zeit wird davon ausgegangen, dass Properties keine Parameter
35 // benoetigen!
36 
37 #define _ARGSMASK   0x007F  // Bis zu 127 Argumente
38 #define _COMPTMASK  0x0080  // Only valid in compatibility mode
39 #define _RWMASK     0x0F00  // Maske fuer R/W-Bits
40 #define _TYPEMASK   0xF000  // Maske fuer den Typ des Eintrags
41 
42 #define _READ       0x0100  // kann gelesen werden
43 #define _BWRITE     0x0200  // kann als Lvalue verwendet werden
44 #define _LVALUE     _BWRITE // kann als Lvalue verwendet werden
45 #define _READWRITE  0x0300  // beides
46 #define _OPT        0x0400  // Parameter ist optional
47 #define	_CONST		0x0800	// Property ist const
48 #define _METHOD     0x3000  // Masken-Bits fuer eine Methode
49 #define _PROPERTY   0x4000  // Masken-Bit fuer eine Property
50 #define _OBJECT     0x8000  // Masken-Bit fuer ein Objekt
51 							// Kombination von oberen Bits:
52 #define _FUNCTION   0x1100  // Maske fuer Function
53 #define _LFUNCTION  0x1300  // Maske fuer Function, die auch als Lvalue geht
54 #define _SUB        0x2100  // Maske fuer Sub
55 #define _ROPROP     0x4100  // Maske Read Only-Property
56 #define _WOPROP     0x4200  // Maske Write Only-Property
57 #define _RWPROP     0x4300  // Maske Read/Write-Property
58 #define	_CPROP		0x4900	// Maske fuer Konstante
59 
60 struct Methods {
61 	const char* pName;      // Name des Eintrags
62 	SbxDataType eType;      // Datentyp
63 	short       nArgs;      // Argumente und Flags
64 	RtlCall     pFunc;      // Function Pointer
65 	sal_uInt16		nHash;		// Hashcode
66 };
67 
68 static Methods aMethods[] = {
69 
70 { "AboutStarBasic", SbxNULL,      1 | _FUNCTION, RTLNAME(AboutStarBasic),0  },
71   { "Name",			SbxSTRING, 0,NULL,0 },
72 { "Abs",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Abs),0             },
73   { "number",       SbxDOUBLE, 0,NULL,0 },
74 { "Array",			SbxOBJECT,        _FUNCTION, RTLNAME(Array),0	 	    },
75 { "Asc",            SbxLONG,      1 | _FUNCTION, RTLNAME(Asc),0             },
76   { "string",       SbxSTRING, 0,NULL,0 },
77 { "AscW",           SbxLONG,      1 | _FUNCTION | _COMPTMASK, RTLNAME(Asc),0},
78   { "string",       SbxSTRING, 0,NULL,0 },
79 { "Atn",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Atn),0             },
80   { "number",       SbxDOUBLE, 0,NULL,0 },
81 { "ATTR_ARCHIVE",   SbxINTEGER,       _CPROP,    RTLNAME(ATTR_ARCHIVE),0    },
82 { "ATTR_DIRECTORY", SbxINTEGER,       _CPROP,    RTLNAME(ATTR_DIRECTORY),0  },
83 { "ATTR_HIDDEN",    SbxINTEGER,       _CPROP,    RTLNAME(ATTR_HIDDEN),0     },
84 { "ATTR_NORMAL",    SbxINTEGER,       _CPROP,    RTLNAME(ATTR_NORMAL),0     },
85 { "ATTR_READONLY",  SbxINTEGER,       _CPROP,    RTLNAME(ATTR_READONLY),0   },
86 { "ATTR_SYSTEM",    SbxINTEGER,       _CPROP,    RTLNAME(ATTR_SYSTEM),0     },
87 { "ATTR_VOLUME",    SbxINTEGER,       _CPROP,    RTLNAME(ATTR_VOLUME),0     },
88 
89 { "Beep",           SbxNULL,          _FUNCTION, RTLNAME(Beep),0            },
90 { "Blue",        SbxINTEGER,   1 | _FUNCTION, RTLNAME(Blue),0               },
91   { "RGB-Value",     SbxLONG, 0,NULL,0 },
92 
93 { "CallByName",     SbxVARIANT,	  3 | _FUNCTION, RTLNAME(CallByName),0 },
94   { "Object",		SbxOBJECT,  0,NULL,0 },
95   { "ProcedureName",SbxSTRING,  0,NULL,0 },
96   { "CallType",     SbxINTEGER, 0,NULL,0 },
97 { "CBool",          SbxBOOL,      1 | _FUNCTION, RTLNAME(CBool),0           },
98   { "expression",   SbxVARIANT, 0,NULL,0 },
99 { "CByte",          SbxBYTE,      1 | _FUNCTION, RTLNAME(CByte),0           },
100   { "expression",   SbxVARIANT, 0,NULL,0 },
101 { "CCur",           SbxCURRENCY,  1 | _FUNCTION, RTLNAME(CCur),0            },
102   { "expression",   SbxVARIANT, 0,NULL,0 },
103 { "CDate",          SbxDATE,      1 | _FUNCTION, RTLNAME(CDate),0           },
104   { "expression",   SbxVARIANT, 0,NULL,0 },
105 { "CDateFromIso",   SbxDATE,      1 | _FUNCTION, RTLNAME(CDateFromIso),0    },
106   { "IsoDate",      SbxSTRING, 0,NULL,0 },
107 { "CDateToIso",     SbxSTRING,    1 | _FUNCTION, RTLNAME(CDateToIso),0      },
108   { "Date",         SbxDATE, 0,NULL,0 },
109 { "CDec",           SbxDECIMAL,   1 | _FUNCTION, RTLNAME(CDec),0            },
110   { "expression",   SbxVARIANT, 0,NULL,0 },
111 { "CDbl",           SbxDOUBLE,    1 | _FUNCTION, RTLNAME(CDbl),0            },
112   { "expression",   SbxVARIANT, 0,NULL,0 },
113 { "CF_BITMAP",      SbxINTEGER,       _CPROP,    RTLNAME(CF_BITMAP),0       },
114 { "CF_METAFILEPICT",SbxINTEGER,       _CPROP,    RTLNAME(CF_METAFILEPICT),0 },
115 { "CF_TEXT",		SbxINTEGER,		  _CPROP,    RTLNAME(CF_TEXT),0         },
116 { "ChDir",          SbxNULL,      1 | _FUNCTION, RTLNAME(ChDir),0           },
117   { "string",       SbxSTRING, 0,NULL,0 },
118 { "ChDrive",        SbxNULL,      1 | _FUNCTION, RTLNAME(ChDrive),0         },
119   { "string",       SbxSTRING, 0,NULL,0 },
120 
121 { "Choose",			SbxVARIANT,   2 | _FUNCTION, RTLNAME(Choose),0			},
122   { "Index",   		SbxINTEGER, 0,NULL,0 },
123   { "Expression",   SbxVARIANT, 0,NULL,0 },
124 
125 { "Chr",            SbxSTRING,    1 | _FUNCTION, RTLNAME(Chr),0             },
126   { "string",       SbxINTEGER, 0,NULL,0 },
127 { "ChrW",           SbxSTRING,    1 | _FUNCTION | _COMPTMASK, RTLNAME(ChrW),0},
128   { "string",       SbxINTEGER, 0,NULL,0 },
129 
130 { "CInt",           SbxINTEGER,   1 | _FUNCTION, RTLNAME(CInt),0            },
131   { "expression",   SbxVARIANT, 0,NULL,0 },
132 { "CLEAR_ALLTABS",  SbxINTEGER,       _CPROP,    RTLNAME(CLEAR_ALLTABS),0   },
133 { "CLEAR_TAB",      SbxINTEGER,       _CPROP,    RTLNAME(CLEAR_TAB),0      	},
134 { "CLng",           SbxLONG,      1 | _FUNCTION, RTLNAME(CLng),0            },
135   { "expression",   SbxVARIANT, 0,NULL,0 },
136 { "CompatibilityMode",	SbxBOOL,  1 | _FUNCTION, RTLNAME(CompatibilityMode),0},
137   { "bEnable",		SbxBOOL, 0,NULL,0 },
138 { "ConvertFromUrl", SbxSTRING,    1 | _FUNCTION, RTLNAME(ConvertFromUrl),0  },
139   { "Url",          SbxSTRING, 0,NULL,0 },
140 { "ConvertToUrl",   SbxSTRING,    1 | _FUNCTION, RTLNAME(ConvertToUrl),0    },
141   { "SystemPath",   SbxSTRING, 0,NULL,0 },
142 { "Cos",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Cos),0             },
143   { "number",       SbxDOUBLE, 0,NULL,0 },
144 { "CreateObject",   SbxOBJECT,    1 | _FUNCTION, RTLNAME( CreateObject ),0  },
145   { "class",        SbxSTRING, 0,NULL,0 },
146 { "CaptureAssertions",  SbxNULL, 1 | _FUNCTION, RTLNAME(CaptureAssertions), 0 },
147   { "methodName",   SbxSTRING, 0, NULL, 0 },
148 { "CreateUnoListener",SbxOBJECT,   1 | _FUNCTION, RTLNAME( CreateUnoListener ),0 },
149   { "prefix",  SbxSTRING, 0,NULL,0 },
150   { "typename",  SbxSTRING, 0,NULL,0 },
151 { "CreateUnoDialog",SbxOBJECT,    2 | _FUNCTION, RTLNAME( CreateUnoDialog ),0 },
152   { "dialoglibrary",SbxOBJECT, 0,NULL,0 },
153   { "dialogname",   SbxSTRING, 0,NULL,0 },
154 { "CreateUnoService",SbxOBJECT,   1 | _FUNCTION, RTLNAME( CreateUnoService ),0 },
155   { "servicename",  SbxSTRING, 0,NULL,0 },
156 { "CreateUnoServiceWithArguments",SbxOBJECT,   2 | _FUNCTION, RTLNAME( CreateUnoServiceWithArguments ),0 },
157   { "servicename",  SbxSTRING, 0,NULL,0 },
158   { "arguments",  SbxARRAY, 0,NULL,0 },
159 { "CreateUnoStruct",SbxOBJECT,    1 | _FUNCTION, RTLNAME( CreateUnoStruct ),0 },
160   { "classname",    SbxSTRING, 0,NULL,0 },
161 { "CreateUnoValue", SbxOBJECT,    2 | _FUNCTION, RTLNAME( CreateUnoValue ),0 },
162   { "type",         SbxSTRING, 0,NULL,0 },
163   { "value",        SbxVARIANT, 0,NULL,0 },
164 { "CreatePropertySet",SbxOBJECT, 1 | _FUNCTION, RTLNAME( CreatePropertySet ),0 },
165   { "values",  SbxARRAY, 0,NULL,0 },
166 { "CSng",           SbxSINGLE,    1 | _FUNCTION, RTLNAME(CSng),0            },
167   { "expression",   SbxVARIANT, 0,NULL,0 },
168 { "CStr",           SbxSTRING,    1 | _FUNCTION, RTLNAME(CStr),0            },
169   { "expression",   SbxVARIANT, 0,NULL,0 },
170 { "CurDir",         SbxSTRING,    1 | _FUNCTION, RTLNAME(CurDir),0          },
171   { "string",       SbxSTRING, 0,NULL,0 },
172 { "CVar",           SbxVARIANT,   1 | _FUNCTION, RTLNAME(CVar),0            },
173   { "expression",   SbxVARIANT, 0,NULL,0 },
174 { "CVErr",          SbxVARIANT,   1 | _FUNCTION, RTLNAME(CVErr),0           },
175   { "expression",   SbxVARIANT, 0,NULL,0 },
176 
177 { "Date",           SbxDATE,          _LFUNCTION,RTLNAME(Date),0            },
178 { "DateAdd",        SbxDATE,	  3 | _FUNCTION, RTLNAME(DateAdd),0         },
179   { "Interval",     SbxSTRING, 0,NULL,0 },
180   { "Number",     	SbxLONG, 0,NULL,0 },
181   { "Date",			SbxDATE, 0,NULL,0 },
182 { "DateDiff",       SbxDOUBLE,    5 | _FUNCTION, RTLNAME(DateDiff),0        },
183   { "Interval",     SbxSTRING, 0,NULL,0 },
184   { "Date1",     	SbxDATE, 0,NULL,0 },
185   { "Date2",		SbxDATE, 0,NULL,0 },
186   { "Firstdayofweek" , SbxINTEGER, _OPT,NULL,0 },
187   { "Firstweekofyear", SbxINTEGER, _OPT,NULL,0 },
188 { "DatePart",       SbxLONG,      4 | _FUNCTION, RTLNAME(DatePart),0        },
189   { "Interval",     SbxSTRING, 0,NULL,0 },
190   { "Date",     	SbxDATE, 0,NULL,0 },
191   { "Firstdayofweek" , SbxINTEGER, _OPT, NULL,0 },
192   { "Firstweekofyear", SbxINTEGER, _OPT, NULL,0 },
193 { "DateSerial",     SbxDATE,      3 | _FUNCTION, RTLNAME(DateSerial),0      },
194   { "Year",         SbxINTEGER, 0,NULL,0 },
195   { "Month",        SbxINTEGER, 0,NULL,0 },
196   { "Day",          SbxINTEGER, 0,NULL,0 },
197 { "DateValue",      SbxDATE,      1 | _FUNCTION, RTLNAME(DateValue),0       },
198   { "String",       SbxSTRING, 0,NULL,0 },
199 { "Day",            SbxINTEGER,   1 | _FUNCTION, RTLNAME(Day),0             },
200   { "Date",         SbxDATE, 0,NULL,0 },
201 { "Ddeexecute",     SbxNULL,   2 | _FUNCTION, RTLNAME(DDEExecute),0         },
202   { "Channel",         SbxLONG, 0,NULL,0 },
203   { "Command",         SbxSTRING, 0,NULL,0 },
204 { "Ddeinitiate",    SbxINTEGER,   2 | _FUNCTION, RTLNAME(DDEInitiate),0     },
205   { "Application",     SbxSTRING, 0,NULL,0 },
206   { "Topic",           SbxSTRING, 0,NULL,0 },
207 { "Ddepoke",    	SbxNULL,   3 | _FUNCTION, RTLNAME(DDEPoke),0            },
208   { "Channel",         SbxLONG, 0,NULL,0 },
209   { "Item",     	   SbxSTRING, 0,NULL,0 },
210   { "Data",            SbxSTRING, 0,NULL,0 },
211 { "Dderequest",     SbxSTRING,   2 | _FUNCTION, RTLNAME(DDERequest),0       },
212   { "Channel",         SbxLONG, 0,NULL,0 },
213   { "Item",            SbxSTRING, 0,NULL,0 },
214 { "Ddeterminate",   SbxNULL,   1 | _FUNCTION, RTLNAME(DDETerminate),0       },
215   { "Channel",         SbxLONG, 0,NULL,0 },
216 { "Ddeterminateall",   SbxNULL,   _FUNCTION, RTLNAME(DDETerminateAll),0     },
217 { "DimArray",		SbxOBJECT,    _FUNCTION, RTLNAME(DimArray),0			},
218 { "Dir",            SbxSTRING,    2 | _FUNCTION, RTLNAME(Dir),0             },
219   { "FileSpec",     SbxSTRING,        _OPT, NULL,0 },
220   { "attrmask",     SbxINTEGER,       _OPT, NULL,0 },
221 { "DoEvents",		SbxEMPTY,     _FUNCTION, RTLNAME(DoEvents),0			},
222 { "DumpAllObjects", SbxEMPTY,     2 | _SUB, RTLNAME(DumpAllObjects),0       },
223   { "FileSpec",     SbxSTRING, 0,NULL,0 },
224   { "DumpAll",      SbxINTEGER,		  _OPT, NULL,0 },
225 
226 { "Empty",        SbxVARIANT,        _CPROP,    RTLNAME(Empty),0         },
227 { "EqualUnoObjects",SbxBOOL,      2 | _FUNCTION, RTLNAME(EqualUnoObjects),0 },
228   { "Variant",      SbxVARIANT, 0,NULL,0 },
229   { "Variant",      SbxVARIANT, 0,NULL,0 },
230 { "EnableReschedule",	SbxNULL,  1 | _FUNCTION, RTLNAME(EnableReschedule),0},
231   { "bEnable",		SbxBOOL, 0,NULL,0 },
232 { "Environ",            SbxSTRING,   1 | _FUNCTION, RTLNAME(Environ),0      },
233   { "Environmentstring",SbxSTRING, 0,NULL,0 },
234 { "EOF",            SbxBOOL,      1 | _FUNCTION, RTLNAME(EOF),0             },
235   { "Channel",      SbxINTEGER, 0,NULL,0 },
236 { "Erl",            SbxLONG,          _ROPROP,   RTLNAME( Erl ),0           },
237 { "Err",            SbxVARIANT,       _RWPROP,   RTLNAME( Err ),0           },
238 { "Error",          SbxSTRING,    1 | _FUNCTION, RTLNAME( Error ),0         },
239   { "code",         SbxLONG, 0,NULL,0 },
240 { "Exp",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Exp),0             },
241   { "number",       SbxDOUBLE, 0,NULL,0 },
242 
243 { "False",          SbxBOOL,          _CPROP,    RTLNAME(False),0           },
244 { "FileAttr",       SbxINTEGER,   2 | _FUNCTION, RTLNAME(FileAttr),0        },
245   { "Channel",      SbxINTEGER, 0,NULL,0 },
246   { "Attributes",   SbxINTEGER, 0,NULL,0 },
247 { "FileCopy",       SbxNULL,      2 | _FUNCTION, RTLNAME(FileCopy),0        },
248   { "Source",       SbxSTRING, 0,NULL,0 },
249   { "Destination",  SbxSTRING, 0,NULL,0 },
250 { "FileDateTime",   SbxSTRING,    1 | _FUNCTION, RTLNAME(FileDateTime),0    },
251   { "filename",     SbxSTRING, 0,NULL,0 },
252 { "FileExists",     SbxBOOL,   1 | _FUNCTION, RTLNAME(FileExists),0         },
253   { "filename",     SbxSTRING, 0,NULL,0 },
254 { "FileLen",        SbxLONG,      1 | _FUNCTION, RTLNAME(FileLen),0         },
255   { "filename",     SbxSTRING, 0,NULL,0 },
256 { "FindObject",		SbxOBJECT,	  1 | _FUNCTION, RTLNAME(FindObject),0      },
257   { "Name",  SbxSTRING, 0,NULL,0 },
258 { "FindPropertyObject",   SbxOBJECT,	  2 | _FUNCTION, RTLNAME(FindPropertyObject),0 },
259   { "Object",		SbxOBJECT, 0,NULL,0 },
260   { "Name",  SbxSTRING, 0,NULL,0 },
261 { "Fix",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Fix),0             },
262   { "number",       SbxDOUBLE, 0,NULL,0 },
263 { "Format",         SbxSTRING,    2 | _FUNCTION, RTLNAME(Format),0          },
264   { "expression",   SbxVARIANT, 0,NULL,0 },
265   { "format",       SbxSTRING,        _OPT, NULL,0 },
266 { "FormatDateTime", SbxSTRING,    2 | _FUNCTION | _COMPTMASK, RTLNAME(FormatDateTime),0 },
267   { "Date",         SbxDATE, 0,NULL,0 },
268   { "NamedFormat",  SbxINTEGER,        _OPT, NULL,0 },
269 { "FRAMEANCHORCHAR",   		SbxINTEGER,       _CPROP,    RTLNAME(FRAMEANCHORCHAR),0 },
270 { "FRAMEANCHORPAGE",   		SbxINTEGER,       _CPROP,    RTLNAME(FRAMEANCHORPAGE),0 },
271 { "FRAMEANCHORPARA",   		SbxINTEGER,       _CPROP,    RTLNAME(FRAMEANCHORPARA),0 },
272 { "FreeFile",       SbxINTEGER,    _FUNCTION, RTLNAME(FreeFile),0           },
273 { "FreeLibrary",    SbxNULL,      1 | _FUNCTION, RTLNAME(FreeLibrary),0     },
274   { "Modulename",   SbxSTRING, 0,NULL,0 },
275 
276 { "Get",            SbxNULL,   3 | _FUNCTION, RTLNAME(Get),0                },
277   { "filenumber",   SbxINTEGER, 0,NULL,0 },
278   { "recordnumber", SbxLONG, 0,NULL,0 },
279   { "variablename",	SbxVARIANT, 0,NULL,0 },
280 { "GetAttr",        SbxINTEGER,   1 | _FUNCTION, RTLNAME(GetAttr),0         },
281   { "filename",     SbxSTRING, 0,NULL,0 },
282 { "GetDefaultContext", SbxOBJECT, 0 | _FUNCTION, RTLNAME(GetDefaultContext),0 },
283 { "GetDialogZoomFactorX",  SbxDOUBLE,     _FUNCTION,RTLNAME(GetDialogZoomFactorX),0 },
284 { "GetDialogZoomFactorY",  SbxDOUBLE,     _FUNCTION,RTLNAME(GetDialogZoomFactorY),0 },
285 { "GetGUIType",  SbxINTEGER,     _FUNCTION,RTLNAME(GetGUIType),0            },
286 { "GetGUIVersion",  SbxLONG,     _FUNCTION,RTLNAME(GetGUIVersion),0         },
287 { "GetPathSeparator",  SbxSTRING,     _FUNCTION,RTLNAME(GetPathSeparator),0 },
288 { "GetProcessServiceManager", SbxOBJECT, 0 | _FUNCTION, RTLNAME(GetProcessServiceManager),0 },
289 { "GetSolarVersion",  SbxLONG,     _FUNCTION,RTLNAME(GetSolarVersion),0     },
290 { "GetSystemTicks",  SbxLONG,      _FUNCTION,RTLNAME(GetSystemTicks),0      },
291 { "GetSystemType",  SbxINTEGER,    _FUNCTION,RTLNAME(GetSystemType),0       },
292 { "GlobalScope",    SbxOBJECT,     _FUNCTION,RTLNAME(GlobalScope),0         },
293 { "Green",          SbxINTEGER,   1 | _FUNCTION, RTLNAME(Green),0           },
294   { "RGB-Value",     SbxLONG, 0,NULL,0 },
295 
296 { "HasUnoInterfaces",	SbxBOOL,  1 | _FUNCTION, RTLNAME(HasUnoInterfaces),0},
297   { "InterfaceName",SbxSTRING, 0,NULL,0 },
298 { "Hex",            SbxSTRING,    1 | _FUNCTION, RTLNAME(Hex),0             },
299   { "number",       SbxLONG, 0,NULL,0 },
300 { "Hour",           SbxINTEGER,   1 | _FUNCTION, RTLNAME(Hour),0            },
301   { "Date",         SbxDATE, 0,NULL,0 },
302 
303 { "IDABORT",   		SbxINTEGER,       _CPROP,    RTLNAME(IDABORT),0      	},
304 { "IDCANCEL",   	SbxINTEGER,       _CPROP,    RTLNAME(IDCANCEL),0      	},
305 { "IDNO",   		SbxINTEGER,       _CPROP,    RTLNAME(IDNO),0      		},
306 { "IDOK",   		SbxINTEGER,       _CPROP,    RTLNAME(IDOK),0      		},
307 { "IDRETRY",   		SbxINTEGER,       _CPROP,    RTLNAME(IDRETRY),0      	},
308 { "IDYES",   		SbxINTEGER,       _CPROP,    RTLNAME(IDYES),0      		},
309 
310 { "Iif",            SbxVARIANT,   3 | _FUNCTION, RTLNAME(Iif),0             },
311   { "Bool",      	SbxBOOL, 0,NULL,0 },
312   { "Variant1",     SbxVARIANT, 0,NULL,0 },
313   { "Variant2",     SbxVARIANT, 0,NULL,0 },
314 
315 { "Input",			SbxSTRING,    2 | _FUNCTION | _COMPTMASK, RTLNAME(Input),0},
316   { "Number",       SbxLONG, 0,NULL,0 },
317   { "FileNumber",   SbxLONG, 0,NULL,0 },
318 { "InputBox",       SbxSTRING,    5 | _FUNCTION, RTLNAME(InputBox),0        },
319   { "Prompt",       SbxSTRING, 0,NULL,0 },
320   { "Title",        SbxSTRING,        _OPT, NULL,0 },
321   { "Default",      SbxSTRING,        _OPT, NULL,0 },
322   { "XPosTwips",    SbxLONG,          _OPT, NULL,0 },
323   { "YPosTwips",    SbxLONG,          _OPT, NULL,0 },
324 { "InStr",          SbxLONG,      4 | _FUNCTION, RTLNAME(InStr),0           },
325   { "Start",        SbxSTRING,        _OPT, NULL,0 },
326   { "String1",      SbxSTRING, 0,NULL,0 },
327   { "String2",      SbxSTRING, 0,NULL,0 },
328   { "Compare",      SbxINTEGER,       _OPT, NULL,0 },
329 { "InStrRev",       SbxLONG,      4 | _FUNCTION | _COMPTMASK, RTLNAME(InStrRev),0},
330   { "String1",      SbxSTRING, 0,NULL,0 },
331   { "String2",      SbxSTRING, 0,NULL,0 },
332   { "Start",        SbxSTRING,        _OPT, NULL,0 },
333   { "Compare",      SbxINTEGER,       _OPT, NULL,0 },
334 { "Int",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Int),0             },
335   { "number",       SbxDOUBLE, 0,NULL,0 },
336 { "IsArray",        SbxBOOL,      1 | _FUNCTION, RTLNAME(IsArray),0         },
337   { "Variant",      SbxVARIANT, 0,NULL,0 },
338 { "IsDate",         SbxBOOL,      1 | _FUNCTION, RTLNAME(IsDate),0          },
339   { "Variant",      SbxVARIANT, 0,NULL,0 },
340 { "IsEmpty",        SbxBOOL,      1 | _FUNCTION, RTLNAME(IsEmpty),0         },
341   { "Variant",      SbxVARIANT, 0,NULL,0 },
342 { "IsError",        SbxBOOL,      1 | _FUNCTION, RTLNAME(IsError),0         },
343   { "Variant",      SbxVARIANT, 0,NULL,0 },
344 { "IsMissing",        SbxBOOL,      1 | _FUNCTION, RTLNAME(IsMissing),0     },
345   { "Variant",      SbxVARIANT, 0,NULL,0 },
346 { "IsNull",         SbxBOOL,      1 | _FUNCTION, RTLNAME(IsNull),0          },
347   { "Variant",      SbxVARIANT, 0,NULL,0 },
348 { "IsNumeric",      SbxBOOL,      1 | _FUNCTION, RTLNAME(IsNumeric),0       },
349   { "Variant",      SbxVARIANT, 0,NULL,0 },
350 { "IsObject",       SbxBOOL,      1 | _FUNCTION, RTLNAME(IsObject),0        },
351   { "Variant",      SbxVARIANT, 0,NULL,0 },
352 { "IsUnoStruct",    SbxBOOL,      1 | _FUNCTION, RTLNAME(IsUnoStruct),0     },
353   { "Variant",      SbxVARIANT, 0,NULL,0 },
354 { "Join",         	SbxSTRING,      2 | _FUNCTION, RTLNAME(Join),0          },
355   { "list",			SbxOBJECT, 0,NULL,0 },
356   { "delimiter",    SbxSTRING, 0,NULL,0 },
357 { "Kill",           SbxNULL,      1 | _FUNCTION, RTLNAME(Kill),0            },
358   { "filespec",     SbxSTRING, 0,NULL,0 },
359 { "LBound",       	SbxLONG,      1 | _FUNCTION, RTLNAME(LBound),0          },
360   { "Variant",      SbxVARIANT, 0,NULL,0 },
361 { "LCase",          SbxSTRING,    1 | _FUNCTION, RTLNAME(LCase),0           },
362   { "string",       SbxSTRING, 0,NULL,0 },
363 { "Left",           SbxSTRING,    2 | _FUNCTION, RTLNAME(Left),0            },
364   { "String",       SbxSTRING, 0,NULL,0 },
365   { "Count",        SbxLONG, 0,NULL,0 },
366 { "Len",            SbxLONG,      1 | _FUNCTION, RTLNAME(Len),0             },
367   { "StringOrVariant", SbxVARIANT, 0,NULL,0 },
368 { "LenB",           SbxLONG,      1 | _FUNCTION, RTLNAME(Len),0             },
369   { "StringOrVariant", SbxVARIANT, 0,NULL,0 },
370 { "Load",           SbxNULL,      1 | _FUNCTION, RTLNAME(Load),0            },
371   { "object",       SbxOBJECT, 0,NULL,0 },
372 { "LoadPicture",    SbxOBJECT,    1 | _FUNCTION, RTLNAME(LoadPicture),0     },
373   { "string",       SbxSTRING, 0,NULL,0 },
374 { "Loc",            SbxLONG,      1 | _FUNCTION, RTLNAME(Loc),0             },
375   { "Channel",      SbxINTEGER, 0,NULL,0 },
376 { "Lof",            SbxLONG,      1 | _FUNCTION, RTLNAME(Lof),0             },
377   { "Channel",      SbxINTEGER, 0,NULL,0 },
378 { "Log",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Log),0             },
379   { "number",       SbxDOUBLE, 0,NULL,0 },
380 { "LTrim",          SbxSTRING,    1 | _FUNCTION, RTLNAME(LTrim),0           },
381   { "string",       SbxSTRING, 0,NULL,0 },
382 
383 { "MB_ABORTRETRYIGNORE", SbxINTEGER,  _CPROP,    RTLNAME(MB_ABORTRETRYIGNORE),0},
384 { "MB_APPLMODAL",   SbxINTEGER,       _CPROP,    RTLNAME(MB_APPLMODAL),0    },
385 { "MB_DEFBUTTON1",  SbxINTEGER,       _CPROP,    RTLNAME(MB_DEFBUTTON1),0   },
386 { "MB_DEFBUTTON2",  SbxINTEGER,       _CPROP,    RTLNAME(MB_DEFBUTTON2),0   },
387 { "MB_DEFBUTTON3",  SbxINTEGER,       _CPROP,    RTLNAME(MB_DEFBUTTON3),0   },
388 { "MB_ICONEXCLAMATION", SbxINTEGER,   _CPROP,    RTLNAME(MB_ICONEXCLAMATION),0},
389 { "MB_ICONINFORMATION", SbxINTEGER,   _CPROP,    RTLNAME(MB_ICONINFORMATION),0},
390 { "MB_ICONQUESTION",SbxINTEGER,       _CPROP,    RTLNAME(MB_ICONQUESTION),0 },
391 { "MB_ICONSTOP",   	SbxINTEGER,       _CPROP,    RTLNAME(MB_ICONSTOP),0     },
392 { "MB_OK",   		SbxINTEGER,       _CPROP,    RTLNAME(MB_OK),0      		},
393 { "MB_OKCANCEL",   	SbxINTEGER,       _CPROP,    RTLNAME(MB_OKCANCEL),0     },
394 { "MB_RETRYCANCEL", SbxINTEGER,       _CPROP,    RTLNAME(MB_RETRYCANCEL),0  },
395 { "MB_SYSTEMMODAL", SbxINTEGER,       _CPROP,    RTLNAME(MB_SYSTEMMODAL),0  },
396 { "MB_YESNO",   	SbxINTEGER,       _CPROP,    RTLNAME(MB_YESNO),0      	},
397 { "MB_YESNOCANCEL", SbxINTEGER,       _CPROP,    RTLNAME(MB_YESNOCANCEL),0  },
398 
399 { "Me",		        SbxOBJECT,    0 | _FUNCTION | _COMPTMASK, RTLNAME(Me),0 },
400 { "Mid",            SbxSTRING,    3 | _LFUNCTION,RTLNAME(Mid),0             },
401   { "String",       SbxSTRING, 0,NULL,0 },
402   { "StartPos",     SbxLONG, 0,NULL,0 },
403   { "Length",       SbxLONG,          _OPT, NULL,0 },
404 { "Minute",         SbxINTEGER,   1 | _FUNCTION, RTLNAME(Minute),0          },
405   { "Date",         SbxDATE, 0,NULL,0 },
406 { "MkDir",          SbxNULL,      1 | _FUNCTION, RTLNAME(MkDir),0           },
407   { "pathname",     SbxSTRING, 0,NULL,0 },
408 { "Month",          SbxINTEGER,   1 | _FUNCTION, RTLNAME(Month),0           },
409   { "Date",         SbxDATE, 0,NULL,0 },
410 { "MonthName",      SbxSTRING,    2 | _FUNCTION | _COMPTMASK, RTLNAME(MonthName),0 },
411   { "Month",        SbxINTEGER, 0,NULL,0 },
412   { "Abbreviate",   SbxBOOL,          _OPT, NULL,0 },
413 { "MsgBox",         SbxINTEGER,    5 | _FUNCTION, RTLNAME(MsgBox),0         },
414   { "Prompt",       SbxSTRING, 0,NULL,0 },
415   { "Buttons",      SbxINTEGER,       _OPT, NULL,0 },
416   { "Title",        SbxSTRING,        _OPT, NULL,0 },
417   { "Helpfile",     SbxSTRING,        _OPT, NULL,0 },
418   { "Context",      SbxINTEGER,       _OPT, NULL,0 },
419 
420 { "Nothing",        SbxOBJECT,        _CPROP,    RTLNAME(Nothing),0         },
421 { "Now",            SbxDATE,          _FUNCTION, RTLNAME(Now),0             },
422 { "Null",			SbxNULL,          _CPROP,    RTLNAME(Null),0			},
423 
424 { "Oct",            SbxSTRING,    1 | _FUNCTION, RTLNAME(Oct),0             },
425   { "number",       SbxLONG, 0,NULL,0 },
426 
427 { "Partition",      SbxSTRING,    4 | _FUNCTION, RTLNAME(Partition),0       },
428   { "number",   	SbxLONG, 	0,NULL,0 },
429   { "start",     	SbxLONG, 	0,NULL,0 },
430   { "stop",  	    SbxLONG, 	0,NULL,0 },
431   { "interval",     SbxLONG, 	0,NULL,0 },
432 { "Pi",				SbxDOUBLE,		  _CPROP,    RTLNAME(PI),0		      	},
433 { "Put",            SbxNULL,   3 | _FUNCTION, RTLNAME(Put),0                },
434   { "filenumber",   SbxINTEGER, 0,NULL,0 },
435   { "recordnumber", SbxLONG, 0,NULL,0 },
436   { "variablename",	SbxVARIANT, 0,NULL,0 },
437 
438 { "QBColor",		SbxLONG,	  1 | _FUNCTION, RTLNAME(QBColor),0			},
439   { "number",		SbxINTEGER, 0,NULL,0 },
440 
441 { "Randomize",      SbxNULL,      1 | _FUNCTION, RTLNAME(Randomize),0       },
442   { "Number",       SbxDOUBLE,        _OPT, NULL,0 },
443 { "Red",        SbxINTEGER,   1 | _FUNCTION, RTLNAME(Red),0                 },
444   { "RGB-Value",     SbxLONG, 0,NULL,0 },
445 { "Reset",          SbxNULL,      0 | _FUNCTION, RTLNAME(Reset),0           },
446 { "ResolvePath",    SbxSTRING,    1 | _FUNCTION, RTLNAME(ResolvePath),0     },
447   { "Path",         SbxSTRING, 0,NULL,0 },
448 { "RGB",            SbxLONG,      3 | _FUNCTION, RTLNAME(RGB),0             },
449   { "Red",       	SbxINTEGER, 0,NULL,0 },
450   { "Green",       	SbxINTEGER, 0,NULL,0 },
451   { "Blue",       	SbxINTEGER, 0,NULL,0 },
452 { "Replace",        SbxSTRING,    6 | _FUNCTION, RTLNAME(Replace),0         },
453   { "Expression",   SbxSTRING, 0,NULL,0 },
454   { "Find",     	SbxSTRING, 0,NULL,0 },
455   { "Replace",      SbxSTRING, 0,NULL,0 },
456   { "Start",        SbxINTEGER, 	_OPT, NULL,0 },
457   { "Count",        SbxINTEGER,		_OPT, NULL,0 },
458   { "Compare",      SbxINTEGER,		_OPT, NULL,0 },
459 { "Right",          SbxSTRING,    2 | _FUNCTION, RTLNAME(Right),0           },
460   { "String",       SbxSTRING, 0,NULL,0 },
461   { "Count",        SbxLONG, 0,NULL,0 },
462 { "RmDir",          SbxNULL,      1 | _FUNCTION, RTLNAME(RmDir),0           },
463   { "pathname",     SbxSTRING, 0,NULL,0 },
464 { "Round",          SbxDOUBLE,    2 | _FUNCTION | _COMPTMASK, RTLNAME(Round),0},
465   { "Expression",   SbxDOUBLE, 0,NULL,0 },
466   { "Numdecimalplaces", SbxINTEGER,   _OPT, NULL,0 },
467 { "Rnd",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Rnd),0             },
468   { "Number",       SbxDOUBLE,        _OPT, NULL,0 },
469 { "RTL",			SbxOBJECT,    0 | _FUNCTION | _COMPTMASK, RTLNAME(RTL),0},
470 { "RTrim",          SbxSTRING,    1 | _FUNCTION, RTLNAME(RTrim),0           },
471   { "string",       SbxSTRING, 0,NULL,0 },
472 
473 { "SavePicture",    SbxNULL,      2 | _FUNCTION, RTLNAME(SavePicture),0     },
474   { "object",       SbxOBJECT, 0,NULL,0 },
475   { "string",       SbxSTRING, 0,NULL,0 },
476 { "Second",         SbxINTEGER,   1 | _FUNCTION, RTLNAME(Second),0          },
477   { "Date",         SbxDATE, 0,NULL,0 },
478 { "Seek",           SbxLONG,      1 | _FUNCTION, RTLNAME(Seek),0            },
479   { "Channel",      SbxINTEGER, 0,NULL,0 },
480 { "SendKeys",       SbxNULL,      2 | _FUNCTION, RTLNAME(SendKeys),0        },
481   { "String",       SbxSTRING, 0,NULL,0 },
482   { "Wait",         SbxBOOL,          _OPT, NULL,0 },
483 { "SetAttr",        SbxNULL,      2 | _FUNCTION, RTLNAME(SetAttr),0         },
484   { "File"  ,       SbxSTRING, 0,NULL,0 },
485   { "Attributes",   SbxINTEGER, 0,NULL,0 },
486 { "SET_OFF",   		SbxINTEGER,       _CPROP,    RTLNAME(SET_OFF),0      	},
487 { "SET_ON",   		SbxINTEGER,       _CPROP,    RTLNAME(SET_ON),0      	},
488 { "SET_TAB",   		SbxINTEGER,       _CPROP,    RTLNAME(SET_TAB),0      	},
489 { "Sgn",            SbxINTEGER,   1 | _FUNCTION, RTLNAME(Sgn),0             },
490   { "number",       SbxDOUBLE, 0,NULL,0 },
491 { "Shell",          SbxLONG,      2 | _FUNCTION, RTLNAME(Shell),0           },
492   { "Commandstring",SbxSTRING, 0,NULL,0 },
493   { "WindowStyle",  SbxINTEGER,       _OPT, NULL,0 },
494 { "Sin",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Sin),0             },
495   { "number",       SbxDOUBLE, 0,NULL,0 },
496 { "Space",          SbxSTRING,      1 | _FUNCTION, RTLNAME(Space),0         },
497   { "string",       SbxLONG, 0,NULL,0 },
498 { "Spc",          	SbxSTRING,      1 | _FUNCTION, RTLNAME(Spc),0           },
499   { "Count",        SbxLONG, 0,NULL,0 },
500 { "Split",         	SbxOBJECT,      3 | _FUNCTION, RTLNAME(Split),0         },
501   { "expression",	SbxSTRING, 0,NULL,0 },
502   { "delimiter",    SbxSTRING, 0,NULL,0 },
503   { "count",	    SbxLONG, 0,NULL,0 },
504 { "Sqr",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Sqr),0             },
505   { "number",       SbxDOUBLE, 0,NULL,0 },
506 { "Str",            SbxSTRING,    1 | _FUNCTION, RTLNAME(Str),0             },
507   { "number",       SbxDOUBLE, 0,NULL,0 },
508 { "StrComp",        SbxINTEGER,   3 | _FUNCTION, RTLNAME(StrComp),0         },
509   { "String1",      SbxSTRING, 0,NULL,0 },
510   { "String2",      SbxSTRING, 0,NULL,0 },
511   { "Compare",      SbxINTEGER,       _OPT, NULL,0 },
512 { "StrConv",        SbxOBJECT,   3 | _FUNCTION, RTLNAME(StrConv),0          },
513   { "String",       SbxSTRING, 0,NULL,0 },
514   { "Conversion",   SbxSTRING, 0,NULL,0 },
515   { "LCID",			SbxINTEGER, _OPT,NULL,0 },
516 { "String",         SbxSTRING,    2 | _FUNCTION, RTLNAME(String),0          },
517   { "Count",        SbxLONG, 0,NULL,0 },
518   { "Filler",       SbxVARIANT, 0,NULL,0 },
519 { "StrReverse",     SbxSTRING,    1 | _FUNCTION | _COMPTMASK, RTLNAME(StrReverse),0 },
520   { "String1",      SbxSTRING, 0,NULL,0 },
521 { "Switch",			SbxVARIANT,   2 | _FUNCTION, RTLNAME(Switch),0			},
522   { "Expression",   SbxVARIANT, 0,NULL,0 },
523   { "Value",        SbxVARIANT, 0,NULL,0 },
524 { "Tab",          	SbxSTRING,      1 | _FUNCTION, RTLNAME(Tab),0           },
525   { "Count",        SbxLONG, 0,NULL,0 },
526 { "Tan",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Tan),0             },
527   { "number",       SbxDOUBLE, 0,NULL,0 },
528 { "Time",           SbxVARIANT,       _LFUNCTION,RTLNAME(Time),0            },
529 { "Timer",          SbxDATE,          _FUNCTION, RTLNAME(Timer),0           },
530 { "TimeSerial",     SbxDATE,      3 | _FUNCTION, RTLNAME(TimeSerial),0      },
531   { "Hour",         SbxLONG, 0,NULL,0 },
532   { "Minute",       SbxLONG, 0,NULL,0 },
533   { "Second",       SbxLONG, 0,NULL,0 },
534 { "TimeValue",      SbxDATE,      1 | _FUNCTION, RTLNAME(TimeValue),0       },
535   { "String",       SbxSTRING, 0,NULL,0 },
536 { "TOGGLE",   		SbxINTEGER,       _CPROP,    RTLNAME(TOGGLE),0      	},
537 #ifdef DBG_TRACE_BASIC
538 { "TraceCommand",   SbxNULL,	  1 | _FUNCTION, RTLNAME(TraceCommand),0 },
539   { "Command",		SbxSTRING,  0,NULL,0 },
540 #endif
541 { "Trim",           SbxSTRING,    1 | _FUNCTION, RTLNAME(Trim),0            },
542   { "String",       SbxSTRING, 0,NULL,0 },
543 { "True",           SbxBOOL,          _CPROP,    RTLNAME(True),0            },
544 { "TwipsPerPixelX", SbxLONG,          _FUNCTION, RTLNAME(TwipsPerPixelX),0  },
545 { "TwipsPerPixelY", SbxLONG,          _FUNCTION, RTLNAME(TwipsPerPixelY),0  },
546 
547 { "TYP_AUTHORFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_AUTHORFLD),0      	},
548 { "TYP_CHAPTERFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_CHAPTERFLD),0      },
549 { "TYP_CONDTXTFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_CONDTXTFLD),0      },
550 { "TYP_DATEFLD",   			SbxINTEGER,       _CPROP,    RTLNAME(TYP_DATEFLD),0      	},
551 { "TYP_DBFLD",   			SbxINTEGER,       _CPROP,    RTLNAME(TYP_DBFLD),0      		},
552 { "TYP_DBNAMEFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_DBNAMEFLD),0      	},
553 { "TYP_DBNEXTSETFLD",		SbxINTEGER,       _CPROP,    RTLNAME(TYP_DBNEXTSETFLD),0	},
554 { "TYP_DBNUMSETFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_DBNUMSETFLD),0     },
555 { "TYP_DBSETNUMBERFLD",   	SbxINTEGER,       _CPROP,    RTLNAME(TYP_DBSETNUMBERFLD),0  },
556 { "TYP_DDEFLD",   			SbxINTEGER,       _CPROP,    RTLNAME(TYP_DDEFLD),0      	},
557 { "TYP_DOCINFOFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_DOCINFOFLD),0      },
558 { "TYP_DOCSTATFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_DOCSTATFLD),0      },
559 { "TYP_EXTUSERFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_EXTUSERFLD),0      },
560 { "TYP_FILENAMEFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_FILENAMEFLD),0     },
561 { "TYP_FIXDATEFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_FIXDATEFLD),0      },
562 { "TYP_FIXTIMEFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_FIXTIMEFLD),0      },
563 { "TYP_FORMELFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_FORMELFLD),0      	},
564 { "TYP_GETFLD",   			SbxINTEGER,       _CPROP,    RTLNAME(TYP_GETFLD),0      	},
565 { "TYP_GETREFFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_GETREFFLD),0      	},
566 { "TYP_GETREFPAGEFLD",   	SbxINTEGER,       _CPROP,    RTLNAME(TYP_GETREFPAGEFLD),0   },
567 { "TYP_HIDDENPARAFLD",   	SbxINTEGER,       _CPROP,    RTLNAME(TYP_HIDDENPARAFLD),0   },
568 { "TYP_HIDDENTXTFLD",   	SbxINTEGER,       _CPROP,    RTLNAME(TYP_HIDDENTXTFLD),0    },
569 { "TYP_INPUTFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_INPUTFLD),0      	},
570 { "TYP_INTERNETFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_INTERNETFLD),0     },
571 { "TYP_JUMPEDITFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_JUMPEDITFLD),0     },
572 { "TYP_MACROFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_MACROFLD),0      	},
573 { "TYP_NEXTPAGEFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_NEXTPAGEFLD),0     },
574 { "TYP_PAGENUMBERFLD",   	SbxINTEGER,       _CPROP,    RTLNAME(TYP_PAGENUMBERFLD),0   },
575 { "TYP_POSTITFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_POSTITFLD),0      	},
576 { "TYP_PREVPAGEFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_PREVPAGEFLD),0     },
577 { "TYP_SEQFLD",   			SbxINTEGER,       _CPROP,    RTLNAME(TYP_SEQFLD),0      	},
578 { "TYP_SETFLD",   			SbxINTEGER,       _CPROP,    RTLNAME(TYP_SETFLD),0      	},
579 { "TYP_SETINPFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_SETINPFLD),0      	},
580 { "TYP_SETREFFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_SETREFFLD),0      	},
581 { "TYP_SETREFPAGEFLD", 		SbxINTEGER,       _CPROP,    RTLNAME(TYP_SETREFPAGEFLD),0   },
582 { "TYP_TEMPLNAMEFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_TEMPLNAMEFLD),0},
583 { "TYP_TIMEFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_TIMEFLD),0    		  	},
584 { "TYP_USERFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_USERFLD),0      		},
585 { "TYP_USRINPFLD",   		SbxINTEGER,       _CPROP,    RTLNAME(TYP_USRINPFLD),0      	},
586 
587 { "TypeLen",       	SbxINTEGER,    1 | _FUNCTION, RTLNAME(TypeLen),0        },
588   { "Var",          SbxVARIANT, 0,NULL,0 },
589 { "TypeName",       SbxSTRING,    1 | _FUNCTION, RTLNAME(TypeName),0        },
590   { "Var",          SbxVARIANT, 0,NULL,0 },
591 
592 { "UBound",         SbxLONG,      1 | _FUNCTION, RTLNAME(UBound),0          },
593   { "Var",          SbxVARIANT, 0,NULL,0 },
594 { "UCase",          SbxSTRING,    1 | _FUNCTION, RTLNAME(UCase),0           },
595   { "String",       SbxSTRING, 0,NULL,0 },
596 { "Unload",         SbxNULL,      1 | _FUNCTION, RTLNAME(Unload),0          },
597   { "Dialog",       SbxOBJECT, 0,NULL,0 },
598 
599 { "Val",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Val),0             },
600   { "String",       SbxSTRING, 0,NULL,0 },
601 { "VarType",        SbxINTEGER,   1 | _FUNCTION, RTLNAME(VarType),0         },
602   { "Var",          SbxVARIANT, 0,NULL,0 },
603 { "V_EMPTY",        SbxINTEGER,       _CPROP,    RTLNAME(V_EMPTY),0         },
604 { "V_NULL",         SbxINTEGER,       _CPROP,    RTLNAME(V_NULL),0          },
605 { "V_INTEGER",      SbxINTEGER,       _CPROP,    RTLNAME(V_INTEGER),0       },
606 { "V_LONG",         SbxINTEGER,       _CPROP,    RTLNAME(V_LONG),0          },
607 { "V_SINGLE",       SbxINTEGER,       _CPROP,    RTLNAME(V_SINGLE),0        },
608 { "V_DOUBLE",       SbxINTEGER,       _CPROP,    RTLNAME(V_DOUBLE),0        },
609 { "V_CURRENCY",     SbxINTEGER,       _CPROP,    RTLNAME(V_CURRENCY),0      },
610 { "V_DATE",         SbxINTEGER,       _CPROP,    RTLNAME(V_DATE),0          },
611 { "V_STRING",       SbxINTEGER,       _CPROP,    RTLNAME(V_STRING),0        },
612 
613 { "Wait",        	SbxNULL,      1 | _FUNCTION, RTLNAME(Wait),0            },
614   { "Milliseconds", SbxLONG, 0,NULL,0 },
615 //#i64882#
616 { "WaitUntil",          SbxNULL,      1 | _FUNCTION, RTLNAME(WaitUntil),0      },
617   { "Date", SbxDOUBLE, 0,NULL,0 },
618 { "Weekday",        SbxINTEGER,   2 | _FUNCTION, RTLNAME(Weekday),0         },
619   { "Date",         SbxDATE, 0,NULL,0 },
620   { "Firstdayofweek", SbxINTEGER, _OPT, NULL,0 },
621 { "WeekdayName",    SbxSTRING,    3 | _FUNCTION | _COMPTMASK, RTLNAME(WeekdayName),0 },
622   { "Weekday",      SbxINTEGER, 0,NULL,0 },
623   { "Abbreviate",   SbxBOOL,      _OPT, NULL,0 },
624   { "Firstdayofweek", SbxINTEGER, _OPT, NULL,0 },
625 { "Year",           SbxINTEGER,   1 | _FUNCTION, RTLNAME(Year),0            },
626   { "Date",         SbxDATE, 0,NULL,0 },
627 
628 { NULL,             SbxNULL,     -1,NULL,0 }};  // Tabellenende
629 
SbiStdObject(const String & r,StarBASIC * pb)630 SbiStdObject::SbiStdObject( const String& r, StarBASIC* pb ) : SbxObject( r )
631 {
632 	// Muessen wir die Hashcodes initialisieren?
633 	Methods* p = aMethods;
634 	if( !p->nHash )
635 	  while( p->nArgs != -1 )
636 	{
637 		String aName_ = String::CreateFromAscii( p->pName );
638 		p->nHash = SbxVariable::MakeHashCode( aName_ );
639 		p += ( p->nArgs & _ARGSMASK ) + 1;
640 	}
641 
642 	// #i92642: Remove default properties
643 	Remove( XubString( RTL_CONSTASCII_USTRINGPARAM("Name") ), SbxCLASS_DONTCARE );
644 	Remove( XubString( RTL_CONSTASCII_USTRINGPARAM("Parent") ), SbxCLASS_DONTCARE );
645 
646 	SetParent( pb );
647 
648 	pStdFactory = new SbStdFactory;
649 	SbxBase::AddFactory( pStdFactory );
650 
651 	Insert( new SbStdClipboard );
652 }
653 
~SbiStdObject()654 SbiStdObject::~SbiStdObject()
655 {
656 	SbxBase::RemoveFactory( pStdFactory );
657 	delete pStdFactory;
658 }
659 
660 // Suche nach einem Element:
661 // Hier wird linear durch die Methodentabelle gegangen, bis eine
662 // passende Methode gefunden wurde. Auf Grund der Bits im nArgs-Feld
663 // wird dann die passende Instanz eines SbxObjElement generiert.
664 // Wenn die Methode/Property nicht gefunden wurde, nur NULL ohne
665 // Fehlercode zurueckliefern, da so auch eine ganze Chain von
666 // Objekten nach der Methode/Property befragt werden kann.
667 
Find(const String & rName,SbxClassType t)668 SbxVariable* SbiStdObject::Find( const String& rName, SbxClassType t )
669 {
670 	// Bereits eingetragen?
671 	SbxVariable* pVar = SbxObject::Find( rName, t );
672 	if( !pVar )
673 	{
674 		// sonst suchen
675 		sal_uInt16 nHash_ = SbxVariable::MakeHashCode( rName );
676 		Methods* p = aMethods;
677 		sal_Bool bFound = sal_False;
678 		short nIndex = 0;
679 		sal_uInt16 nSrchMask = _TYPEMASK;
680 		switch( t )
681 		{
682 			case SbxCLASS_METHOD:	nSrchMask = _METHOD; break;
683 			case SbxCLASS_PROPERTY:	nSrchMask = _PROPERTY; break;
684 			case SbxCLASS_OBJECT:	nSrchMask = _OBJECT; break;
685 			default: break;
686 		}
687 		while( p->nArgs != -1 )
688 		{
689 			if( ( p->nArgs & nSrchMask )
690 			 && ( p->nHash == nHash_ )
691 			 && ( rName.EqualsIgnoreCaseAscii( p->pName ) ) )
692 			{
693 				bFound = sal_True;
694 				if( p->nArgs & _COMPTMASK )
695 				{
696 					SbiInstance* pInst = pINST;
697 					if( !pInst || !pInst->IsCompatibility() )
698 						bFound = sal_False;
699 				}
700 				break;
701 			}
702 			nIndex += ( p->nArgs & _ARGSMASK ) + 1;
703 			p = aMethods + nIndex;
704 		}
705 
706 		if( bFound )
707 		{
708 			// Args-Felder isolieren:
709 			short nAccess = ( p->nArgs & _RWMASK ) >> 8;
710 			short nType   = ( p->nArgs & _TYPEMASK );
711 			if( p->nArgs & _CONST )
712 				nAccess |= SBX_CONST;
713 			String aName_ = String::CreateFromAscii( p->pName );
714 			SbxClassType eCT = SbxCLASS_OBJECT;
715 			if( nType & _PROPERTY )
716 				eCT = SbxCLASS_PROPERTY;
717 			else if( nType & _METHOD )
718 				eCT = SbxCLASS_METHOD;
719 			pVar = Make( aName_, eCT, p->eType, ( p->nArgs & _FUNCTION ) == _FUNCTION );
720 			pVar->SetUserData( nIndex + 1 );
721 			pVar->SetFlags( nAccess );
722 		}
723 	}
724 	return pVar;
725 }
726 
727 // SetModified muss bei der RTL abgeklemmt werden
SetModified(sal_Bool)728 void SbiStdObject::SetModified( sal_Bool )
729 {
730 }
731 
732 // Aufruf einer Property oder Methode.
733 
SFX_NOTIFY(SfxBroadcaster & rBC,const TypeId & rBCType,const SfxHint & rHint,const TypeId & rHintType)734 void SbiStdObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
735 							 const SfxHint& rHint, const TypeId& rHintType )
736 
737 {
738 	const SbxHint* pHint = PTR_CAST(SbxHint,&rHint);
739 	if( pHint )
740 	{
741 		SbxVariable* pVar = pHint->GetVar();
742 		SbxArray* pPar_ = pVar->GetParameters();
743 		sal_uIntPtr t = pHint->GetId();
744 		sal_uInt16 nCallId = (sal_uInt16) pVar->GetUserData();
745 		if( nCallId )
746 		{
747 			if( t == SBX_HINT_INFOWANTED )
748 				pVar->SetInfo( GetInfo( (short) pVar->GetUserData() ) );
749 			else
750 			{
751 				sal_Bool bWrite = sal_False;
752 				if( t == SBX_HINT_DATACHANGED )
753 					bWrite = sal_True;
754 				if( t == SBX_HINT_DATAWANTED || bWrite )
755 				{
756 					RtlCall p = (RtlCall) aMethods[ nCallId-1 ].pFunc;
757 					SbxArrayRef rPar( pPar_ );
758 					if( !pPar_ )
759 					{
760 						rPar = pPar_ = new SbxArray;
761 						pPar_->Put( pVar, 0 );
762 					}
763 					p( (StarBASIC*) GetParent(), *pPar_, bWrite );
764 					return;
765 				}
766 			}
767 		}
768 		SbxObject::SFX_NOTIFY( rBC, rBCType, rHint, rHintType );
769 	}
770 }
771 
772 // Zusammenbau der Infostruktur fuer einzelne Elemente
773 // Falls nIdx = 0, nichts erzeugen (sind Std-Props!)
774 
GetInfo(short nIdx)775 SbxInfo* SbiStdObject::GetInfo( short nIdx )
776 {
777 	if( !nIdx )
778 		return NULL;
779 	Methods* p = &aMethods[ --nIdx ];
780 	// Wenn mal eine Hilfedatei zur Verfuegung steht:
781 	// SbxInfo* pInfo_ = new SbxInfo( Hilfedateiname, p->nHelpId );
782 	SbxInfo* pInfo_ = new SbxInfo;
783 	short nPar = p->nArgs & _ARGSMASK;
784 	for( short i = 0; i < nPar; i++ )
785 	{
786 		p++;
787 		String aName_ = String::CreateFromAscii( p->pName );
788 		sal_uInt16 nFlags_ = ( p->nArgs >> 8 ) & 0x03;
789 		if( p->nArgs & _OPT )
790 			nFlags_ |= SBX_OPTIONAL;
791 		pInfo_->AddParam( aName_, p->eType, nFlags_ );
792 	}
793 	return pInfo_;
794 }
795 
796