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