LibreOffice Module sc (master)  1
qproform.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <rtl/strbuf.hxx>
21 #include <sal/config.h>
22 #include <sal/macros.h>
23 #include <sal/log.hxx>
24 
25 #include <qproform.hxx>
26 #include <formel.hxx>
27 #include <tokstack.hxx>
28 
29 void QProToSc::ReadSRD( const ScDocument* pDoc, ScSingleRefData& rSRD, sal_Int8 nPage, sal_Int8 nCol, sal_uInt16 nRelBit )
30 {
31  sal_uInt16 nTmp = nRelBit & 0x1fff;
32  rSRD.InitAddress( ScAddress( nCol, (~nTmp + 1), 0 ) );
33  if( nRelBit & 0x4000 )
34  {
35  rSRD.SetRelCol(nCol);
36  }
37  else
38  {
39  rSRD.SetAbsCol(nCol);
40  }
41 
42  if( nRelBit & 0x2000 )
43  {
44  SCROW nRelRow = static_cast<sal_Int16>(nTmp << 3); // This looks weird... Mistake?
45  nRelRow /= 8;
46  rSRD.SetRelRow(nRelRow);
47  }
48  else
49  {
50  rSRD.SetAbsRow(nTmp);
51  }
52  if( nRelBit & 0x8000 )
53  {
54  rSRD.SetRelTab(nPage);
55  }
56  else
57  {
58  rSRD.SetAbsTab(nPage);
59  }
60  if (rSRD.toAbs(pDoc, aEingPos).Tab() != aEingPos.Tab())
61  rSRD.SetFlag3D(true);
62 }
63 
64 QProToSc::QProToSc( SvStream& rStream, svl::SharedStringPool& rSPool, const ScAddress& rRefPos ) :
65  ConverterBase(rSPool),
66  maIn( rStream )
67 {
68  aEingPos = rRefPos;
69 }
70 
71 void QProToSc::DoFunc( DefTokenId eOc, sal_uInt16 nArgs, const char* pExtString )
72 {
73  TokenId eParam[ nBufSize ];
74  sal_Int32 nCount;
75  TokenId nPush;
76 
77  bool bAddIn = false;
78 
79  if( eOc == ocNoName )
80  {
81  bAddIn = true;
82  if( pExtString )
83  {
84  OString s = OStringLiteral("QPRO_") + pExtString;
85  nPush = aPool.Store(eOc, OStringToOUString(s, maIn.GetStreamCharSet()));
86  aPool << nPush;
87  }
88  else
89  aPool << ocNoName;
90  }
91 
92  if( nArgs < nBufSize )
93  {
94  for( nCount = 0; nCount < nArgs && aStack.HasMoreTokens() ; nCount++ )
95  aStack >> eParam[ nCount ];
96 
97  if (nCount < nArgs)
98  // Adapt count to reality. All sort of binary crap is possible.
99  nArgs = static_cast<sal_uInt16>(nCount);
100  }
101  else
102  return;
103 
104  switch( eOc )
105  {
106  case ocIndex:
107  nPush = eParam[ 0 ];
108  eParam[ 0 ] = eParam[ 1 ];
109  eParam[ 1 ] = nPush;
110  IncToken( eParam[ 0 ] );
111  IncToken( eParam[ 1 ] );
112  break;
113 
114  case ocIRR:
115  nPush = eParam[ 0 ];
116  eParam[ 0 ] = eParam[ 1 ];
117  eParam[ 1 ] = nPush;
118  break;
119 
120  case ocGetYear:
121  nPush = aPool.Store( 1900.0 );
122  aPool << ocOpen;
123  break;
124 
125  default:
126  break;
127  }
128 
129  if( !bAddIn )
130  aPool << eOc;
131 
132  aPool << ocOpen;
133 
134  if( nArgs> 0 )
135  {
136  if( eOc == ocRRI )
137  {
138  // There should be at least 3 arguments, but with binary crap may not...
139  SAL_WARN_IF( nArgs < 3, "sc.filter","QProToSc::DoFunc - ocRRI expects 3 parameters but got " << nArgs);
140  // Store first 3 parameters to pool in order 2,1,0
141  if (nArgs > 3)
142  nArgs = 3;
143  }
144  else if( eOc == ocIpmt )
145  {
146  // There should be at least 4 arguments, but with binary crap may not...
147  SAL_WARN_IF( nArgs < 4, "sc.filter","QProToSc::DoFunc - ocIpmt expects 4 parameters but got " << nArgs);
148  // Store first 4 parameters to pool in order 3,2,1,0
149  if (nArgs > 4)
150  nArgs = 4;
151  }
152 
153  sal_Int16 nLast = nArgs - 1;
154  aPool << eParam[ nLast ];
155  for( nCount = nLast - 1 ; nCount >= 0 ; nCount-- )
156  {
157  aPool << ocSep << eParam[ nCount ];
158  }
159  }
160 
161  if( eOc == ocGetYear )
162  aPool << ocClose << ocSub << nPush;
163  else if( eOc == ocFixed )
164  aPool << ocSep << ocTrue << ocOpen << ocClose;
165 
166  aPool << ocClose;
167  aPool >> aStack;
168 }
169 
171 {
172  aPool << ocOpen << rParam << mnAddToken;
173  rParam = aPool.Store();
174 }
175 
176 #define SAFEDEC_OR_RET(nRef, amt, ret) \
177 do { \
178  if (nRef < amt)\
179  return ret; \
180  nRef-=amt; \
181 } while(false)
182 
183 #define SAFEREAD_OR_BREAK( aStream, i, nRef, eRet, ret ) \
184  if (!aStream.good()) \
185  { \
186  i = nRef-1; /* will be incremented at end of while */ \
187  eRet = ret; \
188  break; /* switch */ \
189  }
190 
191 ConvErr QProToSc::Convert( const ScDocument* pDoc, std::unique_ptr<ScTokenArray>& pArray )
192 {
193  sal_uInt8 nFmla[ nBufSize ];
194  sal_uInt8 nArgArray[ nBufSize ] = {0};
195  sal_Int8 nCol, nPage;
196  sal_uInt16 nIntCount = 0, nStringCount = 0, nFloatCount = 0, nDLLCount = 0, nArgCount = 0;
197  sal_uInt16 nIntArray[ nBufSize ] = {0};
198  OUString sStringArray[ nBufSize ];
199  sal_uInt16 nDLLArray[ nBufSize ] = {0};
200  sal_uInt16 nNote, nRelBits;
201  TokenId nPush;
202  ScComplexRefData aCRD;
203  ScSingleRefData aSRD;
205  DefTokenId eOc;
206  double nFloatArray[ nBufSize ] = {0};
207  const char* pExtString = nullptr;
208 
209  aCRD.InitFlags();
210  aSRD.InitFlags();
211  sal_uInt16 nRef = 0;
212  maIn.ReadUInt16( nRef );
213 
214  if( nRef < nBufSize )
215  {
216  for( sal_uInt16 i=0; i < nRef; i++)
217  {
218  nFmla[i] = 0;
219  maIn.ReadUChar( nFmla[i] );
220 
221  if( nFmla[ i ] == 0x05 )
222  {
223  sal_uInt16 nInt = 0;
224  maIn.ReadUInt16( nInt );
225  nIntArray[ nIntCount ] = nInt;
226  SAFEDEC_OR_RET(nRef, 2, ConvErr::Count);
227  nIntCount++;
228  }
229 
230  if( nFmla[ i ] == 0x00 )
231  {
232  double nFloat = 0;
233  maIn.ReadDouble( nFloat );
234  nFloatArray[ nFloatCount ] = nFloat;
235  SAFEDEC_OR_RET(nRef, 8, ConvErr::Count);
236  nFloatCount++;
237  }
238 
239  if( nFmla[ i ] == 0x1a )
240  {
241  sal_uInt8 nArg = 0;
242  sal_uInt16 nDummy, nDLLId = 0;
243  maIn.ReadUChar( nArg ).ReadUInt16( nDummy ).ReadUInt16( nDLLId );
244  nArgArray[ nArgCount ] = nArg;
245  nDLLArray[ nDLLCount ] = nDLLId;
246  SAFEDEC_OR_RET(nRef, 5, ConvErr::Count);
247  nDLLCount++;
248  nArgCount++;
249  }
250  if( nFmla[ i ] == 0x06 )
251  {
253  sStringArray[ nStringCount ] = aTmp;
254  nStringCount++;
255  SAFEDEC_OR_RET(nRef, aTmp.getLength() + 1, ConvErr::Count);
256  }
257  }
258  }
259  else
260  return ConvErr::Count;
261 
262  sal_uInt16 i = 0;
263  nIntCount = 0;
264  nFloatCount = 0;
265  nDLLCount = 0;
266  nArgCount = 0;
267  nStringCount = 0;
268  ConvErr eRet = ConvErr::OK;
269 
270  while( i < nRef && ( nFmla[ i ] != 0x03 ) )
271  {
272  eType = IndexToType( nFmla[ i ] );
273  eOc = IndexToToken( nFmla[ i ] );
274  if( eOc == ocNoName )
275  pExtString = getString( nFmla[ i ] );
276 
277  switch( eType )
278  {
279  case FT_NotImpl:
280  DoFunc( ocNoName, 0, pExtString );
281  break;
282 
283  case FT_FuncFix0:
284  DoFunc( eOc, 0, nullptr );
285  break;
286 
287  case FT_FuncFix1:
288  DoFunc( eOc, 1, nullptr );
289  break;
290 
291  case FT_FuncFix2:
292  DoFunc( eOc, 2, nullptr );
293  break;
294 
295  case FT_FuncFix3:
296  DoFunc( eOc, 3, nullptr );
297  break;
298 
299  case FT_FuncFix4:
300  DoFunc( eOc, 4, nullptr );
301  break;
302 
303  case FT_FuncFix5:
304  DoFunc( eOc, 5, nullptr );
305  break;
306 
307  case FT_FuncFix6:
308  DoFunc( eOc, 6, nullptr );
309  break;
310 
311  case FT_DLL:{
312  eOc = IndexToDLLId( nDLLArray[ nDLLCount ] );
313  sal_uInt8 nPar = nArgArray[ nArgCount ];
314  DoFunc( eOc, nPar, nullptr );
315  nDLLCount++;
316  nArgCount++;
317  }
318  break;
319 
320  case FT_Cref : // Single cell reference
321  maIn.ReadUInt16( nNote ).ReadSChar( nCol ).ReadSChar( nPage ).ReadUInt16( nRelBits );
322  SAFEREAD_OR_BREAK( maIn, i, nRef, eRet, ConvErr::Count);
323  ReadSRD( pDoc, aSRD, nPage, nCol, nRelBits );
324  aStack << aPool.Store( aSRD );
325  break;
326 
327  case FT_Range: // Block reference
328  maIn.ReadUInt16( nNote ).ReadSChar( nCol ).ReadSChar( nPage ).ReadUInt16( nRelBits );
329  SAFEREAD_OR_BREAK( maIn, i, nRef, eRet, ConvErr::Count);
330  ReadSRD( pDoc, aCRD.Ref1, nPage, nCol, nRelBits );
331  maIn.ReadSChar( nCol ).ReadSChar( nPage ).ReadUInt16( nRelBits );
332  SAFEREAD_OR_BREAK( maIn, i, nRef, eRet, ConvErr::Count);
333  ReadSRD( pDoc, aCRD.Ref2, nPage, nCol, nRelBits );
334  // Sheet name of second corner is not displayed if identical
335  if (aCRD.Ref1.IsFlag3D() && aCRD.Ref1.Tab() == aCRD.Ref2.Tab() &&
336  aCRD.Ref1.IsTabRel() == aCRD.Ref2.IsTabRel())
337  aCRD.Ref2.SetFlag3D( false);
338  aStack << aPool.Store( aCRD );
339  break;
340 
341  case FT_FuncVar:{ // Sum of a sequence of numbers
342  sal_uInt8 nArgs;
343  i++;
344  nArgs = nFmla[ i ];
345  DoFunc( eOc, nArgs, nullptr );
346  }
347  break;
348 
349  case FT_Op: // operators
350  aStack >> nPush;
351  aPool << aStack << eOc << nPush;
352  aPool >> aStack;
353  break;
354 
355  case FT_Braces:
356  aPool << ocOpen << aStack << ocClose;
357  aPool >> aStack;
358  break;
359 
360  case FT_ConstInt:{
361  sal_uInt16 nVal;
362  nVal = nIntArray[ nIntCount ];
363  aStack << aPool.Store( static_cast<double>(nVal) );
364  nIntCount++;
365  }
366  break;
367 
368  case FT_ConstFloat:{
369  double nVal;
370  nVal = nFloatArray[ nFloatCount ];
371  aStack << aPool.Store( nVal );
372  nFloatCount++;
373  }
374  break;
375 
376  case FT_ConstString:{
377  OUString aLabel(sStringArray[ nStringCount ]);
378  aStack << aPool.Store( aLabel );
379  nStringCount++;
380  }
381  break;
382 
383  case FT_Neg:
384  aPool << ocNegSub << aStack;
385  aPool >> aStack;
386  break;
387 
388  case FT_NOP: // indicates invalid opcode.
389  case FT_Return: // indicates end of formula
390  break;
391  }
392  i++;
393  }
394  pArray = aPool.GetTokenArray(pDoc, aStack.Get());
395  return eRet;
396 }
397 
398 const struct
399 {
402 } aFuncMap[] = {
403  { ocPush, FT_ConstFloat },
404  { ocPush, FT_Cref },
405  { ocPush, FT_Range },
406  { ocPush, FT_Return },
407  { ocPush, FT_Braces },
408  { ocPush, FT_ConstInt },
409  { ocPush, FT_ConstString },
410  { ocPush, FT_NOP },
411  { ocNegSub, FT_Neg }, // 0x08
412  { ocAdd, FT_Op },
413  { ocSub, FT_Op },
414  { ocMul, FT_Op },
415  { ocDiv, FT_Op },
416  { ocPow, FT_Op },
417  { ocEqual, FT_Op },
418  { ocNotEqual, FT_Op },
419  { ocLessEqual, FT_Op }, // 0x10
420  { ocGreaterEqual, FT_Op },
421  { ocLess, FT_Op },
422  { ocGreater, FT_Op },
423  { ocAnd, FT_Op },
424  { ocOr, FT_Op },
425  { ocNot, FT_FuncFix1 },
426  { ocPush, FT_NOP }, // Unary plus
427  { ocAddress, FT_FuncFix4 }, // Address of
428  { ocNoName, FT_NotImpl }, // Halt function
429  { ocNoName, FT_DLL }, // DLL function
430  { ocNoName, FT_NOP }, // Extended operands
431  { ocNoName, FT_NOP }, // Extended operands
432  { ocNoName, FT_NOP }, // Reserved
433  { ocNoName, FT_NOP }, // Reserved
434  { ocNotAvail, FT_FuncFix0 }, // NA
435  { ocNoName, FT_FuncFix0 }, // Error // 0x20
436  { ocAbs, FT_FuncFix1 },
437  { ocInt, FT_FuncFix1 },
438  { ocSqrt, FT_FuncFix1 },
439  { ocLog10, FT_FuncFix1 },
440  { ocLn, FT_FuncFix1 },
441  { ocPi, FT_FuncFix0 },
442  { ocSin, FT_FuncFix1 },
443  { ocCos, FT_FuncFix1 },
444  { ocTan, FT_FuncFix1 },
445  { ocArcTan2, FT_FuncFix2 },
446  { ocArcTan, FT_FuncFix1 },
447  { ocArcSin, FT_FuncFix1 },
448  { ocArcCos, FT_FuncFix1 },
449  { ocExp, FT_FuncFix1 },
450  { ocMod, FT_FuncFix2 },
451  { ocChoose, FT_FuncVar }, // 0x30
452  { ocIsNA, FT_FuncFix1 },
453  { ocIsError, FT_FuncFix1 },
454  { ocFalse, FT_FuncFix0 },
455  { ocTrue, FT_FuncFix0 },
456  { ocRandom, FT_FuncFix0 },
457  { ocGetDate, FT_FuncFix3 },
459  { ocNoName, FT_NotImpl }, // QPro Pmt
460  { ocNoName, FT_NotImpl }, // QPro Pv
461  { ocNoName, FT_NotImpl }, // QPro Fv
462  { ocIf, FT_FuncFix3 },
463  { ocGetDay, FT_FuncFix1 },
464  { ocGetMonth, FT_FuncFix1 },
465  { ocGetYear, FT_FuncFix1 },
466  { ocRound, FT_FuncFix2 },
467  { ocGetTime, FT_FuncFix3 }, // 0x40
468  { ocGetHour, FT_FuncFix1 },
469  { ocGetMin, FT_FuncFix1 },
470  { ocGetSec, FT_FuncFix1 },
471  { ocIsValue, FT_FuncFix1 },
472  { ocIsString, FT_FuncFix1 },
473  { ocLen, FT_FuncFix1 },
474  { ocValue, FT_FuncFix1 },
475  { ocFixed, FT_FuncFix2 },
476  { ocMid, FT_FuncFix3 },
477  { ocChar, FT_FuncFix1 },
478  { ocCode, FT_FuncFix1 },
479  { ocFind, FT_FuncFix3 },
482  { ocNoName, FT_NotImpl },
483  { ocSum, FT_FuncVar }, // 0x50
484  { ocAverage, FT_FuncVar },
485  { ocCount, FT_FuncVar },
486  { ocMin, FT_FuncVar },
487  { ocMax, FT_FuncVar },
488  { ocVLookup, FT_FuncFix3 },
489  { ocNPV, FT_FuncFix2 },
490  { ocVar, FT_FuncVar },
491  { ocNormDist, FT_FuncVar },
492  { ocIRR, FT_FuncFix2 },
493  { ocHLookup, FT_FuncFix3 },
494  { ocDBSum, FT_FuncFix3 },
496  { ocDBCount, FT_FuncFix3 },
497  { ocDBMin, FT_FuncFix3 },
498  { ocDBMax, FT_FuncFix3 },
499  { ocDBVar, FT_FuncFix3 }, // 0x60
500  { ocDBStdDev, FT_FuncFix3 },
501  { ocNoName, FT_NotImpl },
502  { ocColumns, FT_FuncFix1 },
503  { ocRows, FT_FuncFix1 },
504  { ocRept, FT_FuncFix2 },
505  { ocUpper, FT_FuncFix1 },
506  { ocLower, FT_FuncFix1 },
507  { ocLeft, FT_FuncFix2 },
508  { ocRight, FT_FuncFix2 },
509  { ocReplace, FT_FuncFix4 },
510  { ocProper, FT_FuncFix1 },
511  { ocCell, FT_FuncFix2 },
512  { ocTrim, FT_FuncFix1 },
513  { ocClean, FT_FuncFix1 },
514  { ocNoName, FT_NotImpl },
515  { ocNoName, FT_NotImpl }, // 0x70
516  { ocExact, FT_FuncFix2 },
517  { ocNoName, FT_NotImpl }, // Call()
518  { ocIndirect, FT_FuncFix1 },
519  { ocRRI, FT_FuncFix3 }, // Interest
520  { ocNoName, FT_NotImpl },
521  { ocNoName, FT_NotImpl },
522  { ocSLN, FT_FuncFix3 },
523  { ocSYD, FT_FuncFix4 },
524  { ocDDB, FT_FuncFix4 },
525  { ocStDevP, FT_FuncVar },
526  { ocVarP, FT_FuncVar },
527  { ocDBStdDevP, FT_FuncVar },
528  { ocDBVarP, FT_FuncVar },
529  { ocPV, FT_FuncFix3 }, // QPro Pval
530  { ocPMT, FT_FuncFix5 }, // QPro Paymt
531  { ocFV, FT_FuncFix3 }, // QPro Fval // 0x80
532  { ocNper, FT_FuncFix5 },
533  { ocRate, FT_FuncFix5 },
534  { ocIpmt, FT_FuncFix4 },
535  { ocPpmt, FT_FuncFix6 },
537  { ocNoName, FT_NotImpl },
538  { ocNoName, FT_NotImpl },
539  { ocNoName, FT_NotImpl },
540  { ocNoName, FT_NotImpl },
541  { ocDeg, FT_FuncFix1 },
542  { ocRad, FT_FuncFix1 },
543  { ocNoName, FT_NotImpl },
544  { ocNoName, FT_NotImpl },
546  { ocNPV, FT_FuncFix2 },
547  { ocNoName, FT_NotImpl }, // 0x90
548  { ocNoName, FT_NotImpl },
549  { ocNoName, FT_NOP },
550  { ocNoName, FT_NOP }, // 147
551  { ocNoName, FT_NOP }, // 148
552  { ocNoName, FT_NOP }, // 149
553  { ocNoName, FT_NOP }, // 150
554  { ocNoName, FT_NOP }, // 151
555  { ocNoName, FT_NOP }, // 152
556  { ocNoName, FT_NOP }, // 153
557  { ocSheet, FT_FuncFix1 },
558  { ocNoName, FT_NOP }, // 155 - opcodes do not represent any function.
559  { ocNoName, FT_NOP }, // 156
560  { ocIndex, FT_FuncFix4 },
561  { ocNoName, FT_NotImpl },
562  { ocNoName, FT_NotImpl }, // Gives the property of the particular object
563  { ocNoName, FT_NotImpl }, // Dynamic Data Exchange Link // 0x100
564  { ocNoName, FT_NotImpl } // gives properties of DOS menus
565 };
566 
568 
569 DefTokenId QProToSc::IndexToToken( sal_uInt16 nIndex )
570 {
571  if( nIndex < nIndexCount )
572  return aFuncMap[ nIndex ].nToken;
573  return ocNoName;
574 }
575 
577 {
578  if( nIndex < nIndexCount )
579  return aFuncMap[ nIndex ].nType;
580  return FT_NotImpl;
581 }
582 
583 DefTokenId QProToSc::IndexToDLLId( sal_uInt16 nIndex )
584 {
585  DefTokenId eId;
586  switch( nIndex )
587  {
588  case 0x0001:
589  eId = ocAveDev;
590  break;
591 
592  case 0x0024:
593  eId = ocGCD;
594  break;
595 
596  case 0x0025:
597  eId = ocLCM;
598  break;
599 
600  case 0x0027:
601  eId = ocCeil;
602  break;
603 
604  case 0x0028:
605  eId = ocEven;
606  break;
607 
608  case 0x0022:
609  eId = ocFact;
610  break;
611 
612  case 0x002a:
613  eId = ocFloor;
614  break;
615 
616  case 0x002d:
617  eId = ocOdd;
618  break;
619 
620  case 0x0006:
621  eId = ocBetaDist;
622  break;
623 
624  case 0x0008:
625  eId = ocBetaInv;
626  break;
627 
628  case 0x0010:
629  eId = ocCovar;
630  break;
631 
632  case 0x000b:
633  eId = ocChiInv;
634  break;
635 
636  case 0x003d:
637  eId = ocPDuration;
638  break;
639 
640  case 0x0019:
641  eId = ocFInv;
642  break;
643 
644  case 0x001a:
645  eId = ocFisher;
646  break;
647 
648  case 0x001b:
649  eId = ocFisherInv;
650  break;
651 
652  case 0x0030:
653  eId = ocMedian;
654  break;
655 
656  default:
657  eId = ocNoName;
658  break;
659  }
660  return eId;
661 }
662 
663 const char* QProToSc::getString( sal_uInt8 nIndex )
664 {
665  const char* pExtString = nullptr;
666  switch( nIndex )
667  {
668  case 57:
669  pExtString = "Pv";
670  break;
671 
672  case 58:
673  pExtString = "Fv";
674  break;
675 
676  case 98:
677  pExtString = "Index2D";
678  break;
679 
680  case 111:
681  pExtString = "S";
682  break;
683 
684  case 112:
685  pExtString = "N";
686  break;
687 
688  case 114:
689  pExtString = "CALL";
690  break;
691 
692  case 117:
693  pExtString = "TERM";
694  break;
695 
696  case 118:
697  pExtString = "CTERM";
698  break;
699 
700  case 134:
701  pExtString = "MEMAVAIL";
702  break;
703 
704  case 135:
705  pExtString = "MEMEMSAVAIL";
706  break;
707 
708  case 136:
709  pExtString = "FILEEXISTS";
710  break;
711 
712  case 137:
713  pExtString = "CURVALUE";
714  break;
715 
716  case 140:
717  pExtString = "HEX";
718  break;
719 
720  case 141:
721  pExtString = "NUM";
722  break;
723 
724  case 145:
725  pExtString = "VERSION";
726  break;
727 
728  case 157:
729  pExtString = "INDEX3D";
730  break;
731 
732  case 158:
733  pExtString = "CELLINDEX3D";
734  break;
735 
736  case 159:
737  pExtString = "PROPERTY";
738  break;
739 
740  case 160:
741  pExtString = "DDE";
742  break;
743 
744  case 161:
745  pExtString = "COMMAND";
746  break;
747 
748  default:
749  pExtString = nullptr;
750  break;
751  }
752  return pExtString;
753 }
754 
755 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsTabRel() const
Definition: refdata.hxx:70
ocChoose
ocDBCount
ocStDevP
ocSqrt
ocLeft
ocEven
ocCell
ConvErr
Definition: formel.hxx:40
ocVar
ocPi
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
Single reference (one address) into the sheet.
Definition: refdata.hxx:30
ocFixed
#define SAFEREAD_OR_BREAK(aStream, i, nRef, eRet, ret)
Definition: qproform.cxx:183
ocCos
ocPDuration
signed char sal_Int8
ocUpper
void InitFlags()
Definition: refdata.hxx:128
void SetRelCol(SCCOL nVal)
Definition: refdata.cxx:65
ocPpmt
ocDBMin
ocDBAverage
ocRept
ocClean
void SetRelTab(SCTAB nVal)
Definition: refdata.cxx:99
ocOpen
ocGetActTime
ocDBSum
ocExp
static DefTokenId IndexToDLLId(sal_uInt16 nIndex)
Definition: qproform.cxx:583
ocSLN
void IncToken(TokenId &aParam)
Definition: qproform.cxx:170
void SetAbsRow(SCROW nVal)
Definition: refdata.cxx:76
ocGetSec
ocPV
ocIsString
ocCount
ocChiInv
ocRad
ocMin
void ReadSRD(const ScDocument *pDoc, ScSingleRefData &rR, sal_Int8 nPage, sal_Int8 nCol, sal_uInt16 rRel)
Definition: qproform.cxx:29
QProToSc(SvStream &aStr, svl::SharedStringPool &rSPool, const ScAddress &rRefPos)
Definition: qproform.cxx:64
ocAddress
ScAddress aEingPos
Definition: formel.hxx:81
ocFInv
ocIf
ocGetTimeValue
ocSYD
ocFisherInv
ocLower
ocHLookup
void DoFunc(DefTokenId eOc, sal_uInt16 nArgs, const char *pExtString)
Definition: qproform.cxx:71
ocIndex
ocNegSub
TokenId Store()
Definition: tokstack.hxx:404
TokenId mnAddToken
Definition: qproform.hxx:55
ocBetaDist
TokenId Get()
Definition: tokstack.hxx:281
ocRound
ocGetMin
OpCode
ocSumProduct
ocAbs
int nCount
ocGetTime
ocGreater
ocEqual
ocReplace
SCTAB Tab() const
Definition: address.hxx:271
ocIsValue
ocNot
bool HasMoreTokens() const
Definition: tokstack.hxx:277
ocGetDay
ocMid
ocMedian
ocTrim
ocCode
ocDDB
ocColumns
ocSep
#define SAL_N_ELEMENTS(arr)
DocumentType eType
ocVarP
void SetRelRow(SCROW nVal)
Definition: refdata.cxx:82
OUString read_zeroTerminated_uInt8s_ToOUString(SvStream &rStream, rtl_TextEncoding eEnc)
ocFisher
ocDBMax
sal_Int32 nRef
ocFind
ocArcCos
ocFV
int i
ocNPV
void SetFlag3D(bool bVal)
Definition: refdata.hxx:90
ocMul
void InitAddress(const ScAddress &rAdr)
InitAddress: InitFlags and set address.
Definition: refdata.cxx:27
ocSheet
ocGetMonth
ocDBVar
void SetAbsCol(SCCOL nVal)
Definition: refdata.cxx:59
ocPush
ocSub
ScSingleRefData Ref1
Definition: refdata.hxx:125
ocFloor
static DefTokenId IndexToToken(sal_uInt16 nToken)
Definition: qproform.cxx:569
ocNotAvail
ScSingleRefData Ref2
Definition: refdata.hxx:126
ocLog10
ocCeil
ocLCM
ocMax
ocGetDate
ocInt
SvStream & ReadUChar(unsigned char &rChar)
ocDBStdDevP
const int nIndexCount
Definition: qproform.cxx:567
ocSin
ocRows
#define SAFEDEC_OR_RET(nRef, amt, ret)
Definition: qproform.cxx:176
void SetAbsTab(SCTAB nVal)
Definition: refdata.cxx:93
ocChar
ocVLookup
ocRate
SvStream & ReadDouble(double &rDouble)
ocGetDateValue
ocLess
SCTAB Tab() const
Definition: refdata.cxx:254
bool IsFlag3D() const
Definition: refdata.hxx:91
ocFalse
ocGetHour
ocIsError
TokenPool aPool
Definition: formel.hxx:79
ocBetaInv
ocOdd
ScAddress toAbs(ScSheetLimits &rLimits, const ScAddress &rPos) const
Definition: refdata.cxx:193
ocIndirect
ocOr
ocTrue
sal_Int32 SCROW
Definition: types.hxx:18
DefTokenId nToken
Definition: qproform.cxx:400
ocFact
ocAdd
ocNoName
ocArcTan
ocAverage
static const size_t nBufSize
Definition: qproform.hxx:59
QPRO_FUNC_TYPE
Definition: qproform.hxx:28
ocMod
#define SAL_WARN_IF(condition, area, stream)
unsigned char sal_uInt8
ocRandom
ocDBVarP
TokenStack aStack
Definition: formel.hxx:80
ocArcSin
ocNper
ocAnd
void InitFlags()
No default ctor, because used in ScRawToken union, set InitFlags!
Definition: refdata.hxx:55
ocLn
rtl_TextEncoding GetStreamCharSet() const
OUString aLabel
ocGetActDate
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:401
ocRRI
ocDiv
ocAveDev
Complex reference (a range) into the sheet.
Definition: refdata.hxx:123
ConvErr Convert(const ScDocument *pDoc, std::unique_ptr< ScTokenArray > &pArray)
Definition: qproform.cxx:191
static const char * getString(sal_uInt8 nIndex)
Definition: qproform.cxx:663
std::unique_ptr< ScTokenArray > GetTokenArray(const ScDocument *pDoc, const TokenId &rId)
Definition: tokstack.hxx:411
ocPow
ocIRR
ocNormDist
ocNotEqual
SvStream & maIn
Definition: qproform.hxx:56
ocPMT
ocDeg
ocGetYear
ocLessEqual
ocValue
ocIpmt
ocCovar
ocRight
ocGCD
ocIsNA
ocTan
ocDBStdDev
ocClose
ocLen
static QPRO_FUNC_TYPE IndexToType(sal_uInt8 nToken)
Definition: qproform.cxx:576
ocGreaterEqual
const struct @6 aFuncMap[]
ocArcTan2
ocSum
SvStream & ReadSChar(signed char &rChar)
ocExact
ocProper