Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include "decl.h"
21 : #include "lotform.hxx"
22 : #include "compiler.hxx"
23 : #include "lotfilter.hxx"
24 : #include "lotrange.hxx"
25 : #include "namebuff.hxx"
26 : #include "root.hxx"
27 : #include "ftools.hxx"
28 : #include "tool.h"
29 :
30 : #include <math.h>
31 : #include <comphelper/string.hxx>
32 : #include <boost/scoped_array.hpp>
33 :
34 : static const sal_Char* GetAddInName( const sal_uInt8 nIndex );
35 :
36 : static DefTokenId lcl_KnownAddIn(const OString& rTest);
37 :
38 5 : void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtString )
39 : {
40 5 : TokenId eParam[ 256 ];
41 : sal_Int32 nLauf;
42 5 : TokenId nMerk0, nMerk1;
43 :
44 5 : bool bAddIn = false;
45 :
46 : OSL_ENSURE( nAnz < 128, "-LotusToSc::DoFunc(): Too many (128)!" );
47 :
48 5 : if( eOc == ocNoName )
49 : {
50 0 : OString t;
51 0 : if( pExtString )
52 : {
53 0 : const OString s("@<<@123>>");
54 :
55 0 : t = pExtString;
56 :
57 0 : sal_Int32 n = t.indexOf(s);
58 0 : if( n != -1 )
59 0 : t = t.copy(n + s.getLength());
60 :
61 0 : t = comphelper::string::stripEnd(t, '(');
62 :
63 0 : eOc = lcl_KnownAddIn( t );
64 :
65 0 : if( eOc == ocNoName )
66 0 : t = OString("L123_") + t;
67 : }
68 : else
69 0 : t = "#UNKNOWN FUNC NAME#";
70 :
71 0 : if( eOc == ocNoName )
72 : {
73 0 : bAddIn = true;
74 0 : nMerk0 = aPool.Store(eOc, OStringToOUString(t, eSrcChar));
75 :
76 0 : aPool << nMerk0;
77 0 : }
78 : }
79 :
80 14 : for( nLauf = 0 ; nLauf < nAnz ; nLauf++ )
81 9 : aStack >> eParam[ nLauf ];
82 :
83 : // special cases...
84 5 : switch( eOc )
85 : {
86 : case ocIndex:
87 : OSL_ENSURE( nAnz > 2, "+LotusToSc::DoFunc(): ocIndex needs at least 2 parameters!" );
88 0 : nMerk0 = eParam[ 0 ];
89 0 : eParam[ 0 ] = eParam[ 1 ];
90 0 : eParam[ 1 ] = nMerk0;
91 0 : IncToken( eParam[ 0 ] );
92 0 : IncToken( eParam[ 1 ] );
93 0 : break;
94 : case ocIRR:
95 : {
96 : OSL_ENSURE( nAnz == 2, "+LotusToSc::DoFunc(): ocIRR needs 2 parameters!" );
97 0 : nMerk0 = eParam[ 0 ];
98 0 : eParam[ 0 ] = eParam[ 1 ];
99 0 : eParam[ 1 ] = nMerk0;
100 : }
101 0 : break;
102 : case ocGetYear:
103 : {
104 0 : nMerk0 = aPool.Store( 1900.0 );
105 0 : aPool << ocOpen;
106 : }
107 0 : break;
108 : case ocChoose:
109 : {// 1. Parameter ++
110 0 : if (nAnz >= 1)
111 0 : IncToken( eParam[ nAnz - 1 ] );
112 : }
113 0 : break;
114 : case ocFind:
115 : case ocHLookup:
116 : case ocVLookup:
117 : {// last parameter ++
118 0 : IncToken( eParam[ 0 ] );
119 : }
120 0 : break;
121 : case ocMid:
122 : case ocReplace:
123 : {// 2. Parameter ++
124 0 : if (nAnz >= 2)
125 0 : IncToken( eParam[ nAnz - 2 ] );
126 : }
127 0 : break;
128 : case ocRate:
129 : {
130 : // new quantity = 4!
131 : OSL_ENSURE( nAnz == 3,
132 : "*LotusToSc::DoFunc(): ZINS() needs 3 parameters!" );
133 0 : nAnz = 4;
134 0 : eParam[ 3 ] = eParam[ 0 ]; // 3. -> 1.
135 0 : eParam[ 0 ] = eParam[ 2 ]; // 1. -> 4.
136 0 : NegToken( eParam[ 1 ] ); // 2. -> -2. (+ 2. -> 3.)
137 0 : eParam[ 2 ] = n0Token; // -> 2. as Default
138 : }
139 0 : break;
140 : case ocNper:
141 : {
142 : OSL_ENSURE( nAnz == 3,
143 : "*LotusToSc::DoFunc(): TERM() or CTERM() need 3 parameters!" );
144 0 : nAnz = 4;
145 0 : if ( OString(pExtString) == "TERM" )
146 : {
147 : // @TERM(pmt,int,fv) -> NPER(int,-pmt,pv=0,fv)
148 0 : NegToken( eParam[ 2 ] );
149 0 : eParam[ 3 ] = eParam[ 1 ];
150 0 : eParam[ 1 ] = aPool.Store( 0.0 );
151 : }
152 : else //CTERM()
153 : {
154 : // @CTERM(int,fv,pv) -> NPER(int,pmt=0,-pv,fv)
155 0 : NegToken( eParam[ 0 ] );
156 0 : nMerk0 = eParam[ 1 ];
157 0 : eParam[ 1 ] = eParam[ 0 ];
158 0 : eParam[ 0 ] = nMerk0;
159 0 : eParam[ 3 ] = eParam[ 2 ];
160 0 : eParam[ 2 ] = aPool.Store( 0.0 );
161 : }
162 : }
163 0 : break;
164 : case ocRoundUp:
165 : case ocRoundDown:
166 : {
167 : // omit optional 3rd parameter
168 0 : if ( nAnz == 3 )
169 : {
170 0 : eParam[ 0 ] = eParam[ 1 ];
171 0 : eParam[ 1 ] = eParam[ 2 ];
172 0 : nAnz = 2;
173 : }
174 :
175 : }
176 0 : break;
177 : default:;
178 : }
179 :
180 5 : if( !bAddIn )
181 5 : aPool << eOc;
182 :
183 5 : aPool << ocOpen;
184 :
185 5 : if( nAnz > 0 )
186 : {
187 : // ATTENTION: 0 is the last parameter, nAnz-1 the first one
188 :
189 5 : sal_Int16 nLast = nAnz - 1;
190 :
191 5 : if( eOc == ocPMT )
192 : { // special case ocPMT, ignore (negate?) last parameter!
193 : // zusaetzlich: 1. -> 3., 3. -> 2., 2. -> 1.
194 : OSL_ENSURE( nAnz == 3,
195 : "+LotusToSc::DoFunc(): ocPMT needs 3 parameters!" );
196 0 : aPool << eParam[ 1 ] << ocSep << eParam[ 0 ] << ocSep
197 0 : << ocNegSub << eParam[ 2 ];
198 : }
199 : else
200 : { // default
201 : // [Parameter{;Parameter}]
202 5 : aPool << eParam[ nLast ];
203 :
204 5 : sal_Int16 nNull = -1; // lists the parameter to be excluded
205 9 : for( nLauf = nLast - 1 ; nLauf >= 0 ; nLauf-- )
206 : {
207 4 : if( nLauf != nNull )
208 4 : aPool << ocSep << eParam[ nLauf ];
209 : }
210 : }
211 : }
212 :
213 : // special cases ...
214 5 : if( eOc == ocGetYear )
215 : {
216 0 : aPool << ocClose << ocSub << nMerk0;
217 : }
218 5 : else if( eOc == ocFixed )
219 : {
220 0 : aPool << ocSep << ocTrue << ocOpen << ocClose;
221 : }
222 5 : else if( eOc == ocFind )
223 : {
224 0 : nMerk1 = aPool.Store();
225 0 : DecToken( nMerk1 );
226 0 : aPool << nMerk1;
227 : }
228 :
229 5 : aPool << ocClose;
230 :
231 5 : aPool >> aStack;
232 5 : }
233 :
234 7 : void LotusToSc::LotusRelToScRel( sal_uInt16 nCol, sal_uInt16 nRow, ScSingleRefData& rSRD )
235 : {
236 : // Col
237 7 : if( nCol & 0x8000 )
238 : {
239 7 : if( nCol & 0x0080 )
240 3 : nCol |= 0xFF00;
241 : else
242 4 : nCol &= 0x00FF;
243 : // #i36252# first cast unsigned 16-bit to signed 16-bit, and then to SCCOL
244 7 : rSRD.SetRelCol(static_cast<SCCOL>(static_cast<sal_Int16>(nCol)));
245 : }
246 : else
247 : {
248 0 : rSRD.SetAbsCol(static_cast<SCCOL>(nCol & 0x00FF));
249 : }
250 :
251 : // Row
252 7 : if( nRow & 0x8000 )
253 : {
254 7 : rSRD.SetRowRel(true);
255 : // sign correct extension
256 7 : switch (m_rContext.eTyp)
257 : {
258 : // 5432 1098 7654 3210
259 : // 8421 8421 8421 8421
260 : // xxx xxxx xxxx
261 : case eWK_1:
262 7 : if( nRow & 0x0400 )
263 7 : nRow |= 0xF800;
264 : else
265 0 : nRow &= 0x07FF;
266 7 : break;
267 : // 8421 8421 8421 8421
268 : // x xxxx xxxx xxxx
269 : case eWK_2:
270 0 : if( nRow & 0x1000 )
271 0 : nRow |= 0xE000;
272 : else
273 0 : nRow &= 0x1FFF;
274 0 : break;
275 : default:
276 : OSL_FAIL( "*LotusToSc::LotusRelToScRel(): unhandeled case?" );
277 : }
278 : }
279 : else
280 : {
281 0 : rSRD.SetRowRel(false);
282 0 : switch (m_rContext.eTyp)
283 : {
284 : // 5432 1098 7654 3210
285 : // 8421 8421 8421 8421
286 : // xxx xxxx xxxx
287 : case eWK_1:
288 0 : nRow &= 0x07FF;
289 0 : break;
290 : // 8421 8421 8421 8421
291 : // xx xxxx xxxx xxxx
292 : case eWK_2:
293 0 : nRow &= 0x3FFF;
294 0 : break;
295 : default:
296 : OSL_FAIL( "*LotusToSc::LotusRelToScRel(): unhandeled case?" );
297 : }
298 : }
299 :
300 7 : if( rSRD.IsRowRel() )
301 : // #i36252# first cast unsigned 16-bit to signed 16-bit, and then to SCROW
302 7 : rSRD.SetRelRow(static_cast<SCROW>(static_cast<sal_Int16>(nRow)));
303 : else
304 0 : rSRD.SetAbsRow(static_cast<SCROW>(nRow));
305 7 : }
306 :
307 160 : void LotusToSc::ReadSRD( ScSingleRefData& rSRD, sal_uInt8 nRelBit )
308 : {
309 : sal_uInt8 nTab, nCol;
310 : sal_uInt16 nRow;
311 :
312 160 : Read( nRow );
313 160 : Read( nTab );
314 160 : Read( nCol );
315 :
316 160 : bool b3D = (static_cast<SCTAB>(nTab) != aEingPos.Tab());
317 :
318 160 : rSRD.SetColRel( ( nRelBit & 0x01 ) != 0 );
319 160 : rSRD.SetRowRel( ( nRelBit & 0x02 ) != 0 );
320 160 : rSRD.SetTabRel( ( ( nRelBit & 0x04) != 0 ) || !b3D );
321 160 : rSRD.SetFlag3D( b3D );
322 :
323 160 : rSRD.SetAddress(ScAddress(nCol, nRow, nTab), aEingPos);
324 160 : }
325 :
326 0 : void LotusToSc::IncToken( TokenId &rParam )
327 : {
328 0 : aPool << ocOpen << rParam << nAddToken;
329 0 : rParam = aPool.Store();
330 0 : }
331 :
332 0 : void LotusToSc::DecToken( TokenId &rParam )
333 : {
334 0 : aPool << ocOpen << rParam << nSubToken;
335 0 : rParam = aPool.Store();
336 0 : }
337 :
338 0 : void LotusToSc::NegToken( TokenId &rParam )
339 : {
340 0 : aPool << ocNegSub << ocOpen << rParam << ocClose;
341 0 : rParam = aPool.Store();
342 0 : }
343 :
344 166 : void LotusToSc::Reset( const ScAddress& rEingPos )
345 : {
346 166 : LotusConverterBase::Reset( rEingPos );
347 :
348 166 : TokenId nEins = aPool.Store( 1.0 );
349 :
350 166 : aPool << ocClose << ocAdd << nEins;
351 166 : nAddToken = aPool.Store();
352 :
353 166 : aPool << ocClose << ocSub << nEins;
354 166 : nSubToken = aPool.Store();
355 :
356 166 : n0Token = aPool.Store( 0.0 );
357 166 : }
358 :
359 170 : LotusToSc::LotusToSc(LotusContext &rContext, SvStream &rStream, svl::SharedStringPool& rSPool,
360 : rtl_TextEncoding e, bool b)
361 : : LotusConverterBase(rStream, rSPool, 128)
362 170 : , m_rContext(rContext)
363 : {
364 170 : eSrcChar = e;
365 170 : bWK3 = false;
366 170 : bWK123 = b;
367 170 : }
368 :
369 : typedef FUNC_TYPE ( FuncType1 ) ( sal_uInt8 );
370 : typedef DefTokenId ( FuncType2 ) ( sal_uInt8 );
371 :
372 166 : ConvErr LotusToSc::Convert( const ScTokenArray*& rpErg, sal_Int32& rRest,
373 : const FORMULA_TYPE /*eFT*/ )
374 : {
375 : sal_uInt8 nOc;
376 : sal_uInt8 nAnz;
377 : sal_uInt8 nRelBits;
378 : sal_uInt16 nStrLen;
379 : sal_uInt16 nRngIndex;
380 166 : FUNC_TYPE eType = FT_NOP;
381 166 : TokenId nMerk0;
382 : DefTokenId eOc;
383 166 : const sal_Char* pExtName = 0;
384 166 : RangeNameBufferWK3& rRangeNameBufferWK3 = *m_rContext.pLotusRoot->pRngNmBffWK3;
385 :
386 : ScComplexRefData aCRD;
387 166 : aCRD.InitFlags();
388 166 : ScSingleRefData& rR = aCRD.Ref1;
389 :
390 : LR_ID nId;
391 166 : TokenId nNewId;
392 :
393 166 : LotusRangeList& rRangeList = *m_rContext.pLotusRoot->pRangeNames;
394 :
395 : FuncType1* pIndexToType;
396 : FuncType2* pIndexToToken;
397 :
398 166 : if( bWK3 )
399 : { // for > WK3
400 0 : pIndexToType = IndexToTypeWK123;
401 0 : pIndexToToken = IndexToTokenWK123;
402 : }
403 166 : else if( bWK123 )
404 : {
405 162 : pIndexToType = IndexToTypeWK123;
406 162 : pIndexToToken = IndexToTokenWK123;
407 : }
408 : else
409 : {
410 4 : pIndexToType = IndexToType;
411 4 : pIndexToToken = IndexToToken;
412 :
413 4 : rR.SetRelTab(0);
414 4 : rR.SetFlag3D( false );
415 : }
416 :
417 166 : aCRD.Ref2 = rR;
418 :
419 166 : nBytesLeft = rRest;
420 :
421 999 : while( eType ) // != FT_Return (==0)
422 : {
423 667 : Read( nOc );
424 :
425 667 : if( nBytesLeft < 0 )
426 : {
427 0 : rpErg = aPool[ aStack.Get() ];
428 0 : return ConvErrCount;
429 : }
430 :
431 667 : eType = ( pIndexToType )( nOc );
432 667 : eOc = ( pIndexToToken)( nOc );
433 667 : if( eOc == ocNoName )
434 0 : pExtName = GetAddInName( nOc );
435 :
436 667 : switch( eType )
437 : {
438 : case FT_Return:
439 166 : if( bWK3 || bWK123 )
440 162 : nBytesLeft = 0; // not used for >= WK3
441 :
442 166 : rRest = nBytesLeft;
443 166 : break;
444 : case FT_NotImpl:
445 0 : case FT_FuncFix0: DoFunc( eOc, 0, pExtName ); break;
446 0 : case FT_FuncFix1: DoFunc( eOc, 1, pExtName ); break;
447 1 : case FT_FuncFix2: DoFunc( eOc, 2, pExtName ); break;
448 1 : case FT_FuncFix3: DoFunc( eOc, 3, pExtName ); break;
449 0 : case FT_FuncFix4: DoFunc( eOc, 4, pExtName ); break;
450 : case FT_FuncVar:
451 3 : Read( nAnz );
452 3 : DoFunc( eOc, nAnz, pExtName );
453 3 : break;
454 : case FT_Neg:
455 0 : aPool << ocOpen << ocNegSub << aStack << ocClose;
456 0 : aPool >> aStack;
457 0 : break;
458 : case FT_Op:
459 163 : aStack >> nMerk0;
460 163 : aPool << aStack << eOc << nMerk0;
461 163 : aPool >> aStack;
462 163 : break;
463 : case FT_ConstFloat:
464 : {
465 : double fDouble;
466 0 : Read( fDouble );
467 0 : aStack << aPool.Store( fDouble );
468 : }
469 0 : break;
470 : case FT_Variable:
471 : {
472 : sal_uInt16 nCol, nRow;
473 3 : Read( nCol );
474 3 : Read( nRow );
475 :
476 3 : LotusRelToScRel( nCol, nRow, rR );
477 :
478 3 : if( bWK3 )
479 0 : nNewId = aPool.Store( rR );
480 : else
481 : {
482 3 : nId = rRangeList.GetIndex(rR.Col(), rR.Row());
483 :
484 3 : if( nId == ID_FAIL )
485 : // missing range
486 3 : nNewId = aPool.Store( rR );
487 : else
488 0 : nNewId = aPool.Store( ( sal_uInt16 ) nId );
489 : }
490 :
491 3 : aStack << nNewId;
492 : }
493 3 : break;
494 : case FT_Range:
495 : {
496 : sal_uInt16 nColS, nRowS, nColE, nRowE;
497 2 : Read( nColS );
498 2 : Read( nRowS );
499 2 : Read( nColE );
500 2 : Read( nRowE );
501 :
502 2 : LotusRelToScRel( nColS, nRowS, rR );
503 2 : LotusRelToScRel( nColE, nRowE, aCRD.Ref2 );
504 :
505 2 : if( bWK3 )
506 0 : nNewId = aPool.Store( aCRD );
507 : else
508 : {
509 2 : nId = rRangeList.GetIndex(rR.Col(), rR.Row(), aCRD.Ref2.Col(), aCRD.Ref2.Row());
510 :
511 2 : if( nId == ID_FAIL )
512 : // missing range
513 2 : nNewId = aPool.Store( aCRD );
514 : else
515 0 : nNewId = aPool.Store( ( sal_uInt16 ) nId );
516 : }
517 :
518 2 : aStack << nNewId;
519 : }
520 2 : break;
521 : case FT_Braces:
522 0 : aPool << ocOpen << aStack << ocClose;
523 0 : aPool >> aStack;
524 0 : break;
525 : case FT_ConstInt:
526 : {
527 : sal_Int16 nVal;
528 2 : Read( nVal );
529 2 : aStack << aPool.Store( ( double ) nVal );
530 : }
531 2 : break;
532 : case FT_ConstString:
533 : {
534 2 : OUString aTmp(ScfTools::read_zeroTerminated_uInt8s_ToOUString(aIn, nBytesLeft, eSrcChar));
535 2 : aStack << aPool.Store( aTmp );
536 : }
537 2 : break;
538 : case FT_NOP:
539 0 : break;
540 : // for > WK3
541 : case FT_Cref:
542 160 : Read( nRelBits );
543 160 : ReadSRD( rR, nRelBits );
544 160 : aStack << aPool.Store( rR );
545 160 : break;
546 : case FT_Rref:
547 0 : Read( nRelBits );
548 0 : ReadCRD( aCRD, nRelBits );
549 0 : aStack << aPool.Store( aCRD );
550 0 : break;
551 : case FT_Nrref:
552 : {
553 0 : OUString aTmp(ScfTools::read_zeroTerminated_uInt8s_ToOUString(aIn, nBytesLeft, eSrcChar));
554 0 : if( rRangeNameBufferWK3.FindRel( aTmp, nRngIndex ) )
555 0 : aStack << aPool.Store( nRngIndex );
556 : else
557 : {
558 0 : OUString aText( "NRREF ");
559 0 : aText += aTmp;
560 0 : aStack << aPool.Store( aText );
561 0 : }
562 : }
563 0 : break;
564 : case FT_Absnref:
565 : {
566 0 : OUString aTmp(ScfTools::read_zeroTerminated_uInt8s_ToOUString(aIn, nBytesLeft, eSrcChar));
567 0 : if( rRangeNameBufferWK3.FindAbs( aTmp, nRngIndex ) )
568 0 : aStack << aPool.Store( nRngIndex );
569 : else
570 : {
571 0 : OUString aText( "ABSNREF " );
572 0 : aText += aTmp;
573 0 : aStack << aPool.Store( aText );
574 0 : }
575 : }
576 0 : break;
577 : case FT_Erref:
578 0 : Ignore( 4 );
579 0 : aPool << ocBad;
580 0 : aPool >> aStack;
581 0 : break;
582 : case FT_Ecref:
583 0 : Ignore( 5 );
584 0 : aPool << ocBad;
585 0 : aPool >> aStack;
586 0 : break;
587 : case FT_Econstant:
588 0 : Ignore( 10 );
589 0 : aPool << ocBad;
590 0 : aPool >> aStack;
591 0 : break;
592 : case FT_Splfunc:
593 : {
594 0 : Read( nAnz );
595 0 : Read( nStrLen );
596 :
597 0 : const size_t nMaxEntries = aIn.remainingSize();
598 0 : if (nStrLen > nMaxEntries)
599 0 : nStrLen = nMaxEntries;
600 :
601 0 : if( nStrLen )
602 : {
603 0 : boost::scoped_array<sal_Char> p(new (::std::nothrow) sal_Char[ nStrLen + 1 ]);
604 0 : if (p)
605 : {
606 0 : aIn.Read( p.get(), nStrLen );
607 0 : p[ nStrLen ] = 0x00;
608 :
609 0 : DoFunc( ocNoName, nAnz, p.get() );
610 : }
611 : else
612 0 : DoFunc( ocNoName, nAnz, NULL );
613 : }
614 : else
615 0 : DoFunc( ocNoName, nAnz, NULL );
616 : }
617 0 : break;
618 : case FT_Const10Float:
619 0 : if ( bWK123 )
620 : {
621 : double fValue;
622 0 : Read( fValue );
623 0 : aStack << aPool.Store( fValue );
624 : }
625 0 : else aStack << aPool.Store( ScfTools::ReadLongDouble( aIn ) );
626 0 : break;
627 : case FT_Snum:
628 164 : if ( bWK123 )
629 : {
630 : sal_uInt32 nValue;
631 :
632 164 : Read( nValue );
633 164 : double fValue = Snum32ToDouble( nValue );
634 164 : aStack << aPool.Store( fValue );
635 : }
636 : else
637 : {
638 : sal_Int16 nVal;
639 0 : Read( nVal );
640 0 : aStack << aPool.Store( SnumToDouble( nVal ) );
641 : }
642 164 : break;
643 : default:
644 : OSL_FAIL( "*LotusToSc::Convert(): unknown enum!" );
645 : }
646 : }
647 :
648 166 : rpErg = aPool[ aStack.Get() ];
649 :
650 : OSL_ENSURE( nBytesLeft >= 0, "*LotusToSc::Convert(): processed too much!");
651 : OSL_ENSURE( nBytesLeft <= 0, "*LotusToSc::Convert(): what happens with the rest?" );
652 :
653 166 : if( rRest )
654 0 : aIn.SeekRel( nBytesLeft ); // eventuellen Rest/Ueberlauf korrigieren
655 :
656 166 : rRest = 0;
657 :
658 166 : return ConvOK;
659 : }
660 :
661 19 : FUNC_TYPE LotusToSc::IndexToType( sal_uInt8 nIndex )
662 : {
663 : static const FUNC_TYPE pType[ 256 ] =
664 : { // Code Description
665 : FT_ConstFloat, // 0 8-Byte-IEEE-Float
666 : FT_Variable, // 1 Variable
667 : FT_Range, // 2 Range
668 : FT_Return, // 3 return
669 : FT_Braces, // 4 Bracket
670 : FT_ConstInt, // 5 2-Byte-Integer
671 : FT_ConstString, // 6 ASCII-String
672 : FT_NOP, // 7 NOP
673 : FT_Neg, // 8 Negation
674 : FT_Op, // 9 Addition
675 : FT_Op, // 10 Subtraction
676 : FT_Op, // 11 Multiplikation
677 : FT_Op, // 12 Division
678 : FT_Op, // 13 Power of
679 : FT_Op, // 14 equal
680 : FT_Op, // 15 unequal
681 : FT_Op, // 16 <=
682 : FT_Op, // 17 >=
683 : FT_Op, // 18 <
684 : FT_Op, // 19 >
685 : FT_Op, // 20 And (logic)
686 : FT_Op, // 21 Or (logic)
687 : FT_FuncFix1, // 22 Not (logic)
688 : FT_NOP, // 23 unary Plus
689 : FT_NotImpl, // 24
690 : FT_NotImpl, // 25
691 : FT_NotImpl, // 26
692 : FT_NotImpl, // 27
693 : FT_NotImpl, // 28
694 : FT_NotImpl, // 29
695 : FT_NotImpl, // 30
696 : FT_FuncFix0, // 31 Not applicable
697 : FT_FuncFix0, // 32 Error
698 : FT_FuncFix1, // 33 Absolute value ABS()
699 : FT_FuncFix1, // 34 Integer INT()
700 : FT_FuncFix1, // 35 Square Root
701 : FT_FuncFix1, // 36 Log10
702 : FT_FuncFix1, // 37 Natural Logarithmus
703 : FT_FuncFix0, // 38 PI
704 : FT_FuncFix1, // 39 Sine
705 : FT_FuncFix1, // 40 Cosine
706 : FT_FuncFix1, // 41 Tangens
707 : FT_FuncFix2, // 42 Arcus-Tangens 2 (4.Quadrant) <- TODO: correct?
708 : FT_FuncFix1, // 43 Arcus-Tangens (2.Quadrant)
709 : FT_FuncFix1, // 44 Arcus-Sinus
710 : FT_FuncFix1, // 45 Arcus-Cosinus
711 : FT_FuncFix1, // 46 Exponential function
712 : FT_FuncFix2, // 47 Modulo
713 : FT_FuncVar, // 48 Selection
714 : FT_FuncFix1, // 49 Is not applicable?
715 : FT_FuncFix1, // 50 Is Error?
716 : FT_FuncFix0, // 51 FALSE
717 : FT_FuncFix0, // 52 TRUE
718 : FT_FuncFix0, // 53 Random number
719 : FT_FuncFix3, // 54 Date
720 : FT_FuncFix0, // 55 Today
721 : FT_FuncFix3, // 56 Payment
722 : FT_FuncFix3, // 57 Present Value
723 : FT_FuncFix3, // 58 Future Value
724 : FT_FuncFix3, // 59 If ... then ... else ...
725 : FT_FuncFix1, // 60 Day of month
726 : FT_FuncFix1, // 61 Month
727 : FT_FuncFix1, // 62 Year
728 : FT_FuncFix2, // 63 Round
729 : FT_FuncFix3, // 64 Time
730 : FT_FuncFix1, // 65 Hour
731 : FT_FuncFix1, // 66 Minute
732 : FT_FuncFix1, // 67 Second
733 : FT_FuncFix1, // 68 Is Number?
734 : FT_FuncFix1, // 69 Is Text?
735 : FT_FuncFix1, // 70 Len()
736 : FT_FuncFix1, // 71 Val()
737 : FT_FuncFix2, // 72 String()
738 : FT_FuncFix3, // 73 Mid()
739 : FT_FuncFix1, // 74 Char()
740 : FT_FuncFix1, // 75 Ascii()
741 : FT_FuncFix3, // 76 Find()
742 : FT_FuncFix1, // 77 Datevalue
743 : FT_FuncFix1, // 78 Timevalue
744 : FT_FuncFix1, // 79 Cellpointer
745 : FT_FuncVar, // 80 Sum()
746 : FT_FuncVar, // 81 Avg()
747 : FT_FuncVar, // 82 Cnt()
748 : FT_FuncVar, // 83 Min()
749 : FT_FuncVar, // 84 Max()
750 : FT_FuncFix3, // 85 Vlookup()
751 : FT_FuncFix2, // 86 Npv()
752 : FT_FuncVar, // 87 Var()
753 : FT_FuncVar, // 88 Std()
754 : FT_FuncFix2, // 89 Irr()
755 : FT_FuncFix3, // 90 Hlookup()
756 : FT_FuncFix3, // 91 ?
757 : FT_FuncFix3, // 92 ?
758 : FT_FuncFix3, // 93 ?
759 : FT_FuncFix3, // 94 ?
760 : FT_FuncFix3, // 95 ?
761 : FT_FuncFix3, // 96 ?
762 : FT_FuncFix3, // 97 ?
763 : FT_FuncFix3, // 98 Index() <- TODO: correct?
764 : FT_FuncFix1, // 99 Cols()
765 : FT_FuncFix1, // 100 Rows()
766 : FT_FuncFix2, // 101 Repeat()
767 : FT_FuncFix1, // 102 Upper()
768 : FT_FuncFix1, // 103 Lower()
769 : FT_FuncFix2, // 104 Left()
770 : FT_FuncFix2, // 105 Right()
771 : FT_FuncFix4, // 106 Replace()
772 : FT_FuncFix1, // 107 Proper()
773 : FT_FuncFix2, // 108 Cell()
774 : FT_FuncFix1, // 109 Trim()
775 : FT_FuncFix1, // 110 Clean()
776 : FT_FuncFix1, // 111 F()
777 : FT_FuncFix1, // 112 Wert() (or W()?)
778 : FT_FuncFix2, // 113 Exact()
779 : FT_NotImpl, // 114 Call()
780 : FT_FuncFix1, // 115 @@()
781 : FT_FuncFix3, // 116 Rate()
782 : FT_FuncFix3, // 117 Term()
783 : FT_FuncFix3, // 118 Cterm()
784 : FT_FuncFix3, // 119 Sln()
785 : FT_FuncFix4, // 120 Syd(), Soy()
786 : FT_FuncFix4, // 121 Ddb()
787 : FT_NotImpl, // 122
788 : FT_NotImpl, // 123
789 : FT_NotImpl, // 124
790 : FT_NotImpl, // 125
791 : FT_NotImpl, // 126
792 : FT_NotImpl, // 127
793 : FT_NotImpl, // 128
794 : FT_NotImpl, // 129
795 : FT_NotImpl, // 130
796 : FT_NotImpl, // 131
797 : FT_NotImpl, // 132
798 : FT_NotImpl, // 133
799 : FT_NotImpl, // 134
800 : FT_NotImpl, // 135
801 : FT_NotImpl, // 136
802 : FT_NotImpl, // 137
803 : FT_NotImpl, // 138
804 : FT_NotImpl, // 139
805 : FT_NotImpl, // 140
806 : FT_NotImpl, // 141
807 : FT_NotImpl, // 142
808 : FT_NotImpl, // 143
809 : FT_NotImpl, // 144
810 : FT_NotImpl, // 145
811 : FT_NotImpl, // 146
812 : FT_NotImpl, // 147
813 : FT_NotImpl, // 148
814 : FT_NotImpl, // 149
815 : FT_NotImpl, // 150
816 : FT_NotImpl, // 151
817 : FT_NotImpl, // 152
818 : FT_NotImpl, // 153
819 : FT_NotImpl, // 154
820 : FT_NotImpl, // 155
821 : FT_FuncVar, // 156 TODO: ?
822 : FT_NotImpl, // 157
823 : FT_NotImpl, // 158
824 : FT_NotImpl, // 159
825 : FT_NotImpl, // 160
826 : FT_NotImpl, // 161
827 : FT_NotImpl, // 162
828 : FT_NotImpl, // 163
829 : FT_NotImpl, // 164
830 : FT_NotImpl, // 165
831 : FT_NotImpl, // 166
832 : FT_NotImpl, // 167
833 : FT_NotImpl, // 168
834 : FT_NotImpl, // 169
835 : FT_NotImpl, // 170
836 : FT_NotImpl, // 171
837 : FT_NotImpl, // 172
838 : FT_NotImpl, // 173
839 : FT_NotImpl, // 174
840 : FT_NotImpl, // 175
841 : FT_NotImpl, // 176
842 : FT_NotImpl, // 177
843 : FT_NotImpl, // 178
844 : FT_NotImpl, // 179
845 : FT_NotImpl, // 180
846 : FT_NotImpl, // 181
847 : FT_NotImpl, // 182
848 : FT_NotImpl, // 183
849 : FT_NotImpl, // 184
850 : FT_NotImpl, // 185
851 : FT_NotImpl, // 186
852 : FT_NotImpl, // 187
853 : FT_NotImpl, // 188
854 : FT_NotImpl, // 189
855 : FT_NotImpl, // 190
856 : FT_NotImpl, // 191
857 : FT_NotImpl, // 192
858 : FT_NotImpl, // 193
859 : FT_NotImpl, // 194
860 : FT_NotImpl, // 195
861 : FT_NotImpl, // 196
862 : FT_NotImpl, // 197
863 : FT_NotImpl, // 198
864 : FT_NotImpl, // 199
865 : FT_NotImpl, // 200
866 : FT_NotImpl, // 201
867 : FT_NotImpl, // 202
868 : FT_NotImpl, // 203
869 : FT_NotImpl, // 204
870 : FT_NotImpl, // 205
871 : FT_FuncVar, // 206 TODO: ?
872 : FT_NotImpl, // 207
873 : FT_NotImpl, // 208
874 : FT_NotImpl, // 209
875 : FT_NotImpl, // 210
876 : FT_NotImpl, // 211
877 : FT_NotImpl, // 212
878 : FT_NotImpl, // 213
879 : FT_NotImpl, // 214
880 : FT_NotImpl, // 215
881 : FT_NotImpl, // 216
882 : FT_NotImpl, // 217
883 : FT_NotImpl, // 218
884 : FT_NotImpl, // 219
885 : FT_NotImpl, // 220
886 : FT_NotImpl, // 221
887 : FT_NotImpl, // 222
888 : FT_NotImpl, // 223
889 : FT_NotImpl, // 224
890 : FT_NotImpl, // 225
891 : FT_NotImpl, // 226
892 : FT_NotImpl, // 227
893 : FT_NotImpl, // 228
894 : FT_NotImpl, // 229
895 : FT_NotImpl, // 230
896 : FT_NotImpl, // 231
897 : FT_NotImpl, // 232
898 : FT_NotImpl, // 233
899 : FT_NotImpl, // 234
900 : FT_NotImpl, // 235
901 : FT_NotImpl, // 236
902 : FT_NotImpl, // 237
903 : FT_NotImpl, // 238
904 : FT_NotImpl, // 239
905 : FT_NotImpl, // 240
906 : FT_NotImpl, // 241
907 : FT_NotImpl, // 242
908 : FT_NotImpl, // 243
909 : FT_NotImpl, // 244
910 : FT_NotImpl, // 245
911 : FT_NotImpl, // 246
912 : FT_NotImpl, // 247
913 : FT_NotImpl, // 248
914 : FT_NotImpl, // 249
915 : FT_NotImpl, // 250
916 : FT_NotImpl, // 251
917 : FT_NotImpl, // 252
918 : FT_NotImpl, // 253
919 : FT_NotImpl, // 254
920 : FT_FuncVar, // 255 TODO: ?
921 : };
922 19 : return pType[ nIndex ];
923 : }
924 :
925 19 : DefTokenId LotusToSc::IndexToToken( sal_uInt8 nIndex )
926 : {
927 : static const DefTokenId pToken[ 256 ] =
928 : { // Code Description
929 : ocPush, // 0 8-Byte-IEEE-Float
930 : ocPush, // 1 Variable
931 : ocPush, // 2 Range
932 : ocPush, // 3 return
933 : ocPush, // 4 Bracket
934 : ocPush, // 5 2-Byte-Integer
935 : ocPush, // 6 ASCII-String
936 : ocPush, // 7 NOP
937 : ocNegSub, // 8 Negation
938 : ocAdd, // 9 Addition
939 : ocSub, // 10 Subtraction
940 : ocMul, // 11 Multiplication
941 : ocDiv, // 12 Division
942 : ocPow, // 13 Power of
943 : ocEqual, // 14 equal
944 : ocNotEqual, // 15 unequal
945 : ocLessEqual, // 16 <=
946 : ocGreaterEqual, // 17 >=
947 : ocLess, // 18 <
948 : ocGreater, // 19 >
949 : ocAnd, // 20 And (logic)
950 : ocOr, // 21 Or (logic)
951 : ocNot, // 22 Not (logic)
952 : ocPush, // 23 unary Plus
953 : ocNoName, // 24
954 : ocNoName, // 25
955 : ocNoName, // 26
956 : ocNoName, // 27
957 : ocNoName, // 28
958 : ocNoName, // 29
959 : ocNoName, // 30
960 : ocNotAvail, // 31 Not available
961 : ocNoName, // 32 Error
962 : ocAbs, // 33 Absolute value ABS()
963 : ocInt, // 34 Integer INT()
964 : ocSqrt, // 35 Square Root
965 : ocLog10, // 36 Log10
966 : ocLn, // 37 Natural Logarithm
967 : ocPi, // 38 PI
968 : ocSin, // 39 Sine
969 : ocCos, // 40 Cosine
970 : ocTan, // 41 Tangens
971 : ocArcTan2, // 42 Arcus-Tangens 2 (4.Quadrant)
972 : ocArcTan, // 43 Arcus-Tangens (2.Quadrant)
973 : ocArcSin, // 44 Arcus-Sinus
974 : ocArcCos, // 45 Arcus-Cosinus
975 : ocExp, // 46 Exponential function
976 : ocMod, // 47 Modulo
977 : ocChoose, // 48 Selection
978 : ocIsNA, // 49 Is not available?
979 : ocIsError, // 50 Is Error?
980 : ocFalse, // 51 FALSE
981 : ocTrue, // 52 TRUE
982 : ocRandom, // 53 Random number
983 : ocGetDate, // 54 Date
984 : ocGetActDate, // 55 Today
985 : ocPMT, // 56 Payment
986 : ocPV, // 57 Present Value
987 : ocFV, // 58 Future Value
988 : ocIf, // 59 If ... then ... else ...
989 : ocGetDay, // 60 Day of month
990 : ocGetMonth, // 61 Month
991 : ocGetYear, // 62 Year
992 : ocRound, // 63 Round
993 : ocGetTime, // 64 Time
994 : ocGetHour, // 65 Hour
995 : ocGetMin, // 66 Minute
996 : ocGetSec, // 67 Second
997 : ocIsValue, // 68 Is Number?
998 : ocIsString, // 69 Is Text?
999 : ocLen, // 70 Len()
1000 : ocValue, // 71 Val()
1001 : ocFixed, // 72 String() ocFixed replacement + special case
1002 : ocMid, // 73 Mid()
1003 : ocChar, // 74 Char()
1004 : ocCode, // 75 Ascii()
1005 : ocFind, // 76 Find()
1006 : ocGetDateValue, // 77 Datevalue
1007 : ocGetTimeValue, // 78 Timevalue
1008 : ocNoName, // 79 Cellpointer
1009 : ocSum, // 80 Sum()
1010 : ocAverageA, // 81 Avg()
1011 : ocCount2, // 82 Cnt()
1012 : ocMinA, // 83 Min()
1013 : ocMaxA, // 84 Max()
1014 : ocVLookup, // 85 Vlookup()
1015 : ocNPV, // 86 Npv()
1016 : ocVarPA, // 87 Var()
1017 : ocStDevPA, // 88 Std()
1018 : ocIRR, // 89 Irr()
1019 : ocHLookup, // 90 Hlookup()
1020 : ocDBSum, // 91 XlfDsum
1021 : ocDBAverage, // 92 XlfDaverage
1022 : ocDBCount2, // 93 XlfDcount
1023 : ocDBMin, // 94 XlfDmin
1024 : ocDBMax, // 95 XlfDmax
1025 : ocDBVarP, // 96 XlfDvar
1026 : ocDBStdDevP, // 97 XlfDstdev
1027 : ocIndex, // 98 Index()
1028 : ocColumns, // 99 Cols()
1029 : ocRows, // 100 Rows()
1030 : ocRept, // 101 Repeat()
1031 : ocUpper, // 102 Upper()
1032 : ocLower, // 103 Lower()
1033 : ocLeft, // 104 Left()
1034 : ocRight, // 105 Right()
1035 : ocReplace, // 106 Replace()
1036 : ocProper, // 107 Proper()
1037 : ocNoName, // 108 Cell()
1038 : ocTrim, // 109 Trim()
1039 : ocClean, // 110 Clean()
1040 : ocFalse, // 111 F()
1041 : ocTrue, // 112 W()
1042 : ocExact, // 113 Exact()
1043 : ocNoName, // 114 Call()
1044 : ocIndirect, // 115 @@()
1045 : ocRate, // 116 Rate()
1046 : ocNoName, // 117 Term()
1047 : ocNoName, // 118 Cterm()
1048 : ocSLN, // 119 Sln()
1049 : ocSYD, // 120 Syd(), Soy()
1050 : ocDDB, // 121 Ddb()
1051 : ocNoName, // 122
1052 : ocNoName, // 123
1053 : ocNoName, // 124
1054 : ocNoName, // 125
1055 : ocNoName, // 126
1056 : ocNoName, // 127
1057 : ocNoName, // 128
1058 : ocNoName, // 129
1059 : ocNoName, // 130
1060 : ocNoName, // 131
1061 : ocNoName, // 132
1062 : ocNoName, // 133
1063 : ocNoName, // 134
1064 : ocNoName, // 135
1065 : ocNoName, // 136
1066 : ocNoName, // 137
1067 : ocNoName, // 138
1068 : ocNoName, // 139
1069 : ocNoName, // 140
1070 : ocNoName, // 141
1071 : ocNoName, // 142
1072 : ocNoName, // 143
1073 : ocNoName, // 144
1074 : ocNoName, // 145
1075 : ocNoName, // 146
1076 : ocNoName, // 147
1077 : ocNoName, // 148
1078 : ocNoName, // 149
1079 : ocNoName, // 150
1080 : ocNoName, // 151
1081 : ocNoName, // 152
1082 : ocNoName, // 153
1083 : ocNoName, // 154
1084 : ocNoName, // 155
1085 : ocNoName, // 156 TODO: ?
1086 : ocNoName, // 157
1087 : ocNoName, // 158
1088 : ocNoName, // 159
1089 : ocNoName, // 160
1090 : ocNoName, // 161
1091 : ocNoName, // 162
1092 : ocNoName, // 163
1093 : ocNoName, // 164
1094 : ocNoName, // 165
1095 : ocNoName, // 166
1096 : ocNoName, // 167
1097 : ocNoName, // 168
1098 : ocNoName, // 169
1099 : ocNoName, // 170
1100 : ocNoName, // 171
1101 : ocNoName, // 172
1102 : ocNoName, // 173
1103 : ocNoName, // 174
1104 : ocNoName, // 175
1105 : ocNoName, // 176
1106 : ocNoName, // 177
1107 : ocNoName, // 178
1108 : ocNoName, // 179
1109 : ocNoName, // 180
1110 : ocNoName, // 181
1111 : ocNoName, // 182
1112 : ocNoName, // 183
1113 : ocNoName, // 184
1114 : ocNoName, // 185
1115 : ocNoName, // 186
1116 : ocNoName, // 187
1117 : ocNoName, // 188
1118 : ocNoName, // 189
1119 : ocNoName, // 190
1120 : ocNoName, // 191
1121 : ocNoName, // 192
1122 : ocNoName, // 193
1123 : ocNoName, // 194
1124 : ocNoName, // 195
1125 : ocNoName, // 196
1126 : ocNoName, // 197
1127 : ocNoName, // 198
1128 : ocNoName, // 199
1129 : ocNoName, // 200
1130 : ocNoName, // 201
1131 : ocNoName, // 202
1132 : ocNoName, // 203
1133 : ocNoName, // 204
1134 : ocNoName, // 205
1135 : ocNoName, // 206 TODO: ?
1136 : ocNoName, // 207
1137 : ocNoName, // 208
1138 : ocNoName, // 209
1139 : ocNoName, // 210
1140 : ocNoName, // 211
1141 : ocNoName, // 212
1142 : ocNoName, // 213
1143 : ocNoName, // 214
1144 : ocNoName, // 215
1145 : ocNoName, // 216
1146 : ocNoName, // 217
1147 : ocNoName, // 218
1148 : ocNoName, // 219
1149 : ocNoName, // 220
1150 : ocNoName, // 221
1151 : ocNoName, // 222
1152 : ocNoName, // 223
1153 : ocNoName, // 224
1154 : ocNoName, // 225
1155 : ocNoName, // 226
1156 : ocNoName, // 227
1157 : ocNoName, // 228
1158 : ocNoName, // 229
1159 : ocNoName, // 230
1160 : ocNoName, // 231
1161 : ocNoName, // 232
1162 : ocNoName, // 233
1163 : ocNoName, // 234
1164 : ocNoName, // 235
1165 : ocNoName, // 236
1166 : ocNoName, // 237
1167 : ocNoName, // 238
1168 : ocNoName, // 239
1169 : ocNoName, // 240
1170 : ocNoName, // 241
1171 : ocNoName, // 242
1172 : ocNoName, // 243
1173 : ocNoName, // 244
1174 : ocNoName, // 245
1175 : ocNoName, // 246
1176 : ocNoName, // 247
1177 : ocNoName, // 248
1178 : ocNoName, // 249
1179 : ocNoName, // 250
1180 : ocNoName, // 251
1181 : ocNoName, // 252
1182 : ocNoName, // 253
1183 : ocNoName, // 254
1184 : ocNoName // 255 TODO: ?
1185 : };
1186 :
1187 19 : return pToken[ nIndex ];
1188 : }
1189 :
1190 648 : FUNC_TYPE LotusToSc::IndexToTypeWK123( sal_uInt8 nIndex )
1191 : {
1192 : static const FUNC_TYPE pType[ 256 ] =
1193 : { // Code Description
1194 : FT_Const10Float, // 0 8-Byte-IEEE-Long-Number
1195 : FT_Cref, // 1 Cell Reference
1196 : FT_Rref, // 2 Area Reference
1197 : FT_Return, // 3 return
1198 : FT_Braces, // 4 Bracket
1199 : FT_Snum, // 5 Short-Number
1200 : FT_ConstString, // 6 ASCII-String
1201 : FT_Nrref, // 7 Named range reference
1202 : FT_Absnref, // 8 Absolut named range
1203 : FT_Erref, // 9 Err range reference
1204 : FT_Ecref, // 10 Err cell reference
1205 : FT_Econstant, // 11 Err constant
1206 : FT_NotImpl, // 12
1207 : FT_NotImpl, // 13
1208 : FT_Neg, // 14 Negation
1209 : FT_Op, // 15 Addition
1210 : FT_Op, // 16 Subtraction
1211 : FT_Op, // 17 Multiplication
1212 : FT_Op, // 18 Division
1213 : FT_Op, // 19 Power of
1214 : FT_Op, // 20 equal
1215 : FT_Op, // 21 unequal
1216 : FT_Op, // 22 <=
1217 : FT_Op, // 23 >=
1218 : FT_Op, // 24 <
1219 : FT_Op, // 25 >
1220 : FT_Op, // 26 And (logical)
1221 : FT_Op, // 27 Or (logical)
1222 : FT_FuncFix1, // 28 Not (logical)
1223 : FT_NOP, // 29 unary plus
1224 : FT_Op, // 30 Concatenation
1225 : FT_FuncFix0, // 31 Not applicable
1226 : FT_FuncFix0, // 32 Error
1227 : FT_FuncFix1, // 33 Absolute value ABS()
1228 : FT_FuncFix1, // 34 Integer INT()
1229 : FT_FuncFix1, // 35 Square root
1230 : FT_FuncFix1, // 36 Log10
1231 : FT_FuncFix1, // 37 Natural Logarithm
1232 : FT_FuncFix0, // 38 PI
1233 : FT_FuncFix1, // 39 Sine
1234 : FT_FuncFix1, // 40 Cosine
1235 : FT_FuncFix1, // 41 Tangens
1236 : FT_FuncFix2, // 42 Arcus-Tangens 2 (4.Quadrant)
1237 : FT_FuncFix1, // 43 Arcus-Tangens (2.Quadrant)
1238 : FT_FuncFix1, // 44 Arcus-Sinus
1239 : FT_FuncFix1, // 45 Arcus-Cosinus
1240 : FT_FuncFix1, // 46 Exponentialfunction
1241 : FT_FuncFix2, // 47 Modulo
1242 : FT_FuncVar, // 48 Selection
1243 : FT_FuncFix1, // 49 Is not applicable?
1244 : FT_FuncFix1, // 50 Is Error?
1245 : FT_FuncFix0, // 51 FALSE
1246 : FT_FuncFix0, // 52 TRUE
1247 : FT_FuncFix0, // 53 Random number
1248 : FT_FuncFix3, // 54 Date
1249 : FT_FuncFix0, // 55 Today
1250 : FT_FuncFix3, // 56 Payment
1251 : FT_FuncFix3, // 57 Present Value
1252 : FT_FuncFix3, // 58 Future Value
1253 : FT_FuncFix3, // 59 If ... then ... else ...
1254 : FT_FuncFix1, // 60 Day of Month
1255 : FT_FuncFix1, // 61 Monat
1256 : FT_FuncFix1, // 62 Year
1257 : FT_FuncFix2, // 63 Round
1258 : FT_FuncFix3, // 64 Time
1259 : FT_FuncFix1, // 65 Hour
1260 : FT_FuncFix1, // 66 Minute
1261 : FT_FuncFix1, // 67 Second
1262 : FT_FuncFix1, // 68 Is Number?
1263 : FT_FuncFix1, // 69 Is Text?
1264 : FT_FuncFix1, // 70 Len()
1265 : FT_FuncFix1, // 71 Val()
1266 : FT_FuncFix2, // 72 String()
1267 : FT_FuncFix3, // 73 Mid()
1268 : FT_FuncFix1, // 74 Char()
1269 : FT_FuncFix1, // 75 Ascii()
1270 : FT_FuncFix3, // 76 Find()
1271 : FT_FuncFix1, // 77 Datevalue
1272 : FT_FuncFix1, // 78 Timevalue
1273 : FT_FuncFix1, // 79 Cellpointer
1274 : FT_FuncVar, // 80 Sum()
1275 : FT_FuncVar, // 81 Avg()
1276 : FT_FuncVar, // 82 Cnt()
1277 : FT_FuncVar, // 83 Min()
1278 : FT_FuncVar, // 84 Max()
1279 : FT_FuncFix3, // 85 Vlookup()
1280 : FT_FuncFix2, // 86 Npv()
1281 : FT_FuncVar, // 87 Var()
1282 : FT_FuncVar, // 88 Std()
1283 : FT_FuncFix2, // 89 Irr()
1284 : FT_FuncFix3, // 90 Hlookup()
1285 : FT_FuncVar, // 91 Dsum <- new
1286 : FT_FuncVar, // 92 Davg <- new
1287 : FT_FuncVar, // 93 Dcnt <- new
1288 : FT_FuncVar, // 94 Dmin <- new
1289 : FT_FuncVar, // 95 Dmax <- new
1290 : FT_FuncVar, // 96 Dvar <- new
1291 : FT_FuncVar, // 97 Dstd <- new
1292 : FT_FuncVar, // 98 Index() <- change!
1293 : FT_FuncFix1, // 99 Cols() <- new
1294 : FT_FuncFix1, // 100 Rows() <- new
1295 : FT_FuncFix2, // 101 Repeat() <- new
1296 : FT_FuncFix1, // 102 Upper() <- new
1297 : FT_FuncFix1, // 103 Lower() <- new
1298 : FT_FuncFix2, // 104 Left() <- new
1299 : FT_FuncFix2, // 105 Right() <- new
1300 : FT_FuncFix4, // 106 Replace() <- new
1301 : FT_FuncFix1, // 107 Proper() <- new
1302 : FT_FuncFix2, // 108 Cell() <- new
1303 : FT_FuncFix1, // 109 Trim() <- new
1304 : FT_FuncFix1, // 110 Clean() <- new
1305 : FT_FuncFix1, // 111 S() <- change in name
1306 : FT_FuncFix1, // 112 N() <- change in name
1307 : FT_FuncFix2, // 113 Exact() <- new
1308 : FT_NotImpl, // 114 App <- change in name
1309 : FT_FuncFix1, // 115 @@() <- new
1310 : FT_FuncFix3, // 116 Rate() <- new
1311 : FT_FuncFix3, // 117 Term()
1312 : FT_FuncFix3, // 118 Cterm()
1313 : FT_FuncFix3, // 119 Sln() <- new
1314 : FT_FuncFix4, // 120 Syd() <- new
1315 : FT_FuncFix4, // 121 Ddb() <- new
1316 : FT_Splfunc, // 122 Splfunc <- new
1317 : FT_FuncFix1, // 123 Sheets <- new
1318 : FT_FuncFix1, // 124 Info <- new
1319 : FT_FuncVar, // 125 Sumproduct <- new
1320 : FT_FuncFix1, // 126 Isrange <- new
1321 : FT_FuncVar, // 127 Dget <- new
1322 : FT_FuncVar, // 128 Dquery <- new
1323 : FT_FuncFix4, // 129 Coord <- new
1324 : FT_NOP, // 130 Reserved (internal) <- new
1325 : FT_FuncFix0, // 131 Today <- new
1326 : FT_FuncVar, // 132 Vdb <- new
1327 : FT_FuncVar, // 133 Dvars <- new
1328 : FT_FuncVar, // 134 Dstds <- new
1329 : FT_FuncVar, // 135 Vars <- new
1330 : FT_FuncVar, // 136 Stds <- new
1331 : FT_FuncFix2, // 137 D360 <- new
1332 : FT_NOP, // 138 Reserved (internal) <- new
1333 : FT_FuncFix0, // 139 Isapp <- new quantity ?
1334 : FT_FuncVar, // 140 Isaaf <- new quantity ?
1335 : FT_FuncFix1, // 141 Weekday <- new
1336 : FT_FuncFix3, // 142 Datedif <- new
1337 : FT_FuncVar, // 143 Rank <- new
1338 : FT_FuncFix2, // 144 Numberstring <- new
1339 : FT_FuncFix1, // 145 Datestring <- new
1340 : FT_FuncFix1, // 146 Decimal <- new
1341 : FT_FuncFix1, // 147 Hex <- new
1342 : FT_FuncFix4, // 148 Db <- new
1343 : FT_FuncFix4, // 149 Pmti <- new
1344 : FT_FuncFix4, // 150 Spi <- new
1345 : FT_FuncFix1, // 151 Fullp <- new
1346 : FT_FuncFix1, // 152 Halfp <- new
1347 : FT_FuncVar, // 153 Pureavg <- new
1348 : FT_FuncVar, // 154 Purecount <- new
1349 : FT_FuncVar, // 155 Puremax <- new
1350 : FT_FuncVar, // 156 Puremin <- new
1351 : FT_FuncVar, // 157 Purestd <- new
1352 : FT_FuncVar, // 158 Purevar <- new
1353 : FT_FuncVar, // 159 Purestds <- new
1354 : FT_FuncVar, // 160 Purevars <- new
1355 : FT_FuncFix3, // 161 Pmt2 <- new
1356 : FT_FuncFix3, // 162 Pv2 <- new
1357 : FT_FuncFix3, // 163 Fv2 <- new
1358 : FT_FuncFix3, // 164 Term2 <- new
1359 : FT_NotImpl, // 165-- <- new quantity ?
1360 : FT_FuncFix2, // 166 D360 (US-Version)
1361 : FT_NotImpl, // 167
1362 : FT_NotImpl, // 168
1363 : FT_NotImpl, // 169
1364 : FT_NotImpl, // 170
1365 : FT_NotImpl, // 171
1366 : FT_NotImpl, // 172
1367 : FT_NotImpl, // 173
1368 : FT_NotImpl, // 174
1369 : FT_NotImpl, // 175
1370 : FT_NotImpl, // 176
1371 : FT_NotImpl, // 177
1372 : FT_NotImpl, // 178
1373 : FT_NotImpl, // 179
1374 : FT_NotImpl, // 180
1375 : FT_NotImpl, // 181
1376 : FT_NotImpl, // 182
1377 : FT_NotImpl, // 183
1378 : FT_NotImpl, // 184
1379 : FT_NotImpl, // 185
1380 : FT_FuncVar, // 186 Solver <- new
1381 : FT_NotImpl, // 187
1382 : FT_NotImpl, // 188
1383 : FT_NotImpl, // 189
1384 : FT_NotImpl, // 190
1385 : FT_NotImpl, // 191
1386 : FT_NotImpl, // 192
1387 : FT_NotImpl, // 193
1388 : FT_NotImpl, // 194
1389 : FT_NotImpl, // 195
1390 : FT_NotImpl, // 196
1391 : FT_NotImpl, // 197
1392 : FT_NotImpl, // 198
1393 : FT_NotImpl, // 199
1394 : FT_NotImpl, // 200
1395 : FT_NotImpl, // 201
1396 : FT_NotImpl, // 202
1397 : FT_NotImpl, // 203
1398 : FT_NotImpl, // 204
1399 : FT_NotImpl, // 205
1400 : FT_NotImpl, // 206
1401 : FT_NotImpl, // 207
1402 : FT_NotImpl, // 208
1403 : FT_NotImpl, // 209
1404 : FT_NotImpl, // 210
1405 : FT_NotImpl, // 211
1406 : FT_NotImpl, // 212
1407 : FT_NotImpl, // 213
1408 : FT_NotImpl, // 214
1409 : FT_NotImpl, // 215
1410 : FT_NotImpl, // 216
1411 : FT_NotImpl, // 217
1412 : FT_NotImpl, // 218
1413 : FT_NotImpl, // 219
1414 : FT_NotImpl, // 220
1415 : FT_NotImpl, // 221
1416 : FT_NotImpl, // 222
1417 : FT_NotImpl, // 223
1418 : FT_NotImpl, // 224
1419 : FT_NotImpl, // 225
1420 : FT_NotImpl, // 226
1421 : FT_NotImpl, // 227
1422 : FT_NotImpl, // 228
1423 : FT_NotImpl, // 229
1424 : FT_NotImpl, // 230
1425 : FT_NotImpl, // 231
1426 : FT_NotImpl, // 232
1427 : FT_NotImpl, // 233
1428 : FT_NotImpl, // 234
1429 : FT_NotImpl, // 235
1430 : FT_NotImpl, // 236
1431 : FT_NotImpl, // 237
1432 : FT_NotImpl, // 238
1433 : FT_NotImpl, // 239
1434 : FT_NotImpl, // 240
1435 : FT_NotImpl, // 241
1436 : FT_NotImpl, // 242
1437 : FT_NotImpl, // 243
1438 : FT_NotImpl, // 244
1439 : FT_NotImpl, // 245
1440 : FT_NotImpl, // 246
1441 : FT_NotImpl, // 247
1442 : FT_NotImpl, // 248
1443 : FT_NotImpl, // 249
1444 : FT_NotImpl, // 250
1445 : FT_NotImpl, // 251
1446 : FT_NotImpl, // 252
1447 : FT_NotImpl, // 253
1448 : FT_NotImpl, // 254
1449 : FT_NotImpl, // 255
1450 : };
1451 648 : return pType[ nIndex ];
1452 : }
1453 :
1454 648 : DefTokenId LotusToSc::IndexToTokenWK123( sal_uInt8 nIndex )
1455 : {
1456 : static const DefTokenId pToken[ 256 ] =
1457 : { // Code Description
1458 : ocPush, // 0 8-Byte-IEEE-Long-Numbers
1459 : ocPush, // 1 Variable
1460 : ocPush, // 2 Bereich
1461 : ocPush, // 3 return
1462 : ocPush, // 4 Klammer
1463 : ocPush, // 5 Numbers
1464 : ocPush, // 6 ASCII-String
1465 : ocPush, // 7 Named range reference
1466 : ocPush, // 8 Absolut named range
1467 : ocPush, // 9 Err range reference
1468 : ocPush, // 10 Err cell reference
1469 : ocPush, // 11 Err constant
1470 : ocPush, // 12
1471 : ocPush, // 13
1472 : ocNegSub, // 14 Negation
1473 : ocAdd, // 15 Addition
1474 : ocSub, // 16 Subtraktion
1475 : ocMul, // 17 Multiplikation
1476 : ocDiv, // 18 Division
1477 : ocPow, // 19 Potenzierung
1478 : ocEqual, // 20 Equality
1479 : ocNotEqual, // 21 Inequality
1480 : ocLessEqual, // 22 <=
1481 : ocGreaterEqual, // 23 >=
1482 : ocLess, // 24 <
1483 : ocGreater, // 25 >
1484 : ocAnd, // 26 And (logic)
1485 : ocOr, // 27 Or (logic)
1486 : ocNot, // 28 Not (logic)
1487 : ocPush, // 29 unary Plus
1488 : ocAmpersand, // 30 Concatenation
1489 : ocNotAvail, // 31 Not available
1490 : ocNoName, // 32 Error
1491 : ocAbs, // 33 Absolute Value ABS()
1492 : ocInt, // 34 Integer INT()
1493 : ocSqrt, // 35 Square Root
1494 : ocLog10, // 36 Zehnerlogarithmus
1495 : ocLn, // 37 Natuerlicher Logarithmus
1496 : ocPi, // 38 Pi
1497 : ocSin, // 39 Sinus
1498 : ocCos, // 40 Cosinus
1499 : ocTan, // 41 Tangens
1500 : ocArcTan2, // 42 Arcus-Tangens 2 (4.Quadrant)
1501 : ocArcTan, // 43 Arcus-Tangens (2.Quadrant)
1502 : ocArcSin, // 44 Arcus-Sinus
1503 : ocArcCos, // 45 Arcus-Cosinus
1504 : ocExp, // 46 Exponentialfunction
1505 : ocMod, // 47 Modulo
1506 : ocChoose, // 48 Selection
1507 : ocIsNA, // 49 Is not available?
1508 : ocIsError, // 50 Is Error?
1509 : ocFalse, // 51 FALSE
1510 : ocTrue, // 52 TRUE
1511 : ocRandom, // 53 Random number
1512 : ocGetDate, // 54 Date
1513 : ocGetActDate, // 55 Today
1514 : ocPMT, // 56 Payment
1515 : ocPV, // 57 Present Value
1516 : ocFV, // 58 Future Value
1517 : ocIf, // 59 If... then... else...
1518 : ocGetDay, // 60 Day of Month
1519 : ocGetMonth, // 61 Month
1520 : ocGetYear, // 62 Year
1521 : ocRound, // 63 Round
1522 : ocGetTime, // 64 Time
1523 : ocGetHour, // 65 Hour
1524 : ocGetMin, // 66 Minute
1525 : ocGetSec, // 67 Second
1526 : ocIsValue, // 68 Is number?
1527 : ocIsString, // 69 Is text?
1528 : ocLen, // 70 Len()
1529 : ocValue, // 71 Val()
1530 : ocFixed, // 72 String() ocFixed ersatzweise + Spezialfall
1531 : ocMid, // 73 Mid()
1532 : ocChar, // 74 Char()
1533 : ocCode, // 75 Ascii()
1534 : ocFind, // 76 Find()
1535 : ocGetDateValue, // 77 Datevalue
1536 : ocGetTimeValue, // 78 Timevalue
1537 : ocNoName, // 79 Cellpointer
1538 : ocSum, // 80 Sum()
1539 : ocAverageA, // 81 Avg()
1540 : ocCount2, // 82 Cnt()
1541 : ocMinA, // 83 Min()
1542 : ocMaxA, // 84 Max()
1543 : ocVLookup, // 85 Vlookup()
1544 : ocNPV, // 86 Npv()
1545 : ocVarPA, // 87 Var()
1546 : ocStDevPA, // 88 Std()
1547 : ocIRR, // 89 Irr()
1548 : ocHLookup, // 90 Hlookup()
1549 : ocDBSum, // 91 XlfDsum
1550 : ocDBAverage, // 92 XlfDaverage
1551 : ocDBCount2, // 93 XlfDcount
1552 : ocDBMin, // 94 XlfDmin
1553 : ocDBMax, // 95 XlfDmax
1554 : ocDBVarP, // 96 XlfDvar
1555 : ocDBStdDevP, // 97 XlfDstdev
1556 : ocIndex, // 98 Index()
1557 : ocColumns, // 99 Cols()
1558 : ocRows, // 100 Rows()
1559 : ocRept, // 101 Repeat()
1560 : ocUpper, // 102 Upper()
1561 : ocLower, // 103 Lower()
1562 : ocLeft, // 104 Left()
1563 : ocRight, // 105 Right()
1564 : ocReplace, // 106 Replace()
1565 : ocProper, // 107 Proper()
1566 : ocNoName, // 108 Cell()
1567 : ocTrim, // 109 Trim()
1568 : ocClean, // 110 Clean()
1569 : ocNoName, // 111 F() (Excel: T()?)
1570 : ocNoName, // 112 W()
1571 : ocExact, // 113 Exact()
1572 : ocNoName, // 114 Call()
1573 : ocIndirect, // 115 @@()
1574 : ocRate, // 116 Rate()
1575 : ocNoName, // 117 Term()
1576 : ocNoName, // 118 Cterm()
1577 : ocSLN, // 119 Sln()
1578 : ocSYD, // 120 Syd(), Soy()
1579 : ocDDB, // 121 Ddb()
1580 : ocNoName, // 122 Splfunc
1581 : ocNoName, // 123 Sheets
1582 : ocNoName, // 124 Info
1583 : ocSumProduct, // 125 Sumproduct
1584 : ocNoName, // 126 Isrange
1585 : ocDBGet, // 127 Dget
1586 : ocNoName, // 128 Dquery
1587 : ocNoName, // 129 Coord
1588 : ocNoName, // 130 Reserved (internal)
1589 : ocGetActDate, // 131 Today
1590 : ocNoName, // 132 Vdb
1591 : ocDBVar, // 133 Dvars
1592 : ocDBStdDev, // 134 Dstds
1593 : ocVarA, // 135 Vars
1594 : ocStDevA, // 136 Stds
1595 : ocGetDiffDate360, // 137 D360
1596 : ocNoName, // 138 Reserved (internal)
1597 : ocNoName, // 139 Isapp
1598 : ocNoName, // 140 Isaaf
1599 : ocGetDayOfWeek, // 141 Weekday
1600 : ocGetDiffDate, // 142 Datedif
1601 : ocRank, // 143 Rank
1602 : ocNoName, // 144 Numberstring
1603 : ocNoName, // 145 Datestring
1604 : ocNoName, // 146 Decimal
1605 : ocNoName, // 147 Hex
1606 : ocNoName, // 148 Db
1607 : ocNoName, // 149 Pmti
1608 : ocNoName, // 150 Spi
1609 : ocNoName, // 151 Fullp
1610 : ocNoName, // 152 Halfp
1611 : ocAverage, // 153 Pureavg
1612 : ocCount, // 154 Purecount
1613 : ocMax, // 155 Puremax
1614 : ocMin, // 156 Puremin
1615 : ocStDevP, // 157 Purestd
1616 : ocVarP, // 158 Purevar
1617 : ocStDev, // 159 Purestds
1618 : ocVar, // 160 Purevars
1619 : ocNoName, // 161 Pmt2
1620 : ocNoName, // 162 Pv2
1621 : ocNoName, // 163 Fv2
1622 : ocNoName, // 164 Term2
1623 : ocNoName, // 165-- <- new quantity ?
1624 : ocGetDiffDate360, // 166 D360 (US-Version, ersatzweise wie ander D360-function)
1625 : ocNoName, // 167
1626 : ocNoName, // 168
1627 : ocNoName, // 169
1628 : ocNoName, // 170
1629 : ocNoName, // 171
1630 : ocNoName, // 172
1631 : ocNoName, // 173
1632 : ocNoName, // 174
1633 : ocNoName, // 175
1634 : ocNoName, // 176
1635 : ocNoName, // 177
1636 : ocNoName, // 178
1637 : ocNoName, // 179
1638 : ocNoName, // 180
1639 : ocNoName, // 181
1640 : ocNoName, // 182
1641 : ocNoName, // 183
1642 : ocNoName, // 184
1643 : ocNoName, // 185
1644 : ocNoName, // 186
1645 : ocNoName, // 187
1646 : ocNoName, // 188
1647 : ocNoName, // 189
1648 : ocNoName, // 190
1649 : ocNoName, // 191
1650 : ocNoName, // 192
1651 : ocNoName, // 193
1652 : ocNoName, // 194
1653 : ocNoName, // 195
1654 : ocNoName, // 196
1655 : ocNoName, // 197
1656 : ocNoName, // 198
1657 : ocNoName, // 199
1658 : ocNoName, // 200
1659 : ocNoName, // 201
1660 : ocNoName, // 202
1661 : ocNoName, // 203
1662 : ocNoName, // 204
1663 : ocNoName, // 205
1664 : ocNoName, // 206 ?
1665 : ocNoName, // 207
1666 : ocNoName, // 208
1667 : ocNoName, // 209
1668 : ocNoName, // 210
1669 : ocNoName, // 211
1670 : ocNoName, // 212
1671 : ocNoName, // 213
1672 : ocNoName, // 214
1673 : ocNoName, // 215
1674 : ocNoName, // 216
1675 : ocNoName, // 217
1676 : ocNoName, // 218
1677 : ocNoName, // 219
1678 : ocNoName, // 220
1679 : ocNoName, // 221
1680 : ocNoName, // 222
1681 : ocNoName, // 223
1682 : ocNoName, // 224
1683 : ocNoName, // 225
1684 : ocNoName, // 226
1685 : ocNoName, // 227
1686 : ocNoName, // 228
1687 : ocNoName, // 229
1688 : ocNoName, // 230
1689 : ocNoName, // 231
1690 : ocNoName, // 232
1691 : ocNoName, // 233
1692 : ocNoName, // 234
1693 : ocNoName, // 235
1694 : ocNoName, // 236
1695 : ocNoName, // 237
1696 : ocNoName, // 238
1697 : ocNoName, // 239
1698 : ocNoName, // 240
1699 : ocNoName, // 241
1700 : ocNoName, // 242
1701 : ocNoName, // 243
1702 : ocNoName, // 244
1703 : ocNoName, // 245
1704 : ocNoName, // 246
1705 : ocNoName, // 247
1706 : ocNoName, // 248
1707 : ocNoName, // 249
1708 : ocNoName, // 250
1709 : ocNoName, // 251
1710 : ocNoName, // 252
1711 : ocNoName, // 253
1712 : ocNoName, // 254
1713 : ocNoName // 255 ?
1714 : };
1715 :
1716 648 : return pToken[ nIndex ];
1717 : }
1718 :
1719 0 : const sal_Char* GetAddInName( const sal_uInt8 n )
1720 : {
1721 : static const sal_Char* pNames[ 256 ] =
1722 : {
1723 : NULL, // 0 8-Byte-IEEE-Float
1724 : NULL, // 1 Variable
1725 : NULL, // 2 Bereich
1726 : NULL, // 3 return
1727 : NULL, // 4 Bracket
1728 : NULL, // 5 2-Byte-Integer
1729 : NULL, // 6 ASCII-String
1730 : NULL, // 7 Named range reference
1731 : NULL, // 8 Absolut named range
1732 : NULL, // 9 Err range reference
1733 : NULL, // 10 Err cell reference
1734 : NULL, // 11 Err constant
1735 : NULL, // 12
1736 : NULL, // 13
1737 : NULL, // 14 Negation
1738 : NULL, // 15 Addition
1739 : NULL, // 16 Subtraktion
1740 : NULL, // 17 Multiplikation
1741 : NULL, // 18 Division
1742 : NULL, // 19 Potenzierung
1743 : NULL, // 20 equal
1744 : NULL, // 21 unequal
1745 : NULL, // 22 <=
1746 : NULL, // 23 >=
1747 : NULL, // 24 <
1748 : NULL, // 25 >
1749 : NULL, // 26 And (logic)
1750 : NULL, // 27 Or (logic)
1751 : NULL, // 28 Not (logic)
1752 : NULL, // 29 unary Plus
1753 : NULL, // 30 Concatenation
1754 : NULL, // 31 Not applicable
1755 : NULL, // 32 Error
1756 : NULL, // 33 Absolute Value ABS()
1757 : NULL, // 34 Integer INT()
1758 : NULL, // 35 Square Root
1759 : NULL, // 36 Zehnerlogarithmus
1760 : NULL, // 37 Natuerlicher Logarithmus
1761 : NULL, // 38 PI
1762 : NULL, // 39 Sinus
1763 : NULL, // 40 Cosinus
1764 : NULL, // 41 Tangens
1765 : NULL, // 42 Arcus-Tangens 2 (4.Quadrant)
1766 : NULL, // 43 Arcus-Tangens (2.Quadrant)
1767 : NULL, // 44 Arcus-Sinus
1768 : NULL, // 45 Arcus-Cosinus
1769 : NULL, // 46 Exponentialfunction
1770 : NULL, // 47 Modulo
1771 : NULL, // 48 Auswahl
1772 : NULL, // 49 Is not applicable?
1773 : NULL, // 50 Is Error?
1774 : NULL, // 51 FALSE
1775 : NULL, // 52 TRUE
1776 : NULL, // 53 Random number
1777 : NULL, // 54 Date
1778 : NULL, // 55 Today
1779 : NULL, // 56 Payment
1780 : NULL, // 57 Present Value
1781 : NULL, // 58 Future Value
1782 : NULL, // 59 If ... then ... else ...
1783 : NULL, // 60 Day of Month
1784 : NULL, // 61 Monat
1785 : NULL, // 62 Year
1786 : NULL, // 63 Round
1787 : NULL, // 64 Time
1788 : NULL, // 65 Hour
1789 : NULL, // 66 Minute
1790 : NULL, // 67 Second
1791 : NULL, // 68 Is Number?
1792 : NULL, // 69 Is Text?
1793 : NULL, // 70 Len()
1794 : NULL, // 71 Val()
1795 : NULL, // 72 String() ocFixed as substitute + special case
1796 : NULL, // 73 Mid()
1797 : NULL, // 74 Char()
1798 : NULL, // 75 Ascii()
1799 : NULL, // 76 Find()
1800 : NULL, // 77 Datevalue
1801 : NULL, // 78 Timevalue
1802 : "ZELLZEIGER", // 79 Cellpointer
1803 : NULL, // 80 Sum()
1804 : NULL, // 81 Avg()
1805 : NULL, // 82 Cnt()
1806 : NULL, // 83 Min()
1807 : NULL, // 84 Max()
1808 : NULL, // 85 Vlookup()
1809 : NULL, // 86 Npv()
1810 : NULL, // 87 Var()
1811 : NULL, // 88 Std()
1812 : NULL, // 89 Irr()
1813 : NULL, // 90 Hlookup()
1814 : NULL, // 91 XlfDsum
1815 : NULL, // 92 XlfDaverage
1816 : NULL, // 93 XlfDcount
1817 : NULL, // 94 XlfDmin
1818 : NULL, // 95 XlfDmax
1819 : NULL, // 96 XlfDvar
1820 : NULL, // 97 XlfDstdev
1821 : NULL, // 98 Index()
1822 : NULL, // 99 Cols()
1823 : NULL, // 100 Rows()
1824 : NULL, // 101 Repeat()
1825 : NULL, // 102 Upper()
1826 : NULL, // 103 Lower()
1827 : NULL, // 104 Left()
1828 : NULL, // 105 Right()
1829 : NULL, // 106 Replace()
1830 : NULL, // 107 Proper()
1831 : "ZELLE", // 108 Cell()
1832 : NULL, // 109 Trim()
1833 : NULL, // 110 Clean()
1834 : "F", // 111 F() (Excel: T()?)
1835 : "W", // 112 W()
1836 : NULL, // 113 Exact()
1837 : NULL, // 114 Call()
1838 : NULL, // 115 @@()
1839 : NULL, // 116 Rate()
1840 : "TERM", // 117 Term()
1841 : "CTERM", // 118 Cterm()
1842 : NULL, // 119 Sln()
1843 : NULL, // 120 Syd(), Soy()
1844 : NULL, // 121 Ddb()
1845 : "SplFunc", // 122 Splfunc
1846 : "BLAETTER", // 123 Sheets
1847 : "INFO", // 124 Info
1848 : NULL, // 125 Sumproduct
1849 : "ISTBEREICH", // 126 Isrange
1850 : NULL, // 127 Dget
1851 : "DABFRAGE", // 128 Dquery
1852 : "KOORD", // 129 Coord
1853 : NULL, // 130 Reserved (internal)
1854 : NULL, // 131 Today
1855 : NULL, // 132 Vdb
1856 : NULL, // 133 Dvars
1857 : NULL, // 134 Dstds
1858 : NULL, // 135 Vars
1859 : NULL, // 136 Stds
1860 : NULL, // 137 D360
1861 : NULL, // 138 Reserved (internal)
1862 : NULL, // 139 Isapp
1863 : "ISTDEFZUS", // 140 Isaaf
1864 : NULL, // 141 Weekday
1865 : NULL, // 142 Datedif
1866 : NULL, // 143 Rank
1867 : NULL, // 144 Numberstring
1868 : "DATUMFOLGE", // 145 Datestring
1869 : "DEZIMAL", // 146 Decimal
1870 : "HEX", // 147 Hex
1871 : NULL, // 148 Db
1872 : NULL, // 149 Pmti
1873 : NULL, // 150 Spi
1874 : NULL, // 151 Fullp
1875 : NULL, // 152 Halfp
1876 : "PURMITTELWERT", // 153 Pureavg
1877 : "PURquantity", // 154 Purecount
1878 : "PURMAX", // 155 Puremax
1879 : "PURMIN", // 156 Puremin
1880 : "PURSTDABW", // 157 Purestd
1881 : "PURVAR", // 158 Purevar
1882 : "PURSTDABWP", // 159 Purestds
1883 : "PURVARP", // 160 Purevars
1884 : NULL, // 161 Pmt2
1885 : NULL, // 162 Pv2
1886 : NULL, // 163 Fv2
1887 : NULL, // 164 Term2
1888 : NULL, // 165-- <- new quantity ?
1889 : NULL, // 166 D360 (US-Version, alternatively as in D360-function)
1890 : NULL, // 167
1891 : NULL, // 168
1892 : NULL, // 169
1893 : NULL, // 170
1894 : NULL, // 171
1895 : NULL, // 172
1896 : NULL, // 173
1897 : NULL, // 174
1898 : NULL, // 175
1899 : NULL, // 176
1900 : NULL, // 177
1901 : NULL, // 178
1902 : NULL, // 179
1903 : NULL, // 180
1904 : NULL, // 181
1905 : NULL, // 182
1906 : NULL, // 183
1907 : NULL, // 184
1908 : NULL, // 185
1909 : NULL, // 186
1910 : NULL, // 187
1911 : NULL, // 188
1912 : NULL, // 189
1913 : NULL, // 190
1914 : NULL, // 191
1915 : NULL, // 192
1916 : NULL, // 193
1917 : NULL, // 194
1918 : NULL, // 195
1919 : NULL, // 196
1920 : NULL, // 197
1921 : NULL, // 198
1922 : NULL, // 199
1923 : NULL, // 200
1924 : NULL, // 201
1925 : NULL, // 202
1926 : NULL, // 203
1927 : NULL, // 204
1928 : NULL, // 205
1929 : NULL, // 206 TODO: ?
1930 : NULL, // 207
1931 : NULL, // 208
1932 : NULL, // 209
1933 : NULL, // 210
1934 : NULL, // 211
1935 : NULL, // 212
1936 : NULL, // 213
1937 : NULL, // 214
1938 : NULL, // 215
1939 : NULL, // 216
1940 : NULL, // 217
1941 : NULL, // 218
1942 : NULL, // 219
1943 : NULL, // 220
1944 : NULL, // 221
1945 : NULL, // 222
1946 : NULL, // 223
1947 : NULL, // 224
1948 : NULL, // 225
1949 : NULL, // 226
1950 : NULL, // 227
1951 : NULL, // 228
1952 : NULL, // 229
1953 : NULL, // 230
1954 : NULL, // 231
1955 : NULL, // 232
1956 : NULL, // 233
1957 : NULL, // 234
1958 : NULL, // 235
1959 : NULL, // 236
1960 : NULL, // 237
1961 : NULL, // 238
1962 : NULL, // 239
1963 : NULL, // 240
1964 : NULL, // 241
1965 : NULL, // 242
1966 : NULL, // 243
1967 : NULL, // 244
1968 : NULL, // 245
1969 : NULL, // 246
1970 : NULL, // 247
1971 : NULL, // 248
1972 : NULL, // 249
1973 : NULL, // 250
1974 : NULL, // 251
1975 : NULL, // 252
1976 : NULL, // 253
1977 : NULL, // 254
1978 : NULL // 255 TODO: ?
1979 : };
1980 :
1981 0 : return pNames[ n ];
1982 : }
1983 :
1984 0 : static DefTokenId lcl_KnownAddIn( const OString& rTest )
1985 : {
1986 0 : DefTokenId eId = ocNoName;
1987 :
1988 0 : if (rTest == "FACT")
1989 0 : eId = ocFact;
1990 0 : else if (rTest == "ISEMPTY")
1991 0 : eId=ocIsEmpty;
1992 0 : else if (rTest == "DEGTORAD")
1993 0 : eId=ocRad;
1994 0 : else if (rTest == "RADTODEG")
1995 0 : eId=ocDeg;
1996 0 : else if (rTest == "SIGN")
1997 0 : eId=ocPlusMinus;
1998 0 : else if (rTest == "ACOSH")
1999 0 : eId=ocArcCosHyp;
2000 0 : else if (rTest == "ACOTH")
2001 0 : eId=ocArcCotHyp;
2002 0 : else if (rTest == "ASINH")
2003 0 : eId=ocArcSinHyp;
2004 0 : else if (rTest == "ATANH")
2005 0 : eId=ocArcTanHyp;
2006 0 : else if (rTest == "COSH")
2007 0 : eId=ocCosHyp;
2008 0 : else if (rTest == "COTH")
2009 0 : eId=ocCotHyp;
2010 0 : else if (rTest == "SINH")
2011 0 : eId=ocSinHyp;
2012 0 : else if (rTest == "TANH")
2013 0 : eId=ocTanHyp;
2014 0 : else if (rTest == "EVEN")
2015 0 : eId=ocEven;
2016 0 : else if (rTest == "ODD")
2017 0 : eId=ocOdd;
2018 0 : else if (rTest == "ACOT")
2019 0 : eId=ocArcCot;
2020 0 : else if (rTest == "COT")
2021 0 : eId=ocCot;
2022 0 : else if (rTest == "TRUNC")
2023 0 : eId=ocTrunc;
2024 0 : else if (rTest == "GEOMEAN")
2025 0 : eId=ocGeoMean;
2026 0 : else if (rTest == "HARMEAN")
2027 0 : eId=ocHarMean;
2028 0 : else if (rTest == "CORREL")
2029 0 : eId=ocCorrel;
2030 0 : else if (rTest == "MEDIAN")
2031 0 : eId=ocMedian;
2032 0 : else if (rTest == "COV")
2033 0 : eId=ocCovar;
2034 0 : else if (rTest == "SKEWNESS")
2035 0 : eId=ocSkew;
2036 0 : else if (rTest == "CHITEST")
2037 0 : eId=ocChiTest;
2038 0 : else if (rTest == "FTEST")
2039 0 : eId=ocFTest;
2040 0 : else if (rTest == "AVEDEV")
2041 0 : eId=ocAveDev;
2042 0 : else if (rTest == "PRODUCT")
2043 0 : eId=ocProduct;
2044 0 : else if (rTest == "PERMUT")
2045 0 : eId=ocPermut;
2046 0 : else if (rTest == "GAMMALN")
2047 0 : eId=ocGammaLn;
2048 0 : else if (rTest =="POISSON")
2049 0 : eId=ocPoissonDist;
2050 0 : else if (rTest == "NORMAL")
2051 0 : eId=ocNormDist;
2052 0 : else if (rTest == "CRITBINOMIAL")
2053 0 : eId=ocCritBinom;
2054 0 : else if (rTest == "TERM")
2055 0 : eId=ocNper;
2056 0 : else if (rTest == "CTERM")
2057 0 : eId=ocNper;
2058 0 : else if (rTest == "SUMIF")
2059 0 : eId=ocSumIf;
2060 0 : else if (rTest == "COUNTIF")
2061 0 : eId=ocCountIf;
2062 0 : else if (rTest == "DPURECOUNT")
2063 0 : eId=ocDBCount;
2064 0 : else if (rTest == "CSC")
2065 0 : eId=ocCosecant;
2066 0 : else if (rTest == "CSCH")
2067 0 : eId=ocCosecantHyp;
2068 0 : else if (rTest == "LARGE")
2069 0 : eId=ocLarge;
2070 0 : else if (rTest == "SMALL")
2071 0 : eId=ocSmall;
2072 0 : else if (rTest == "MODULO")
2073 0 : eId=ocMod;
2074 0 : else if (rTest == "ROUNDDOWN")
2075 0 : eId=ocRoundDown;
2076 0 : else if (rTest == "ROUNDUP")
2077 0 : eId=ocRoundUp;
2078 0 : else if (rTest == "SEC")
2079 0 : eId=ocSecant;
2080 0 : else if (rTest == "SECH")
2081 0 : eId=ocSecantHyp;
2082 0 : return eId;
2083 30 : }
2084 :
2085 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|