1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <runtime.hxx>
#include <rtlproto.hxx>
#include <errobject.hxx>
#include <basegfx/numeric/ftools.hxx>
// Properties and methods lay the return value down at Get (bWrite = sal_False)
// at the element 0 of the Argv; at Put (bWrite = sal_True) the value from
// element 0 is stored.
void SbRtl_Erl(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutLong( StarBASIC::GetErl() );
}
void SbRtl_Err(StarBASIC *, SbxArray & rPar, bool bWrite)
{
if( SbiRuntime::isVBAEnabled() )
{
rPar.Get32(0)->PutObject( SbxErrObject::getErrObject().get() );
}
else
{
if( bWrite )
{
sal_Int32 nVal = rPar.Get32(0)->GetLong();
if( nVal <= 65535 )
StarBASIC::Error( StarBASIC::GetSfxFromVBError( static_cast<sal_uInt16>(nVal) ) );
}
else
rPar.Get32(0)->PutLong( StarBASIC::GetVBErrorCode( StarBASIC::GetErrBasic() ) );
}
}
void SbRtl_False(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutBool( false );
}
void SbRtl_Empty(StarBASIC *, SbxArray &, bool) {}
void SbRtl_Nothing(StarBASIC *, SbxArray & rPar, bool)
{
// return an empty object
rPar.Get32(0)->PutObject( nullptr );
}
void SbRtl_Null(StarBASIC *, SbxArray & rPar, bool)
{
// returns an empty object-variable
rPar.Get32(0)->PutNull();
}
void SbRtl_PI(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutDouble( F_PI );
}
void SbRtl_True(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutBool( true );
}
void SbRtl_ATTR_NORMAL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_ATTR_READONLY(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_ATTR_HIDDEN(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_ATTR_SYSTEM(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(4);
}
void SbRtl_ATTR_VOLUME(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(8);
}
void SbRtl_ATTR_DIRECTORY(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(16);
}
void SbRtl_ATTR_ARCHIVE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(32);
}
void SbRtl_V_EMPTY(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_V_NULL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_V_INTEGER(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_V_LONG(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(3);
}
void SbRtl_V_SINGLE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(4);
}
void SbRtl_V_DOUBLE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(5);
}
void SbRtl_V_CURRENCY(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(6);
}
void SbRtl_V_DATE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(7);
}
void SbRtl_V_STRING(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(8);
}
void SbRtl_MB_OK(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_MB_OKCANCEL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_MB_ABORTRETRYIGNORE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_MB_YESNOCANCEL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(3);
}
void SbRtl_MB_YESNO(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(4);
}
void SbRtl_MB_RETRYCANCEL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(5);
}
void SbRtl_MB_ICONSTOP(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(16);
}
void SbRtl_MB_ICONQUESTION(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(32);
}
void SbRtl_MB_ICONEXCLAMATION(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(48);
}
void SbRtl_MB_ICONINFORMATION(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(64);
}
void SbRtl_MB_DEFBUTTON1(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_MB_DEFBUTTON2(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(256);
}
void SbRtl_MB_DEFBUTTON3(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(512);
}
void SbRtl_MB_APPLMODAL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_MB_SYSTEMMODAL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(4096);
}
void SbRtl_IDOK(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_IDCANCEL(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_IDABORT(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(3);
}
void SbRtl_IDRETRY(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(4);
}
void SbRtl_IDYES(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(6);
}
void SbRtl_IDNO(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(7);
}
void SbRtl_CF_TEXT(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_CF_BITMAP(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_CF_METAFILEPICT(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(3);
}
void SbRtl_TYP_AUTHORFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(7);
}
void SbRtl_TYP_CHAPTERFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(4);
}
void SbRtl_TYP_CONDTXTFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(27);
}
void SbRtl_TYP_DATEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_TYP_DBFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(19);
}
void SbRtl_TYP_DBNAMEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(3);
}
void SbRtl_TYP_DBNEXTSETFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(24);
}
void SbRtl_TYP_DBNUMSETFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(25);
}
void SbRtl_TYP_DBSETNUMBERFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(26);
}
void SbRtl_TYP_DDEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(14);
}
void SbRtl_TYP_DOCINFOFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(18);
}
void SbRtl_TYP_DOCSTATFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(6);
}
void SbRtl_TYP_EXTUSERFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(30);
}
void SbRtl_TYP_FILENAMEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_TYP_FIXDATEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(31);
}
void SbRtl_TYP_FIXTIMEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(32);
}
void SbRtl_TYP_FORMELFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(10);
}
void SbRtl_TYP_GETFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(9);
}
void SbRtl_TYP_GETREFFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(13);
}
void SbRtl_TYP_HIDDENPARAFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(17);
}
void SbRtl_TYP_HIDDENTXTFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(11);
}
void SbRtl_TYP_INPUTFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(16);
}
void SbRtl_TYP_MACROFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(15);
}
void SbRtl_TYP_NEXTPAGEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(28);
}
void SbRtl_TYP_PAGENUMBERFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(5);
}
void SbRtl_TYP_POSTITFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(21);
}
void SbRtl_TYP_PREVPAGEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(29);
}
void SbRtl_TYP_SEQFLD(StarBASIC * , SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(23);
}
void SbRtl_TYP_SETFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(8);
}
void SbRtl_TYP_SETINPFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(33);
}
void SbRtl_TYP_SETREFFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(12);
}
void SbRtl_TYP_TEMPLNAMEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(22);
}
void SbRtl_TYP_TIMEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_TYP_USERFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(20);
}
void SbRtl_TYP_USRINPFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(34);
}
void SbRtl_TYP_SETREFPAGEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(35);
}
void SbRtl_TYP_GETREFPAGEFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(36);
}
void SbRtl_TYP_INTERNETFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(37);
}
void SbRtl_SET_ON(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_SET_OFF(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_TOGGLE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_FRAMEANCHORPAGE(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_FRAMEANCHORPARA(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(14);
}
void SbRtl_FRAMEANCHORCHAR(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(15);
}
void SbRtl_CLEAR_ALLTABS(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(2);
}
void SbRtl_CLEAR_TAB(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(1);
}
void SbRtl_SET_TAB(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(0);
}
void SbRtl_TYP_JUMPEDITFLD(StarBASIC *, SbxArray & rPar, bool)
{
rPar.Get32(0)->PutInteger(38);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|