LibreOffice Module sc (master)  1
interpre.hxx
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 #ifndef INCLUDED_SC_SOURCE_CORE_INC_INTERPRE_HXX
21 #define INCLUDED_SC_SOURCE_CORE_INC_INTERPRE_HXX
22 
23 #include <rtl/math.hxx>
24 #include <rtl/ustring.hxx>
25 #include <unotools/textsearch.hxx>
26 #include <formula/errorcodes.hxx>
27 #include <formula/tokenarray.hxx>
28 #include <types.hxx>
29 #include <externalrefmgr.hxx>
30 #include <calcconfig.hxx>
31 #include <token.hxx>
32 #include <math.hxx>
33 #include "parclass.hxx"
34 
35 #include <map>
36 #include <memory>
37 #include <vector>
38 #include <limits>
39 #include <ostream>
40 
41 namespace sfx2 { class LinkManager; }
42 
43 class ScDocument;
44 class SbxVariable;
45 class ScFormulaCell;
46 class ScDBRangeBase;
47 struct ScQueryParam;
48 struct ScDBQueryParamBase;
49 struct ScQueryEntry;
50 
51 struct ScSingleRefData;
52 struct ScComplexRefData;
54 
55 class ScJumpMatrix;
56 struct ScRefCellValue;
57 
58 namespace sc {
59 
60 struct CompareOptions;
61 
63 {
64  double mfSum = 0.0;
65  double mfMem = 0.0;
66  double mfCount = 0.0;
67  double mfMin = std::numeric_limits<double>::max();
68  double mfMax = std::numeric_limits<double>::lowest();
69 };
70 
71 template<typename charT, typename traits>
72 inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> & stream, const ParamIfsResult& rRes)
73 {
74  stream << "{" <<
75  "sum=" << rRes.mfSum << "," <<
76  "mem=" << rRes.mfMem << "," <<
77  "count=" << rRes.mfCount << "," <<
78  "min=" << rRes.mfMin << "," <<
79  "max=" << rRes.mfMax << "," <<
80  "}";
81 
82  return stream;
83 }
84 
85 }
86 
87 namespace svl {
88 
89 class SharedStringPool;
90 
91 }
92 
94 constexpr sal_Int32 kScInterpreterMaxStrLen = SAL_MAX_INT32 / 8;
95 
96 #define MAXSTACK (4096 / sizeof(formula::FormulaToken*))
97 
99 {
100 public:
102 };
103 
105  ifSUM, // Add up
106  ifSUMSQ, // Sums of squares
107  ifPRODUCT, // Product
108  ifAVERAGE, // Average
109  ifCOUNT, // Count Values
110  ifCOUNT2, // Count Values (not empty)
111  ifMIN, // Minimum
112  ifMAX // Maximum
113 };
114 
116 {
117  ifSUMIF, // Conditional sum
118  ifAVERAGEIF // Conditional average
119 };
120 
122 {
130 };
131 
133 {
135  { return r1.get() < r2.get(); }
136 };
137 typedef ::std::map< const formula::FormulaConstTokenRef, formula::FormulaConstTokenRef, FormulaTokenRef_less> ScTokenMatrixMap;
138 
140 {
141  // distribution function objects need the GetxxxDist methods
142  friend class ScGammaDistFunction;
143  friend class ScBetaDistFunction;
144  friend class ScTDistFunction;
145  friend class ScFDistFunction;
146  friend class ScChiDistFunction;
147  friend class ScChiSqDistFunction;
148 
149 public:
150  static void SetGlobalConfig(const ScCalcConfig& rConfig);
151  static const ScCalcConfig& GetGlobalConfig();
152 
153  static void GlobalExit(); // called by ScGlobal::Clear()
154 
158  static bool MayBeRegExp( const OUString& rStr );
159 
164  static bool MayBeWildcard( const OUString& rStr );
165 
169  static utl::SearchParam::SearchType DetectSearchType( const OUString& rStr, const ScDocument& rDoc );
170 
173  static inline double div( const double& fNumerator, const double& fDenominator );
174 
175  ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR, bool bEmpty = false);
176 
177  ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR, const std::vector<double>& rValues);
178 
183  };
184 
186 
187 private:
190 
191  static thread_local std::unique_ptr<ScTokenStack> pGlobalStack;
192  static thread_local bool bGlobalStackInUse;
193 
203  ScJumpMatrix* pJumpMatrix; // currently active array condition, if any
204  std::unique_ptr<ScTokenMatrixMap> pTokenMatrixMap; // map FormulaToken* to formula::FormulaTokenRef if in array condition
205  ScFormulaCell* pMyFormulaCell; // the cell of this formula expression
207 
208  const formula::FormulaToken* pCur; // current token
209  ScTokenStack* pStackObj; // contains the stacks
210  const formula::FormulaToken ** pStack; // the current stack
211  FormulaError nGlobalError; // global (local to this formula expression) error
212  sal_uInt16 sp; // stack pointer
213  sal_uInt16 maxsp; // the maximal used stack pointer
214  sal_uInt32 nFuncFmtIndex; // NumberFormatIndex of a function
215  sal_uInt32 nCurFmtIndex; // current NumberFormatIndex
216  sal_uInt32 nRetFmtIndex; // NumberFormatIndex of an expression, if any
217  SvNumFormatType nFuncFmtType; // NumberFormatType of a function
218  SvNumFormatType nCurFmtType; // current NumberFormatType
219  SvNumFormatType nRetFmtType; // NumberFormatType of an expression
220  FormulaError mnStringNoValueError; // the error set in ConvertStringToValue() if no value
221  SubtotalFlags mnSubTotalFlags; // flags for subtotal and aggregate functions
222  sal_uInt8 cPar; // current count of parameters
223  bool bCalcAsShown; // precision as shown
224  bool bMatrixFormula; // formula cell is a matrix formula
225 
227 
228  void MakeMatNew(ScMatrixRef& rMat, SCSIZE nC, SCSIZE nR);
229 
231  void MergeCalcConfig();
232 
233  // nMust <= nAct <= nMax ? ok : PushError
234  inline bool MustHaveParamCount( short nAct, short nMust );
235  inline bool MustHaveParamCount( short nAct, short nMust, short nMax );
236  inline bool MustHaveParamCountMin( short nAct, short nMin );
237  void PushParameterExpected();
238  void PushIllegalParameter();
239  void PushIllegalArgument();
240  void PushNoValue();
241  void PushNA();
242 
243  // Functions for accessing a document
244 
245  void ReplaceCell( ScAddress& ); // for TableOp
246  bool IsTableOpInRange( const ScRange& );
247  sal_uInt32 GetCellNumberFormat( const ScAddress& rPos, ScRefCellValue& rCell );
248  double ConvertStringToValue( const OUString& );
249 public:
250  static double ScGetGCD(double fx, double fy);
253  double ConvertStringToValue( const OUString&, FormulaError& rError, SvNumFormatType& rCurFmtType );
254 private:
255  double GetCellValue( const ScAddress&, ScRefCellValue& rCell );
256  double GetCellValueOrZero( const ScAddress&, ScRefCellValue& rCell );
257  double GetValueCellValue( const ScAddress&, double fOrig );
258  void GetCellString( svl::SharedString& rStr, ScRefCellValue& rCell );
259  static FormulaError GetCellErrCode( const ScRefCellValue& rCell );
260 
261  bool CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
262  SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
263  bool CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
264  SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
265  bool CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
266  SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
267 
268  // Stack operations
269 
273  void Push( const formula::FormulaToken& r );
274 
278  void PushWithoutError( const formula::FormulaToken& r );
279 
287 
292 
300 
306  {
307  if (nGlobalError != FormulaError::NONE)
308  {
310  return true;
311  }
312  return false;
313  }
314 
330  void PushCellResultToken( bool bDisplayEmptyAsString, const ScAddress & rAddress,
331  SvNumFormatType * pRetTypeExpr, sal_uInt32 * pRetIndexExpr, bool bFinalResult = false );
332 
334  void Pop();
335  void PopError();
336  double PopDouble();
338  void ValidateRef( const ScSingleRefData & rRef );
339  void ValidateRef( const ScComplexRefData & rRef );
340  void ValidateRef( const ScRefList & rRefList );
341  void SingleRefToVars( const ScSingleRefData & rRef, SCCOL & rCol, SCROW & rRow, SCTAB & rTab );
342  void PopSingleRef( ScAddress& );
343  void PopSingleRef(SCCOL& rCol, SCROW &rRow, SCTAB& rTab);
344  void DoubleRefToRange( const ScComplexRefData&, ScRange&, bool bDontCheckForTableOp = false );
353  void PopDoubleRef( ScRange & rRange, short & rParam, size_t & rRefInList );
354  void PopDoubleRef( ScRange&, bool bDontCheckForTableOp = false );
355  void DoubleRefToVars( const formula::FormulaToken* p,
356  SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1,
357  SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2 );
359  void PopDoubleRef(SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1,
360  SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2 );
361 
362  void PopExternalSingleRef(sal_uInt16& rFileId, OUString& rTabName, ScSingleRefData& rRef);
363 
366 
368  void PopExternalSingleRef(sal_uInt16& rFileId, OUString& rTabName, ScSingleRefData& rRef,
370 
371  void PopExternalDoubleRef(sal_uInt16& rFileId, OUString& rTabName, ScComplexRefData& rRef);
373  void PopExternalDoubleRef(ScMatrixRef& rMat);
374  void GetExternalDoubleRef(sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& aData, ScExternalRefCache::TokenArrayRef& rArray);
375  bool PopDoubleRefOrSingleRef( ScAddress& rAdr );
376  void PopDoubleRefPushMatrix();
378  // If MatrixFormula: convert svDoubleRef to svMatrix, create JumpMatrix.
379  // Else convert area reference parameters marked as ForceArray to array.
380  // Returns true if JumpMatrix created.
382  // If MatrixFormula: ConvertMatrixJumpConditionToMatrix()
383  inline void MatrixJumpConditionToMatrix();
384  // For MatrixFormula (preconditions already checked by
385  // MatrixJumpConditionToMatrix()): convert svDoubleRef to svMatrix, or if
386  // JumpMatrix currently in effect convert also other types to svMatrix so
387  // another JumpMatrix will be created by jump commands.
389  // If MatrixFormula or ForceArray: ConvertMatrixParameters()
390  inline bool MatrixParameterConversion();
391  // If MatrixFormula or ForceArray. Can be used within spreadsheet functions
392  // that do not depend on the formula cell's matrix size, for which only
393  // bMatrixFormula can be used.
394  inline bool IsInArrayContext() const;
397  void QueryMatrixType(const ScMatrixRef& xMat, SvNumFormatType& rRetTypeExpr, sal_uInt32& rRetIndexExpr);
398 
399  formula::FormulaToken* CreateFormulaDoubleToken( double fVal, SvNumFormatType nFmt = SvNumFormatType::NUMBER );
401 
402  void PushDouble(double nVal);
403  void PushInt( int nVal );
404  void PushStringBuffer( const sal_Unicode* pString );
405  void PushString( const OUString& rStr );
406  void PushString( const svl::SharedString& rString );
407  void PushSingleRef(SCCOL nCol, SCROW nRow, SCTAB nTab);
408  void PushDoubleRef(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
409  SCCOL nCol2, SCROW nRow2, SCTAB nTab2);
410  void PushExternalSingleRef(sal_uInt16 nFileId, const OUString& rTabName,
411  SCCOL nCol, SCROW nRow, SCTAB nTab);
412  void PushExternalDoubleRef(sal_uInt16 nFileId, const OUString& rTabName,
413  SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
414  SCCOL nCol2, SCROW nRow2, SCTAB nTab2);
415  void PushSingleRef( const ScRefAddress& rRef );
416  void PushDoubleRef( const ScRefAddress& rRef1, const ScRefAddress& rRef2 );
417  void PushMatrix( const sc::RangeMatrix& rMat );
418  void PushMatrix(const ScMatrixRef& pMat);
419  void PushError( FormulaError nError );
424  // peek StackType of Parameter, Parameter 1 == TOS, 2 == TOS-1, ...
426  sal_uInt8 GetByte() const { return cPar; }
427  // reverse order of stack
429  // generates a position-dependent SingleRef out of a DoubleRef
430  bool DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr );
431  double GetDoubleFromMatrix(const ScMatrixRef& pMat);
432  double GetDouble();
433  double GetDoubleWithDefault(double nDefault);
434  bool IsMissing() const;
435  sal_Int32 double_to_int32(double fVal);
437  sal_Int32 GetInt32();
439  sal_Int32 GetInt32WithDefault( sal_Int32 nDefault );
441  sal_Int16 GetInt16();
443  sal_uInt32 GetUInt32();
444  bool GetBool() { return GetDouble() != 0.0; }
446  bool GetDoubleOrString( double& rValue, svl::SharedString& rString );
449  svl::SharedString GetStringFromDouble( const double fVal);
450  // pop matrix and obtain one element, upper left or according to jump matrix
451  ScMatValType GetDoubleOrStringFromMatrix( double& rDouble, svl::SharedString& rString );
453  SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
454  SCCOL nCol2, SCROW nRow2, SCTAB nTab2 );
456  static std::unique_ptr<ScTokenMatrixMap> CreateTokenMatrixMap();
458  ScMatrixRef GetMatrix( short & rParam, size_t & rInRefList );
460 
461  void ScTableOp(); // repeated operations
462 
463  // common helper functions
464 
466  { nFuncFmtType = nCurFmtType; nFuncFmtIndex = nCurFmtIndex; }
467 
478  static inline bool CheckStringPositionArgument( double & fVal );
479 
484  inline sal_Int32 GetStringPositionArgument();
485 
486  // Check for String overflow of rResult+rAdd and set error and erase rResult
487  // if so. Return true if ok, false if overflow
488  inline bool CheckStringResultLen( OUString& rResult, const OUString& rAdd );
489 
490  // Check for String overflow of rResult+rAdd and set error and erase rResult
491  // if so. Return true if ok, false if overflow
492  inline bool CheckStringResultLen( OUStringBuffer& rResult, const OUString& rAdd );
493 
494  // Set error according to rVal, and set rVal to 0.0 if there was an error.
495  inline void TreatDoubleError( double& rVal );
496  // Lookup using ScLookupCache, @returns true if found and result address
497  bool LookupQueryWithCache( ScAddress & o_rResultPos,
498  const ScQueryParam & rParam ) const;
499 
500  void ScIfJump();
501  void ScIfError( bool bNAonly );
502  void ScChooseJump();
503 
504  // Be sure to only call this if pStack[sp-nStackLevel] really contains a
505  // ScJumpMatrixToken, no further checks are applied!
506  // Returns true if last jump was executed and result matrix pushed.
507  bool JumpMatrix( short nStackLevel );
508 
509  double Compare( ScQueryOp eOp );
513  sc::RangeMatrix CompareMat( ScQueryOp eOp, sc::CompareOptions* pOptions = nullptr );
514  ScMatrixRef QueryMat( const ScMatrixRef& pMat, sc::CompareOptions& rOptions );
515  void ScEqual();
516  void ScNotEqual();
517  void ScLess();
518  void ScGreater();
519  void ScLessEqual();
520  void ScGreaterEqual();
521  void ScAnd();
522  void ScOr();
523  void ScXor();
524  void ScNot();
525  void ScNeg();
526  void ScPercentSign();
527  void ScIntersect();
528  void ScRangeFunc();
529  void ScUnionFunc();
530  void ScPi();
531  void ScRandom();
532  void ScRandbetween();
533  void ScRandomImpl( const std::function<double( double fFirst, double fLast )>& RandomFunc,
534  double fFirst, double fLast );
535  void ScTrue();
536  void ScFalse();
537  void ScDeg();
538  void ScRad();
539  void ScSin();
540  void ScCos();
541  void ScTan();
542  void ScCot();
543  void ScArcSin();
544  void ScArcCos();
545  void ScArcTan();
546  void ScArcCot();
547  void ScSinHyp();
548  void ScCosHyp();
549  void ScTanHyp();
550  void ScCotHyp();
551  void ScArcSinHyp();
552  void ScArcCosHyp();
553  void ScArcTanHyp();
554  void ScArcCotHyp();
555  void ScCosecant();
556  void ScSecant();
557  void ScCosecantHyp();
558  void ScSecantHyp();
559  void ScExp();
560  void ScLn();
561  void ScLog10();
562  void ScSqrt();
563  void ScIsEmpty();
564  bool IsString();
565  void ScIsString();
566  void ScIsNonString();
567  void ScIsLogical();
568  void ScType();
569  void ScCell();
570  void ScCellExternal();
571  void ScIsRef();
572  void ScIsValue();
573  void ScIsFormula();
574  void ScFormula();
575  void ScRoman();
576  void ScArabic();
577  void ScIsNV();
578  void ScIsErr();
579  void ScIsError();
580  bool IsEven();
581  void ScIsEven();
582  void ScIsOdd();
583  void ScN();
584  void ScCode();
585  void ScTrim();
586  void ScUpper();
587  void ScProper();
588  void ScLower();
589  void ScLen();
590  void ScT();
591  void ScValue();
592  void ScNumberValue();
593  void ScClean();
594  void ScChar();
595  void ScJis();
596  void ScAsc();
597  void ScUnicode();
598  void ScUnichar();
599  void ScMin( bool bTextAsZero = false );
600  void ScMax( bool bTextAsZero = false );
603  size_t GetRefListArrayMaxSize( short nParamCount );
606  bool SwitchToArrayRefList( ScMatrixRef& xResMat, SCSIZE nMatRows, double fCurrent,
607  const std::function<void( SCSIZE i, double fCurrent )>& MatOpFunc, bool bDoMatOp );
608  void IterateParameters( ScIterFunc, bool bTextAsZero = false );
609  void ScSumSQ();
610  void ScSum();
611  void ScProduct();
612  void ScAverage( bool bTextAsZero = false );
613  void ScCount();
614  void ScCount2();
615  void GetStVarParams( bool bTextAsZero, double(*VarResult)( double fVal, size_t nValCount ) );
616  void ScVar( bool bTextAsZero = false );
617  void ScVarP( bool bTextAsZero = false );
618  void ScStDev( bool bTextAsZero = false );
619  void ScStDevP( bool bTextAsZero = false );
620  void ScRawSubtract();
621  void ScColumns();
622  void ScRows();
623  void ScSheets();
624  void ScColumn();
625  void ScRow();
626  void ScSheet();
627  void ScMatch();
629  void ScCountIf();
630  void ScSumIf();
631  void ScAverageIf();
632  void IterateParametersIfs( double(*ResultFunc)( const sc::ParamIfsResult& rRes ) );
633  void ScSumIfs();
634  void ScAverageIfs();
635  void ScCountIfs();
636  void ScCountEmptyCells();
637  void ScLookup();
638  void ScHLookup();
639  void ScVLookup();
640  void ScSubTotal();
641 
642  // If upon call rMissingField==true then the database field parameter may be
643  // missing (Xcl DCOUNT() syntax), or may be faked as missing by having the
644  // value 0.0 or being exactly the entire database range reference (old SO
645  // compatibility). If this was the case then rMissingField is set to true upon
646  // return. If rMissingField==false upon call all "missing cases" are considered
647  // to be an error.
648  std::unique_ptr<ScDBQueryParamBase> GetDBParams( bool& rMissingField );
649 
650  void DBIterator( ScIterFunc );
651  void ScDBSum();
652  void ScDBCount();
653  void ScDBCount2();
654  void ScDBAverage();
655  void ScDBGet();
656  void ScDBMax();
657  void ScDBMin();
658  void ScDBProduct();
659  void GetDBStVarParams( double& rVal, double& rValCount );
660  void ScDBStdDev();
661  void ScDBStdDevP();
662  void ScDBVar();
663  void ScDBVarP();
664  void ScIndirect();
665  void ScAddressFunc();
666  void ScOffset();
667  void ScIndex();
668  void ScMultiArea();
669  void ScAreas();
670  void ScCurrency();
671  void ScReplace();
672  void ScFixed();
673  void ScFind();
674  void ScExact();
675  void ScLeft();
676  void ScRight();
677  void ScSearch();
678  void ScMid();
679  void ScText();
680  void ScSubstitute();
681  void ScRept();
682  void ScRegex();
683  void ScConcat();
684  void ScConcat_MS();
685  void ScTextJoin_MS();
686  void ScIfs_MS();
687  void ScSwitch_MS();
688  void ScMinIfs_MS();
689  void ScMaxIfs_MS();
690  void ScExternal();
691  void ScMissing();
692  void ScMacro();
693  bool SetSbxVariable( SbxVariable* pVar, const ScAddress& );
695  void ScErrorType();
696  void ScErrorType_ODF();
697  void ScDBArea();
698  void ScColRowNameAuto();
699  void ScGetPivotData();
700  void ScHyperLink();
701  void ScBahtText();
702  void ScBitAnd();
703  void ScBitOr();
704  void ScBitXor();
705  void ScBitRshift();
706  void ScBitLshift();
707  void ScTTT();
708  void ScDebugVar();
709 
720  double GetDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bStrict );
721 
722  void ScGetActDate();
723  void ScGetActTime();
724  void ScGetYear();
725  void ScGetMonth();
726  void ScGetDay();
727  void ScGetDayOfWeek();
728  void ScGetWeekOfYear();
729  void ScGetIsoWeekOfYear();
730  void ScWeeknumOOo();
731  void ScEasterSunday();
732  FormulaError GetWeekendAndHolidayMasks( const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,
733  ::std::vector<double>& rSortArray, bool bWeekendMask[ 7 ] );
734  FormulaError GetWeekendAndHolidayMasks_MS( const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,
735  ::std::vector<double>& rSortArray, bool bWeekendMask[ 7 ], bool bWorkdayFunction );
736  static inline sal_Int16 GetDayOfWeek( sal_Int32 n );
737  void ScNetWorkdays( bool bOOXML_Version );
738  void ScWorkday_MS();
739  void ScGetHour();
740  void ScGetMin();
741  void ScGetSec();
742  void ScPlusMinus();
743  void ScAbs();
744  void ScInt();
745  void ScEven();
746  void ScOdd();
747  void ScCeil( bool bODFF );
748  void ScCeil_MS();
749  void ScCeil_Precise();
750  void ScFloor( bool bODFF );
751  void ScFloor_MS();
752  void ScFloor_Precise();
753  void RoundNumber( rtl_math_RoundingMode eMode );
754  void ScRound();
755  void ScRoundUp();
756  void ScRoundDown();
757  void ScGetDateValue();
758  void ScGetTimeValue();
759  void ScArcTan2();
760  void ScLog();
761  void ScGetDate();
762  void ScGetTime();
763  void ScGetDiffDate();
764  void ScGetDiffDate360();
765  void ScGetDateDif();
766  void ScPower();
767  void ScAmpersand();
768  void ScAdd();
769  void ScSub();
770  void ScMul();
771  void ScDiv();
772  void ScPow();
773  void ScCurrent();
774  void ScStyle();
775  void ScDde();
776  void ScBase();
777  void ScDecimal();
778  void ScConvertOOo();
779  void ScEuroConvert();
780  void ScRoundSignificant();
781  static void RoundSignificant( double fX, double fDigits, double &fRes );
782 
783  // financial functions
784  void ScNPV();
785  void ScIRR();
786  void ScMIRR();
787  void ScISPMT();
788 
789  static double ScGetPV(double fRate, double fNper, double fPmt,
790  double fFv, bool bPayInAdvance);
791  void ScPV();
792  void ScSYD();
793  static double ScGetDDB(double fCost, double fSalvage, double fLife,
794  double fPeriod, double fFactor);
795  void ScDDB();
796  void ScDB();
797  static double ScInterVDB(double fCost, double fSalvage, double fLife, double fLife1,
798  double fPeriod, double fFactor);
799  void ScVDB();
800  void ScPDuration();
801  void ScSLN();
802  static double ScGetPMT(double fRate, double fNper, double fPv,
803  double fFv, bool bPayInAdvance);
804  void ScPMT();
805  void ScRRI();
806  static double ScGetFV(double fRate, double fNper, double fPmt,
807  double fPv, bool bPayInAdvance);
808  void ScFV();
809  void ScNper();
810  static bool RateIteration(double fNper, double fPayment, double fPv,
811  double fFv, bool bPayType, double& fGuess);
812  void ScRate();
813  double ScGetIpmt(double fRate, double fPer, double fNper, double fPv,
814  double fFv, bool bPayInAdvance, double& fPmt);
815  void ScIpmt();
816  void ScPpmt();
817  void ScCumIpmt();
818  void ScCumPrinc();
819  void ScEffect();
820  void ScNominal();
821  void ScMod();
822  void ScIntercept();
823  void ScGCD();
824  void ScLCM();
825 
826  // matrix functions
827  void ScMatValue();
828  static void MEMat(const ScMatrixRef& mM, SCSIZE n);
829  void ScMatDet();
830  void ScMatInv();
831  void ScMatMult();
832  void ScMatTrans();
833  void ScEMat();
834  void ScMatRef();
835  ScMatrixRef MatConcat(const ScMatrixRef& pMat1, const ScMatrixRef& pMat2);
836  void ScSumProduct();
837  void ScSumX2MY2();
838  void ScSumX2DY2();
839  void ScSumXMY2();
840  void ScGrowth();
841  bool CalculateSkew(double& fSum,double& fCount,double& vSum,std::vector<double>& values);
842  void CalculateSkewOrSkewp( bool bSkewp );
843  void CalculateSlopeIntercept(bool bSlope);
844  void CalculateSmallLarge(bool bSmall);
845  void CalculatePearsonCovar( bool _bPearson, bool _bStexy, bool _bSample ); //fdo#70000 argument _bSample is ignored if _bPearson == true
846  bool CalculateTest( bool _bTemplin
847  ,const SCSIZE nC1, const SCSIZE nC2,const SCSIZE nR1,const SCSIZE nR2
848  ,const ScMatrixRef& pMat1,const ScMatrixRef& pMat2
849  ,double& fT,double& fF);
850  void CalculateLookup(bool bHLookup);
851  bool FillEntry(ScQueryEntry& rEntry);
852  void CalculateAddSub(bool _bSub);
853  void CalculateTrendGrowth(bool _bGrowth);
854  void CalculateRGPRKP(bool _bRKP);
855  void CalculateSumX2MY2SumX2DY2(bool _bSumX2DY2);
856  void CalculateMatrixValue(const ScMatrix* pMat,SCSIZE nC,SCSIZE nR);
857  bool CheckMatrix(bool _bLOG,sal_uInt8& nCase,SCSIZE& nCX,SCSIZE& nCY,SCSIZE& nRX,SCSIZE& nRY,SCSIZE& M,SCSIZE& N,ScMatrixRef& pMatX,ScMatrixRef& pMatY);
858  void ScLinest();
859  void ScLogest();
860  void ScForecast();
861  void ScForecast_Ets( ScETSType eETSType );
862  void ScFourier();
863  void ScNoName();
864  void ScBadName();
865  // Statistics:
866  static double taylor(const double* pPolynom, sal_uInt16 nMax, double x);
867  static double gauss(double x);
868 
869 public:
870  static double phi(double x);
871  static double integralPhi(double x);
872  static double gaussinv(double x);
873  static double GetPercentile( ::std::vector<double> & rArray, double fPercentile );
874 
875 
876 private:
877  double GetBetaDist(double x, double alpha, double beta); //cumulative distribution function
878  double GetBetaDistPDF(double fX, double fA, double fB); //probability density function)
879  double GetChiDist(double fChi, double fDF); // for LEGACY.CHIDIST, returns right tail
880  double GetChiSqDistCDF(double fX, double fDF); // for CHISQDIST, returns left tail
881  static double GetChiSqDistPDF(double fX, double fDF); // probability density function
882  double GetFDist(double x, double fF1, double fF2);
883  double GetTDist( double T, double fDF, int nType );
884  double Fakultaet(double x);
885  static double BinomKoeff(double n, double k);
886  double GetGamma(double x);
887  static double GetLogGamma(double x);
888  double GetBeta(double fAlpha, double fBeta);
889  static double GetLogBeta(double fAlpha, double fBeta);
890  double GetBinomDistPMF(double x, double n, double p); //probability mass function
891  double GetHypGeomDist( double x, double n, double M, double N );
892  void ScLogGamma();
893  void ScGamma();
894  void ScPhi();
895  void ScGauss();
896  void ScStdNormDist();
897  void ScStdNormDist_MS();
898  void ScFisher();
899  void ScFisherInv();
900  void ScFact();
901  void ScNormDist( int nMinParamCount );
902  void ScGammaDist( bool bODFF );
903  void ScGammaInv();
904  void ScExpDist();
905  void ScBinomDist();
906  void ScPoissonDist( bool bODFF );
907  void ScCombin();
908  void ScCombinA();
909  void ScPermut();
910  void ScPermutationA();
911  void ScB();
912  void ScHypGeomDist( int nMinParamCount );
913  void ScLogNormDist( int nMinParamCount );
914  void ScLogNormInv();
915  void ScTDist();
916  void ScTDist_MS();
917  void ScTDist_T( int nTails );
918  void ScFDist();
919  void ScFDist_LT();
920  void ScChiDist( bool bODFF); // for LEGACY.CHIDIST, returns right tail
921  void ScChiSqDist(); // returns left tail or density
922  void ScChiSqDist_MS();
923  void ScChiSqInv(); // inverse to CHISQDIST
924  void ScWeibull();
925  void ScBetaDist();
926  void ScBetaDist_MS();
927  void ScFInv();
928  void ScFInv_LT();
929  void ScTInv( int nType );
930  void ScChiInv();
931  void ScBetaInv();
932  void ScCritBinom();
933  void ScNegBinomDist();
934  void ScNegBinomDist_MS();
935  void ScKurt();
936  void ScHarMean();
937  void ScGeoMean();
938  void ScStandard();
939  void ScSkew();
940  void ScSkewp();
941  void ScMedian();
942  double GetMedian( ::std::vector<double> & rArray );
943  double GetPercentileExclusive( ::std::vector<double> & rArray, double fPercentile );
944  std::vector<double> GetTopNumberArray( SCSIZE& rCol, SCSIZE& rRow );
945  void GetNumberSequenceArray( sal_uInt8 nParamCount, ::std::vector<double>& rArray, bool bConvertTextInArray );
946  void GetSortArray( sal_uInt8 nParamCount, ::std::vector<double>& rSortArray, ::std::vector<tools::Long>* pIndexOrder, bool bConvertTextInArray, bool bAllowEmptyArray );
947  static void QuickSort(::std::vector<double>& rSortArray, ::std::vector<tools::Long>* pIndexOrder);
948  void ScModalValue();
949  void ScModalValue_MS( bool bSingle );
950  void ScAveDev();
951  void ScAggregate();
952  void ScDevSq();
953  void ScZTest();
954  void ScTTest();
955  void ScFTest();
956  void ScChiTest();
957  void ScRank( bool bAverage );
958  void ScPercentile( bool bInclusive );
959  void ScPercentrank( bool bInclusive );
960  static double GetPercentrank( ::std::vector<double> & rArray, double fVal, bool bInclusive );
961  void ScLarge();
962  void ScSmall();
963  void ScFrequency();
964  void ScQuartile( bool bInclusive );
965  void ScNormInv();
966  void ScSNormInv();
967  void ScConfidence();
968  void ScConfidenceT();
969  void ScTrimMean();
970  void ScProbability();
971  void ScCorrel();
972  void ScCovarianceP();
973  void ScCovarianceS();
974  void ScPearson();
975  void ScRSQ();
976  void ScSTEYX();
977  void ScSlope();
978  void ScTrend();
979  void ScInfo();
980  void ScLenB();
981  void ScRightB();
982  void ScLeftB();
983  void ScMidB();
984  void ScReplaceB();
985  void ScFindB();
986  void ScSearchB();
987 
988  void ScFilterXML();
989  void ScWebservice();
990  void ScEncodeURL();
991  void ScColor();
992  void ScErf();
993  void ScErfc();
994 
995  static const double fMaxGammaArgument;
996 
997  double GetGammaContFraction(double fA,double fX);
998  double GetGammaSeries(double fA,double fX);
999  double GetLowRegIGamma(double fA,double fX); // lower regularized incomplete gamma function, GAMMAQ
1000  double GetUpRegIGamma(double fA,double fX); // upper regularized incomplete gamma function, GAMMAP
1001  // probability density function; fLambda is "scale" parameter
1002  double GetGammaDistPDF(double fX, double fAlpha, double fLambda);
1003  // cumulative distribution function; fLambda is "scale" parameter
1004  double GetGammaDist(double fX, double fAlpha, double fLambda);
1005  double GetTInv( double fAlpha, double fSize, int nType );
1006 
1007 public:
1008  ScInterpreter( ScFormulaCell* pCell, ScDocument& rDoc, ScInterpreterContext& rContext,
1009  const ScAddress&, ScTokenArray&, bool bForGroupThreading = false );
1010  ~ScInterpreter();
1011 
1012  // Used only for threaded formula-groups.
1013  // Resets the interpreter object, allowing reuse of interpreter object for each cell
1014  // in the group.
1015  void Init( ScFormulaCell* pCell, const ScAddress& rPos, ScTokenArray& rTokArray );
1016 
1018 
1019  void SetError(FormulaError nError)
1020  { if (nError != FormulaError::NONE && nGlobalError == FormulaError::NONE) nGlobalError = nError; }
1021  void AssertFormulaMatrix();
1022 
1024  { mpLinkManager = pLinkMgr; }
1025 
1026  FormulaError GetError() const { return nGlobalError; }
1027  formula::StackVar GetResultType() const { return xResult->GetType(); }
1028  const svl::SharedString & GetStringResult() const;
1029  double GetNumResult() const { return xResult->GetDouble(); }
1033 };
1034 
1036 {
1037  return bMatrixFormula || pCur->IsInForceArray();
1038 }
1039 
1041 {
1042  if (IsInArrayContext())
1044 }
1045 
1047 {
1049  !pJumpMatrix && sp > 0 )
1050  return ConvertMatrixParameters();
1051  return false;
1052 }
1053 
1055 {
1056  if (!pTokenMatrixMap)
1057  pTokenMatrixMap = CreateTokenMatrixMap();
1058  return *pTokenMatrixMap;
1059 }
1060 
1061 inline bool ScInterpreter::MustHaveParamCount( short nAct, short nMust )
1062 {
1063  if ( nAct == nMust )
1064  return true;
1065  if ( nAct < nMust )
1067  else
1069  return false;
1070 }
1071 
1072 inline bool ScInterpreter::MustHaveParamCount( short nAct, short nMust, short nMax )
1073 {
1074  if ( nMust <= nAct && nAct <= nMax )
1075  return true;
1076  if ( nAct < nMust )
1078  else
1080  return false;
1081 }
1082 
1083 inline bool ScInterpreter::MustHaveParamCountMin( short nAct, short nMin )
1084 {
1085  if ( nAct >= nMin )
1086  return true;
1088  return false;
1089 }
1090 
1092 {
1093  if (!std::isfinite( fVal))
1094  {
1095  fVal = -1.0;
1096  return false;
1097  }
1098  else if (fVal < 0.0)
1099  {
1100  fVal = 0.0;
1101  return false;
1102  }
1103  else if (fVal > SAL_MAX_INT32)
1104  {
1105  fVal = static_cast<double>(SAL_MAX_INT32);
1106  return false;
1107  }
1108  return true;
1109 }
1110 
1112 {
1113  double fVal = rtl::math::approxFloor( GetDouble());
1114  if (!CheckStringPositionArgument( fVal))
1115  {
1116  fVal = -1.0;
1117  SetError( FormulaError::IllegalArgument);
1118  }
1119  return static_cast<sal_Int32>(fVal);
1120 }
1121 
1122 inline bool ScInterpreter::CheckStringResultLen( OUString& rResult, const OUString& rAdd )
1123 {
1124  if (rAdd.getLength() > kScInterpreterMaxStrLen - rResult.getLength())
1125  {
1126  SetError( FormulaError::StringOverflow );
1127  rResult.clear();
1128  return false;
1129  }
1130  return true;
1131 }
1132 
1133 inline bool ScInterpreter::CheckStringResultLen( OUStringBuffer& rResult, const OUString& rAdd )
1134 {
1135  if (rAdd.getLength() > kScInterpreterMaxStrLen - rResult.getLength())
1136  {
1137  SetError( FormulaError::StringOverflow );
1138  rResult = OUStringBuffer();
1139  return false;
1140  }
1141  return true;
1142 }
1143 
1144 inline void ScInterpreter::TreatDoubleError( double& rVal )
1145 {
1146  if ( !std::isfinite( rVal ) )
1147  {
1148  FormulaError nErr = GetDoubleErrorValue( rVal );
1149  if ( nErr != FormulaError::NONE )
1150  SetError( nErr );
1151  else
1152  SetError( FormulaError::NoValue );
1153  rVal = 0.0;
1154  }
1155 }
1156 
1157 inline double ScInterpreter::div( const double& fNumerator, const double& fDenominator )
1158 {
1159  return sc::div(fNumerator, fDenominator);
1160 }
1161 
1162 inline sal_Int16 ScInterpreter::GetDayOfWeek( sal_Int32 n )
1163 { // monday = 0, ..., sunday = 6
1164  return static_cast< sal_Int16 >( ( n - 1 ) % 7 );
1165 }
1166 
1167 #endif
1168 
1169 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Matrix data type that can store values of mixed types.
Definition: scmatrix.hxx:113
void ScErf()
Definition: interpr7.cxx:496
void ScFDist_LT()
Definition: interpr3.cxx:1706
void ScGCD()
Definition: interpr5.cxx:129
void ScDecimal()
Definition: interpr2.cxx:2962
double GetLowRegIGamma(double fA, double fX)
You must ensure fA>0.0 && fX>0.0)
Definition: interpr6.cxx:119
void ScRoundSignificant()
Definition: interpr2.cxx:1029
void ScFormula()
Definition: interpr1.cxx:2760
void ScGetDiffDate()
Definition: interpr2.cxx:670
::boost::intrusive_ptr< const FormulaToken > FormulaConstTokenRef
void ScFrequency()
Definition: interpr5.cxx:1880
void ScDBArea()
Definition: interpr4.cxx:3653
void ScBadName()
Definition: interpr3.cxx:182
void ScIndirect()
Definition: interpr1.cxx:8053
void ScArcTan2()
Definition: interpr2.cxx:1258
void GetExternalDoubleRef(sal_uInt16 nFileId, const OUString &rTabName, const ScComplexRefData &aData, ScExternalRefCache::TokenArrayRef &rArray)
Definition: interpr4.cxx:1258
void ScLessEqual()
Definition: interpr1.cxx:1231
void ScPearson()
Definition: interpr3.cxx:4530
void ScSumIfs()
Definition: interpr1.cxx:6492
ScIterFunc
Definition: interpre.hxx:104
sal_uInt32 nRetFmtIndex
Definition: interpre.hxx:216
sal_Int32 GetInt32()
if GetDouble() not within int32 limits sets nGlobalError and returns SAL_MAX_INT32 ...
Definition: interpr4.cxx:2183
void CalculateMatrixValue(const ScMatrix *pMat, SCSIZE nC, SCSIZE nR)
Definition: interpr5.cxx:707
void ScEasterSunday()
Definition: interpr2.cxx:305
static void RoundSignificant(double fX, double fDigits, double &fRes)
Definition: interpr2.cxx:1017
void ScVarP(bool bTextAsZero=false)
Definition: interpr1.cxx:4162
formula::FormulaTokenIterator aCode
Definition: interpre.hxx:195
SvNumFormatType nFuncFmtType
Definition: interpre.hxx:217
void ScGetTimeValue()
Definition: interpr2.cxx:924
void ScSwitch_MS()
Definition: interpr8.cxx:1919
void ScUnichar()
Definition: interpr1.cxx:3573
void ScErfc()
Definition: interpr7.cxx:506
void ScUnicode()
Definition: interpr1.cxx:3559
void ScDebugVar()
Definition: interpr7.cxx:450
void ScBetaInv()
Definition: interpr3.cxx:2214
void ScRank(bool bAverage)
Definition: interpr3.cxx:4219
void CalculateAddSub(bool _bSub)
Definition: interpr5.cxx:1279
void ScMacro()
Definition: interpr4.cxx:3188
static double GetPercentile(::std::vector< double > &rArray, double fPercentile)
Definition: interpr3.cxx:3413
void PushIllegalParameter()
Definition: interpr4.cxx:1906
void ScGauss()
Definition: interpr3.cxx:1142
void ScGetDay()
Definition: interpr2.cxx:132
void PushTempToken(formula::FormulaToken *)
Does substitute with formula::FormulaErrorToken in case nGlobalError is set and the token passed is n...
Definition: interpr4.cxx:612
void ScLCM()
Definition: interpr5.cxx:203
void ScCritBinom()
Definition: interpr3.cxx:1408
void ScEMat()
Definition: interpr5.cxx:730
void ScFloor_Precise()
Definition: interpr2.cxx:1208
static double phi(double x)
Definition: interpr3.cxx:192
FormulaError GetError() const
Definition: interpre.hxx:1026
Single reference (one address) into the sheet.
Definition: refdata.hxx:30
static double GetChiSqDistPDF(double fX, double fDF)
Definition: interpr3.cxx:686
void ScRangeFunc()
Definition: interpr2.cxx:2549
SvNumFormatType nRetFmtType
Definition: interpre.hxx:219
void CalculateSumX2MY2SumX2DY2(bool _bSumX2DY2)
Definition: interpr5.cxx:1801
void ScLog10()
Definition: interpr2.cxx:1295
void ScPDuration()
Definition: interpr2.cxx:1887
formula::StackVar Interpret()
Definition: interpr4.cxx:3939
void ScIntersect()
Definition: interpr2.cxx:2402
void ScStdNormDist_MS()
Definition: interpr3.cxx:1603
void PushSingleRef(SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: interpr4.cxx:1804
void ScNumberValue()
Definition: interpr1.cxx:3349
void ScLogest()
Definition: interpr5.cxx:2403
double GetFDist(double x, double fF1, double fF2)
Definition: interpr3.cxx:637
void ScChiTest()
Definition: interpr3.cxx:2797
void ScTDist_MS()
Definition: interpr3.cxx:1676
void ScTextJoin_MS()
Definition: interpr8.cxx:1511
formula::FormulaConstTokenRef xResult
Definition: interpre.hxx:202
SubtotalFlags mnSubTotalFlags
Definition: interpre.hxx:221
void ScRound()
Definition: interpr2.cxx:1002
void ScOffset()
Definition: interpr1.cxx:8374
void ReverseStack(sal_uInt8 nParamCount)
Definition: interpr4.cxx:1977
void SetLinkManager(sfx2::LinkManager *pLinkMgr)
Definition: interpre.hxx:1023
void ScEffect()
Definition: interpr2.cxx:2345
void ScStandard()
Definition: interpr3.cxx:3208
void AssertFormulaMatrix()
Definition: interpr4.cxx:4745
double GetCellValueOrZero(const ScAddress &, ScRefCellValue &rCell)
Definition: interpr4.cxx:185
void ScHypGeomDist(int nMinParamCount)
Calculates a value of the hypergeometric distribution.
Definition: interpr3.cxx:1858
void ScRoman()
Definition: interpr2.cxx:3041
void GetSortArray(sal_uInt8 nParamCount,::std::vector< double > &rSortArray,::std::vector< tools::Long > *pIndexOrder, bool bConvertTextInArray, bool bAllowEmptyArray)
Definition: interpr3.cxx:4125
void ScLogNormInv()
Definition: interpr3.cxx:2145
void ScFourier()
Definition: interpr3.cxx:5491
ScMatrixRef GetMatrix()
Definition: interpr5.cxx:478
sal_uIntPtr sal_uLong
double GetPercentileExclusive(::std::vector< double > &rArray, double fPercentile)
Definition: interpr3.cxx:3437
bool IsMissing() const
Definition: interpr4.cxx:1926
void ScDBMin()
Definition: interpr1.cxx:7973
ScCalcConfig maCalcConfig
Definition: interpre.hxx:194
sal_Int32 GetInt32WithDefault(sal_Int32 nDefault)
if GetDoubleWithDefault() not within int32 limits sets nGlobalError and returns SAL_MAX_INT32 ...
Definition: interpr4.cxx:2188
const formula::FormulaToken * pCur
Definition: interpre.hxx:208
void ScRightB()
Definition: interpr1.cxx:9099
bool DoubleRefToPosSingleRef(const ScRange &rRange, ScAddress &rAdr)
Definition: interpr4.cxx:1985
bool CalculateSkew(double &fSum, double &fCount, double &vSum, std::vector< double > &values)
Definition: interpr3.cxx:3223
void ScMax(bool bTextAsZero=false)
Definition: interpr1.cxx:3772
FormulaError GetWeekendAndHolidayMasks_MS(const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,::std::vector< double > &rSortArray, bool bWeekendMask[7], bool bWorkdayFunction)
Definition: interpr2.cxx:386
void ConvertMatrixJumpConditionToMatrix()
Definition: interpr4.cxx:1412
double GetGamma(double x)
You must ensure non integer arguments for fZ<1.
Definition: interpr3.cxx:582
void ScIsEven()
Definition: interpr1.cxx:3111
void ScGreater()
Definition: interpr1.cxx:1214
void ScDBVar()
Definition: interpr1.cxx:8039
void ScCeil_MS()
Definition: interpr2.cxx:1099
void ScHLookup()
Definition: interpr1.cxx:7194
static thread_local bool bGlobalStackInUse
Definition: interpre.hxx:192
void GetNumberSequenceArray(sal_uInt8 nParamCount,::std::vector< double > &rArray, bool bConvertTextInArray)
Definition: interpr3.cxx:3942
void ScColumn()
Definition: interpr1.cxx:4374
void ScCeil(bool bODFF)
tdf69552 ODFF1.2 function CEILING and Excel function CEILING.MATH In essence, the difference between ...
Definition: interpr2.cxx:1059
void PopSingleRef(ScAddress &)
Definition: interpr4.cxx:901
bool FillEntry(ScQueryEntry &rEntry)
Definition: interpr1.cxx:7452
void ScConcat_MS()
Definition: interpr8.cxx:1378
void ScIfs_MS()
Definition: interpr8.cxx:1852
void ScGetActDate()
Definition: interpr2.cxx:98
void ScDevSq()
Definition: interpr3.cxx:4440
void PushDoubleRef(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
Definition: interpr4.cxx:1814
void ScBitAnd()
Definition: interpr1.cxx:1640
double GetChiDist(double fChi, double fDF)
You must ensure fDF>0.0.
Definition: interpr3.cxx:666
OpCode GetOpCode() const
void ScIsEmpty()
Definition: interpr1.cxx:1966
formula::StackVar GetRawStackType()
Raw stack type without default replacements.
Definition: interpr4.cxx:1931
void ScChiSqDist_MS()
Definition: interpr3.cxx:747
void CalculateRGPRKP(bool _bRKP)
Definition: interpr5.cxx:2408
void ScIntercept()
Definition: interpr3.cxx:4726
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:104
double GetCellValue(const ScAddress &, ScRefCellValue &rCell)
Definition: interpr4.cxx:175
void ScChiSqDist()
Definition: interpr3.cxx:724
void ScStdNormDist()
Definition: interpr3.cxx:1598
void ScGetDiffDate360()
Definition: interpr2.cxx:680
void ScConcat()
Definition: interpr1.cxx:9761
void ScSumProduct()
Definition: interpr5.cxx:1749
void ScBitLshift()
Definition: interpr1.cxx:1685
void ScModalValue_MS(bool bSingle)
Definition: interpr3.cxx:3557
sal_uLong GetRetFormatIndex() const
Definition: interpre.hxx:1032
void ScDBCount2()
Definition: interpr1.cxx:7933
void ScGetMin()
Definition: interpr2.cxx:139
void ScArcCotHyp()
Definition: interpr1.cxx:1923
bool IsString()
Definition: interpr1.cxx:2020
void ScPermut()
Definition: interpr3.cxx:1196
void ScRawSubtract()
Definition: interpr6.cxx:1068
void ScGammaInv()
Definition: interpr3.cxx:2174
void ScPoissonDist(bool bODFF)
Definition: interpr3.cxx:1783
std::vector< double > GetTopNumberArray(SCSIZE &rCol, SCSIZE &rRow)
Definition: interpr3.cxx:3857
void ScEqual()
Definition: interpr1.cxx:1163
void ScFilterXML()
Definition: interpr7.cxx:39
double GetDoubleWithDefault(double nDefault)
Definition: interpr4.cxx:2146
void ScGammaDist(bool bODFF)
Definition: interpr3.cxx:2093
bool IfErrorPushError()
If nGlobalError is set push formula::FormulaErrorToken.
Definition: interpre.hxx:305
bool ConvertMatrixParameters()
Definition: interpr4.cxx:1436
bool PopDoubleRefOrSingleRef(ScAddress &rAdr)
Definition: interpr4.cxx:1316
void ScRight()
Definition: interpr1.cxx:9291
void ScGetActTime()
Definition: interpr2.cxx:106
static std::unique_ptr< ScTokenMatrixMap > CreateTokenMatrixMap()
Definition: interpr4.cxx:1431
ScTokenMatrixMap & GetTokenMatrixMap()
Definition: interpre.hxx:1054
SvNumberFormatter * pFormatter
Definition: interpre.hxx:206
void PushCellResultToken(bool bDisplayEmptyAsString, const ScAddress &rAddress, SvNumFormatType *pRetTypeExpr, sal_uInt32 *pRetIndexExpr, bool bFinalResult=false)
Obtain cell result / content from address and push as temp token.
Definition: interpr4.cxx:681
void ScNoName()
Definition: interpr3.cxx:177
void CurFmtToFuncFmt()
Definition: interpre.hxx:465
void ScCount2()
Definition: interpr6.cxx:1063
constexpr sal_Int32 kScInterpreterMaxStrLen
Arbitrary 256MB result string length limit.
Definition: interpre.hxx:94
void PushTempTokenWithoutError(const formula::FormulaToken *)
Does not substitute with formula::FormulaErrorToken in case nGlobalError is set.
Definition: interpr4.cxx:641
void PushParameterExpected()
Definition: interpr4.cxx:1901
void ScRandbetween()
Definition: interpr1.cxx:1796
SubtotalFlags
Definition: global.hxx:250
void ScCellExternal()
Definition: interpr1.cxx:2427
bool SwitchToArrayRefList(ScMatrixRef &xResMat, SCSIZE nMatRows, double fCurrent, const std::function< void(SCSIZE i, double fCurrent)> &MatOpFunc, bool bDoMatOp)
Switch to array reference list if current TOS is one and create/init or update matrix and return true...
Definition: interpr1.cxx:3588
sal_uInt16 sal_Unicode
void ScSumSQ()
Definition: interpr6.cxx:1038
sal_uInt32 GetCellNumberFormat(const ScAddress &rPos, ScRefCellValue &rCell)
Definition: interpr4.cxx:122
void ScReplaceB()
Definition: interpr1.cxx:9189
void ScCeil_Precise()
Definition: interpr2.cxx:1117
double PopDouble()
Definition: interpr4.cxx:775
ScInterpreter(ScFormulaCell *pCell, ScDocument &rDoc, ScInterpreterContext &rContext, const ScAddress &, ScTokenArray &, bool bForGroupThreading=false)
Definition: interpr4.cxx:3768
double GetBeta(double fAlpha, double fBeta)
Definition: interpr3.cxx:797
char sal_uInt16 & nParamCount
Definition: callform.cxx:53
void ScGetHour()
Definition: interpr2.cxx:158
void ScSearchB()
Definition: interpr1.cxx:9246
void ScUnionFunc()
Definition: interpr2.cxx:2569
double Fakultaet(double x)
Definition: interpr3.cxx:436
void ScCorrel()
Definition: interpr3.cxx:4514
sal_Int16 GetInt16()
if GetDouble() not within int16 limits sets nGlobalError and returns SAL_MAX_INT16 ...
Definition: interpr4.cxx:2197
void ScDBAverage()
Definition: interpr1.cxx:7963
void PushInt(int nVal)
Definition: interpr4.cxx:1776
void ScAverage(bool bTextAsZero=false)
Definition: interpr6.cxx:1053
SvNumFormatType nCurFmtType
Definition: interpre.hxx:218
sal_Int32 GetStringPositionArgument()
Obtain a sal_Int32 suitable as string position or length argument.
Definition: interpre.hxx:1111
std::unique_ptr< ScTokenMatrixMap > pTokenMatrixMap
Definition: interpre.hxx:204
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Definition: address.hxx:45
void ScNegBinomDist_MS()
Definition: interpr3.cxx:1522
ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR, bool bEmpty=false)
Definition: interpr5.cxx:298
static ScCalcConfig * mpGlobalConfig
Definition: interpre.hxx:189
void ScMatTrans()
Definition: interpr5.cxx:1127
void ScSinHyp()
Definition: interpr1.cxx:1880
void ScGetDateValue()
Definition: interpr2.cxx:166
void ScExpDist()
Definition: interpr3.cxx:1617
void PushExternalDoubleRef(sal_uInt16 nFileId, const OUString &rTabName, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
Definition: interpr4.cxx:1837
void ScFisher()
Definition: interpr3.cxx:1147
static double ScGetPMT(double fRate, double fNper, double fPv, double fFv, bool bPayInAdvance)
Definition: interpr2.cxx:1913
void CalculateSlopeIntercept(bool bSlope)
Definition: interpr3.cxx:4649
void ScNormInv()
Definition: interpr3.cxx:2118
static double ScGetFV(double fRate, double fNper, double fPmt, double fPv, bool bPayInAdvance)
Definition: interpr2.cxx:1964
ScIterFuncIf
Definition: interpre.hxx:115
void MatrixJumpConditionToMatrix()
Definition: interpre.hxx:1040
ScMatrixRef QueryMat(const ScMatrixRef &pMat, sc::CompareOptions &rOptions)
Definition: interpr1.cxx:1141
static double gaussinv(double x)
Definition: interpr3.cxx:265
ScETSType
Definition: interpre.hxx:121
void ScProper()
Definition: interpr1.cxx:3160
static const double fMaxGammaArgument
Definition: interpre.hxx:995
void ScFindB()
Definition: interpr1.cxx:9212
sal_Int32 double_to_int32(double fVal)
Definition: interpr4.cxx:2155
::boost::intrusive_ptr< ScMatrix > ScMatrixRef
Definition: types.hxx:26
void ScWebservice()
Definition: interpr7.cxx:272
void ScColumns()
Definition: interpr1.cxx:4213
void PushString(const OUString &rStr)
Definition: interpr4.cxx:1793
ScFormulaCell * pMyFormulaCell
Definition: interpre.hxx:205
FormulaError mnStringNoValueError
Definition: interpre.hxx:220
void ScArcSinHyp()
Definition: interpr1.cxx:1900
void ScSecantHyp()
Definition: interpr1.cxx:1947
FormulaError GetDoubleErrorValue(double fVal)
void ScMatDet()
Definition: interpr5.cxx:919
void ScRandomImpl(const std::function< double(double fFirst, double fLast)> &RandomFunc, double fFirst, double fLast)
Definition: interpr1.cxx:1736
void ScLinest()
Definition: interpr5.cxx:2397
const formula::FormulaToken ** pStack
Definition: interpre.hxx:210
void ScDBCount()
Definition: interpr1.cxx:7875
void ScConvertOOo()
Definition: interpr2.cxx:3018
void ScChooseJump()
Definition: interpr1.cxx:407
void ScIsString()
Definition: interpr1.cxx:2088
void PushError(FormulaError nError)
Definition: interpr4.cxx:1895
sc::RangeMatrix CompareMat(ScQueryOp eOp, sc::CompareOptions *pOptions=nullptr)
Definition: interpr1.cxx:979
void ScCount()
Definition: interpr6.cxx:1058
void ScChiSqInv()
Definition: interpr3.cxx:2405
void ScSumIf()
Definition: interpr1.cxx:5621
void ScGetWeekOfYear()
Definition: interpr2.cxx:245
double GetTDist(double T, double fDF, int nType)
Definition: interpr3.cxx:645
void ScSheet()
Definition: interpr1.cxx:4581
void ScFalse()
Definition: interpr1.cxx:1824
void ScGreaterEqual()
Definition: interpr1.cxx:1248
void ScNetWorkdays(bool bOOXML_Version)
Definition: interpr2.cxx:503
void ScColRowNameAuto()
Definition: interpr4.cxx:3670
void IterateParametersIf(ScIterFuncIf)
Definition: interpr1.cxx:5191
void ScFisherInv()
Definition: interpr3.cxx:1156
void MakeMatNew(ScMatrixRef &rMat, SCSIZE nC, SCSIZE nR)
Definition: interpr5.cxx:283
sc::RangeMatrix PopRangeMatrix()
Definition: interpr4.cxx:1642
void ScIsOdd()
Definition: interpr1.cxx:3116
double GetDouble()
Definition: interpr4.cxx:2065
std::unique_ptr< ScDBQueryParamBase > GetDBParams(bool &rMissingField)
Definition: interpr1.cxx:7659
static double gauss(double x)
Definition: interpr3.cxx:212
bool CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8 *pCellArr)
Definition: interpr4.cxx:456
ScInterpreterContext & mrContext
Definition: interpre.hxx:198
void ScInt()
Definition: interpr2.cxx:962
void ScEuroConvert()
Definition: interpr2.cxx:3313
bool LookupQueryWithCache(ScAddress &o_rResultPos, const ScQueryParam &rParam) const
Definition: interpr1.cxx:10032
bool MustHaveParamCount(short nAct, short nMust)
Definition: interpre.hxx:1061
static void SetGlobalConfig(const ScCalcConfig &rConfig)
Definition: interpr4.cxx:3862
void ScSkewp()
Definition: interpr3.cxx:3374
ScMatrixRef PopMatrix()
Definition: interpr4.cxx:1610
void ScFloor_MS()
Definition: interpr2.cxx:1187
void Push(const formula::FormulaToken &r)
Does substitute with formula::FormulaErrorToken in case nGlobalError is set and the token passed is n...
Definition: interpr4.cxx:594
formula::FormulaConstTokenRef PopToken()
Definition: interpr4.cxx:760
void ScGeoMean()
Definition: interpr3.cxx:3036
void DoubleRefToRange(const ScComplexRefData &, ScRange &, bool bDontCheckForTableOp=false)
Definition: interpr4.cxx:1023
void CalculateSmallLarge(bool bSmall)
Definition: interpr3.cxx:3643
::std::map< const formula::FormulaConstTokenRef, formula::FormulaConstTokenRef, FormulaTokenRef_less > ScTokenMatrixMap
Definition: interpre.hxx:137
void ScAddressFunc()
Definition: interpr1.cxx:8272
static void GlobalExit()
Definition: interpr4.cxx:3878
ScMatValType GetDoubleOrStringFromMatrix(double &rDouble, svl::SharedString &rString)
Definition: interpr4.cxx:2403
#define SAL_MAX_INT32
void ScTInv(int nType)
Definition: interpr3.cxx:2266
static double div(const double &fNumerator, const double &fDenominator)
Fail safe division, returning a FormulaError::DivisionByZero coded into a double if denominator is 0...
Definition: interpre.hxx:1157
double ConvertStringToValue(const OUString &)
Definition: interpr4.cxx:160
const svl::SharedString & GetStringResult() const
Definition: interpr4.cxx:4750
sal_uInt16 sp
Definition: interpre.hxx:212
void ScLookup()
Definition: interpr1.cxx:6579
void ScTrimMean()
Definition: interpr3.cxx:3828
void ScVar(bool bTextAsZero=false)
Definition: interpr1.cxx:4150
void ScCountEmptyCells()
Definition: interpr1.cxx:5111
sfx2::LinkManager * mpLinkManager
Definition: interpre.hxx:200
void ScGetIsoWeekOfYear()
Definition: interpr2.cxx:295
bool IsTableOpInRange(const ScRange &)
Definition: interpr4.cxx:104
void ScLogGamma()
Definition: interpr3.cxx:788
void ScGetDateDif()
Definition: interpr2.cxx:775
svl::SharedString PopString()
Definition: interpr4.cxx:807
void CalculatePearsonCovar(bool _bPearson, bool _bStexy, bool _bSample)
Definition: interpr3.cxx:4535
void PushDouble(double nVal)
Definition: interpr4.cxx:1769
void ScIsRef()
Definition: interpr1.cxx:2568
void ScBinomDist()
Definition: interpr3.cxx:1344
sal_Int16 SCCOL
Definition: types.hxx:22
double ScGetIpmt(double fRate, double fPer, double fNper, double fPv, double fFv, bool bPayInAdvance, double &fPmt)
Definition: interpr2.cxx:2186
void ScErrorType()
Definition: interpr1.cxx:9848
void ScPercentile(bool bInclusive)
Definition: interpr3.cxx:3467
double GetGammaDist(double fX, double fAlpha, double fLambda)
Gamma distribution, cumulative distribution function.
Definition: interpr6.cxx:198
size_t GetRefListArrayMaxSize(short nParamCount)
Check for array of references to determine the maximum size of a return column vector if in array con...
Definition: interpr6.cxx:469
static double GetLogGamma(double x)
You must ensure fZ>0.
Definition: interpr3.cxx:626
void ScAbs()
Definition: interpr2.cxx:957
sal_uInt16 & nParam
Definition: callform.cxx:57
void ScMaxIfs_MS()
Definition: interpr1.cxx:6562
Base class for abstracting range data backends for database functions.
Definition: doubleref.hxx:38
ScMatrixRef CreateMatrixFromDoubleRef(const formula::FormulaToken *pToken, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
Definition: interpr5.cxx:316
void PopDoubleRef(ScRange &rRange, short &rParam, size_t &rRefInList)
If formula::StackVar formula::svDoubleRef pop ScDoubleRefToken and return values of ScComplexRefData...
Definition: interpr4.cxx:1041
bool IsInForceArray() const
void ScMedian()
Definition: interpr3.cxx:3403
void ScArcCos()
Definition: interpr1.cxx:1865
void ScMatValue()
Definition: interpr5.cxx:629
void ScAmpersand()
Definition: interpr5.cxx:1407
void ScSlope()
Definition: interpr3.cxx:4721
void ScArcTan()
Definition: interpr1.cxx:1870
void ScDBGet()
Definition: interpr4.cxx:2474
static ScCalcConfig & GetOrCreateGlobalConfig()
Definition: interpr4.cxx:3855
void ScIsFormula()
Definition: interpr1.cxx:2691
static void QuickSort(::std::vector< double > &rSortArray,::std::vector< tools::Long > *pIndexOrder)
Definition: interpr3.cxx:4192
double GetDoubleFromMatrix(const ScMatrixRef &pMat)
Definition: interpr4.cxx:2024
formula::FormulaToken * CreateFormulaDoubleToken(double fVal, SvNumFormatType nFmt=SvNumFormatType::NUMBER)
Definition: interpr4.cxx:1734
bool MustHaveParamCountMin(short nAct, short nMin)
Definition: interpre.hxx:1083
SvNumFormatType GetRetFormatType() const
Definition: interpre.hxx:1031
void PushMatrix(const sc::RangeMatrix &rMat)
Definition: interpr4.cxx:1870
void ScTDist_T(int nTails)
Definition: interpr3.cxx:1658
ScTokenArray * pArr
Definition: interpre.hxx:197
void ScErrorType_ODF()
Definition: interpr1.cxx:9862
void ScIfJump()
Definition: interpr1.cxx:84
static FormulaError GetCellErrCode(const ScRefCellValue &rCell)
Definition: interpr4.cxx:155
VolatileType meVolatileType
Definition: interpre.hxx:226
void PushExternalSingleRef(sal_uInt16 nFileId, const OUString &rTabName, SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: interpr4.cxx:1825
void ScConfidence()
Definition: interpr3.cxx:2425
void QueryMatrixType(const ScMatrixRef &xMat, SvNumFormatType &rRetTypeExpr, sal_uInt32 &rRetIndexExpr)
Definition: interpr4.cxx:1682
SvNumFormatType
void GetCellString(svl::SharedString &rStr, ScRefCellValue &rCell)
Definition: interpr4.cxx:242
void ScCotHyp()
Definition: interpr1.cxx:1895
void ScCountIfs()
Definition: interpr1.cxx:6527
void ScGetYear()
Definition: interpr2.cxx:118
void ScAverageIfs()
Definition: interpr1.cxx:6510
sal_uInt8 cPar
Definition: interpre.hxx:222
void ScAreas()
Definition: interpr1.cxx:8754
FormulaError nGlobalError
Definition: interpre.hxx:211
void ScFTest()
Definition: interpr3.cxx:2732
void ScGetTime()
Definition: interpr2.cxx:654
bool CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8 *pCellArr)
Definition: interpr4.cxx:359
svl::SharedString GetStringFromMatrix(const ScMatrixRef &pMat)
Definition: interpr4.cxx:2381
double GetUpRegIGamma(double fA, double fX)
You must ensure fA>0.0 && fX>0.0)
Definition: interpr6.cxx:130
static bool HasForceArray(OpCode eOp)
Whether OpCode has a parameter of type ForceArray or ReferenceOrForceArray.
Definition: parclass.hxx:64
void ScDBStdDev()
Definition: interpr1.cxx:8025
bool JumpMatrix(short nStackLevel)
Definition: interpr1.cxx:536
static double taylor(const double *pPolynom, sal_uInt16 nMax, double x)
Definition: interpr3.cxx:202
void ScIsLogical()
Definition: interpr1.cxx:2098
void ScChiDist(bool bODFF)
Definition: interpr3.cxx:1743
double GetDateSerial(sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bStrict)
Obtain the date serial number for a given date.
Definition: interpr2.cxx:58
void PopRefListPushMatrixOrRef()
Definition: interpr4.cxx:1352
formula::StackVar GetResultType() const
Definition: interpre.hxx:1027
void ScNotEqual()
Definition: interpr1.cxx:1180
void ScRoundDown()
Definition: interpr2.cxx:1007
void ScCumPrinc()
Definition: interpr2.cxx:2302
void ScCosecantHyp()
Definition: interpr1.cxx:1942
sal_uInt32 nFuncFmtIndex
Definition: interpre.hxx:214
void ScSheets()
Definition: interpr1.cxx:4327
formula::StackVar GetStackType()
Stack type with replacement of defaults, e.g. svMissing and formula::svEmptyCell will result in formu...
Definition: interpr4.cxx:1946
bool CheckMatrix(bool _bLOG, sal_uInt8 &nCase, SCSIZE &nCX, SCSIZE &nCY, SCSIZE &nRX, SCSIZE &nRY, SCSIZE &M, SCSIZE &N, ScMatrixRef &pMatX, ScMatrixRef &pMatY)
Definition: interpr5.cxx:2291
void ScDBStdDevP()
Definition: interpr1.cxx:8032
void ReplaceCell(ScAddress &)
Definition: interpr4.cxx:85
void ScConfidenceT()
Definition: interpr3.cxx:2439
static thread_local std::unique_ptr< ScTokenStack > pGlobalStack
Definition: interpre.hxx:191
void ScFloor(bool bODFF)
tdf69552 ODFF1.2 function FLOOR and Excel function FLOOR.MATH In essence, the difference between the ...
Definition: interpr2.cxx:1147
double GetValueCellValue(const ScAddress &, double fOrig)
Only ValueCell, formula cells already store the result rounded.
Definition: interpr4.cxx:145
void ScMissing()
Definition: interpr4.cxx:3090
void ScDBVarP()
Definition: interpr1.cxx:8046
FormulaError
sal_uInt8 GetByte() const
Definition: interpre.hxx:426
void ScGetSec()
Definition: interpr2.cxx:147
bool SetSbxVariable(SbxVariable *pVar, const ScAddress &)
static const ScCalcConfig & GetGlobalConfig()
Definition: interpr4.cxx:3867
void ScCosHyp()
Definition: interpr1.cxx:1885
void ScIndex()
Definition: interpr1.cxx:8536
void ValidateRef(const ScSingleRefData &rRef)
Definition: interpr4.cxx:835
void CalculateTrendGrowth(bool _bGrowth)
Definition: interpr5.cxx:2932
Reference< XOutputStream > stream
svl::SharedStringPool & mrStrPool
Definition: interpre.hxx:201
bool bCalcAsShown
Definition: interpre.hxx:223
double GetBinomDistPMF(double x, double n, double p)
Definition: interpr3.cxx:1229
double GetGammaContFraction(double fA, double fX)
You must ensure fA>0.0 && fX>0.0 valid results only if fX > fA+1.0 uses continued fraction with odd i...
Definition: interpr6.cxx:44
void Init(ScFormulaCell *pCell, const ScAddress &rPos, ScTokenArray &rTokArray)
Definition: interpr4.cxx:3831
ScDBRangeBase * PopDBDoubleRef()
Definition: interpr4.cxx:959
FormulaError GetWeekendAndHolidayMasks(const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,::std::vector< double > &rSortArray, bool bWeekendMask[7])
Definition: interpr2.cxx:346
void IterateParameters(ScIterFunc, bool bTextAsZero=false)
Definition: interpr6.cxx:511
Configuration options for formula interpreter.
Definition: calcconfig.hxx:44
void ScTanHyp()
Definition: interpr1.cxx:1890
void CalculateSkewOrSkewp(bool bSkewp)
Definition: interpr3.cxx:3329
void ScUpper()
Definition: interpr1.cxx:3154
void ScSmall()
Definition: interpr3.cxx:3728
void ScMatRef()
Definition: interpr5.cxx:3230
sal_uInt16 maxsp
Definition: interpre.hxx:213
void PushIllegalArgument()
Definition: interpr4.cxx:1911
void ScEncodeURL()
Returns a string in which all non-alphanumeric characters except stroke and underscore (-_) have been...
Definition: interpr7.cxx:413
sal_uInt32 GetUInt32()
if GetDouble() not within uint32 limits sets nGlobalError and returns SAL_MAX_UINT32 ...
Definition: interpr4.cxx:2226
void ScReplace()
Definition: interpr1.cxx:8847
::formula::FormulaTokenRef TokenRef
void ScGetDate()
Definition: interpr2.cxx:635
void ScWeeknumOOo()
Definition: interpr2.cxx:233
void ScCumIpmt()
Definition: interpr2.cxx:2260
sal_Int32 SCROW
Definition: types.hxx:18
void ScLower()
Definition: interpr1.cxx:3184
void ScIsNonString()
Definition: interpr1.cxx:2093
void ScModalValue()
Definition: interpr3.cxx:3513
void ScISPMT()
Definition: interpr2.cxx:1593
void ScBitRshift()
Definition: interpr1.cxx:1708
void PushWithoutError(const formula::FormulaToken &r)
Does not substitute with formula::FormulaErrorToken in case nGlobalError is set.
Definition: interpr4.cxx:578
void ScMinIfs_MS()
Definition: interpr1.cxx:6544
static double GetLogBeta(double fAlpha, double fBeta)
Definition: interpr3.cxx:830
void ScArcCot()
Definition: interpr1.cxx:1875
static bool RateIteration(double fNper, double fPayment, double fPv, double fFv, bool bPayType, double &fGuess)
Definition: interpr2.cxx:2026
void ScStyle()
Definition: interpr2.cxx:2654
void ScAggregate()
Definition: interpr1.cxx:7563
void ScStDevP(bool bTextAsZero=false)
Definition: interpr1.cxx:4184
void ScLarge()
Definition: interpr3.cxx:3723
static sal_Int16 GetDayOfWeek(sal_Int32 n)
Definition: interpre.hxx:1162
static double BinomKoeff(double n, double k)
Definition: interpr3.cxx:457
void ScPlusMinus()
Definition: interpr2.cxx:946
static double ScGetDDB(double fCost, double fSalvage, double fLife, double fPeriod, double fFactor)
Definition: interpr2.cxx:1662
double GetChiSqDistCDF(double fX, double fDF)
You must ensure fDF>0.0.
Definition: interpr3.cxx:678
void ScBetaDist()
Definition: interpr3.cxx:1033
void ScSumX2DY2()
Definition: interpr5.cxx:1841
void ScDBMax()
Definition: interpr1.cxx:7968
static utl::SearchParam::SearchType DetectSearchType(const OUString &rStr, const ScDocument &rDoc)
Detect if string should be used as regular expression or wildcard expression or literal string...
Definition: interpr1.cxx:9958
void ScArabic()
Definition: interpr2.cxx:3127
unsigned char sal_uInt8
void ScForecast_Ets(ScETSType eETSType)
Definition: interpr8.cxx:1171
void ScRandom()
Definition: interpr1.cxx:1787
bool CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8 *pCellArr)
Definition: interpr4.cxx:277
void ScMatInv()
Definition: interpr5.cxx:966
bool bMatrixFormula
Definition: interpre.hxx:224
void PopDoubleRefPushMatrix()
Definition: interpr4.cxx:1338
FormulaError GetErrorType()
Definition: interpr1.cxx:9776
void ScIsError()
Definition: interpr1.cxx:2958
static bool MayBeRegExp(const OUString &rStr)
Could string be a regular expression? if regularExpressions are disabled the function returns false r...
Definition: interpr1.cxx:9918
ScDocument & mrDoc
Definition: interpre.hxx:199
void ScTrend()
Definition: interpr5.cxx:2922
void CalculateLookup(bool bHLookup)
Definition: interpr1.cxx:7199
void ScCurrency()
Definition: interpr1.cxx:8790
void ScLeftB()
Definition: interpr1.cxx:9148
std::shared_ptr< ScTokenArray > TokenArrayRef
void ScCurrent()
Definition: interpr2.cxx:2642
void GetStVarParams(bool bTextAsZero, double(*VarResult)(double fVal, size_t nValCount))
Definition: interpr1.cxx:3930
static double ScInterVDB(double fCost, double fSalvage, double fLife, double fLife1, double fPeriod, double fFactor)
Definition: interpr2.cxx:1756
ScJumpMatrix * pJumpMatrix
Definition: interpre.hxx:203
void ScNegBinomDist()
Definition: interpr3.cxx:1502
void ScLogNormDist(int nMinParamCount)
Definition: interpr3.cxx:1568
double GetTInv(double fAlpha, double fSize, int nType)
Definition: interpr3.cxx:2290
void ScDBSum()
Definition: interpr1.cxx:7870
ScAddress aPos
Definition: interpre.hxx:196
ScMatValType
Definition: types.hxx:32
void ScWorkday_MS()
Definition: interpr2.cxx:563
ScMatrixRef MatConcat(const ScMatrixRef &pMat1, const ScMatrixRef &pMat2)
Definition: interpr5.cxx:1230
void ScBetaDist_MS()
Microsoft version has parameters in different order Also, upper and lowerbound are optional and have ...
Definition: interpr3.cxx:1097
void SingleRefToVars(const ScSingleRefData &rRef, SCCOL &rCol, SCROW &rRow, SCTAB &rTab)
Definition: interpr4.cxx:857
svl::SharedString GetStringFromDouble(const double fVal)
Definition: interpr4.cxx:2464
void ScCosecant()
Definition: interpr1.cxx:1932
void ScNormDist(int nMinParamCount)
Definition: interpr3.cxx:1548
void ScSubTotal()
Definition: interpr1.cxx:7516
void RoundNumber(rtl_math_RoundingMode eMode)
Definition: interpr2.cxx:967
void ScBahtText()
Definition: interpr2.cxx:3485
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:400
svl::SharedString GetString()
Definition: interpr4.cxx:2302
These need to be in global namespace just like their respective types are.
double GetNumResult() const
Definition: interpre.hxx:1029
void ScVLookup()
Definition: interpr1.cxx:7511
double GetGammaSeries(double fA, double fX)
You must ensure fA>0.0 && fX>0.0 valid results only if fX <= fA+1.0 uses power series.
Definition: interpr6.cxx:96
void PushNoValue()
Definition: interpr4.cxx:1921
void ScNominal()
Definition: interpr2.cxx:2364
void ScPower()
Definition: interpr5.cxx:1658
bool MatrixParameterConversion()
Definition: interpre.hxx:1046
void ScSumX2MY2()
Definition: interpr5.cxx:1797
void ScGetPivotData()
Definition: interpr2.cxx:3552
void ScPermutationA()
Definition: interpr3.cxx:1216
ScQueryOp
Definition: global.hxx:818
void ScSTEYX()
Definition: interpr3.cxx:4645
void PopExternalSingleRef(sal_uInt16 &rFileId, OUString &rTabName, ScSingleRefData &rRef)
Definition: interpr4.cxx:1115
void ScSumXMY2()
Definition: interpr5.cxx:1846
void MergeCalcConfig()
Merge global and document specific settings.
Definition: interpr4.cxx:3872
void ScSecant()
Definition: interpr1.cxx:1937
Complex reference (a range) into the sheet.
Definition: refdata.hxx:123
void ScRoundUp()
Definition: interpr2.cxx:1012
void ScChiInv()
Definition: interpr3.cxx:2370
bool CalculateTest(bool _bTemplin, const SCSIZE nC1, const SCSIZE nC2, const SCSIZE nR1, const SCSIZE nR2, const ScMatrixRef &pMat1, const ScMatrixRef &pMat2, double &fT, double &fF)
Definition: interpr3.cxx:2582
double GetHypGeomDist(double x, double n, double M, double N)
Calculates a value of the hypergeometric distribution.
Definition: interpr3.cxx:1897
void ScCovarianceS()
Definition: interpr3.cxx:4525
void DBIterator(ScIterFunc)
Definition: interpr1.cxx:7797
void ScMatch()
Definition: interpr1.cxx:4769
void ScRegex()
Definition: interpr1.cxx:9373
void GetDBStVarParams(double &rVal, double &rValCount)
Definition: interpr1.cxx:7983
void ScAverageIf()
Definition: interpr1.cxx:5626
void PopError()
Definition: interpr4.cxx:748
void ScWeibull()
Definition: interpr3.cxx:1765
ScTokenStack * pStackObj
Definition: interpre.hxx:209
static bool MayBeWildcard(const OUString &rStr)
Could string be a wildcard (*,?,~) expression? If wildcards are disabled the function returns false r...
Definition: interpr1.cxx:9938
sc::RangeMatrix GetRangeMatrix()
Definition: interpr5.cxx:615
void ScBitXor()
Definition: interpr1.cxx:1670
void ScBitOr()
Definition: interpr1.cxx:1655
void ScTDist()
Definition: interpr3.cxx:1643
void ScFInv_LT()
Definition: interpr3.cxx:2335
void ScMin(bool bTextAsZero=false)
Definition: interpr1.cxx:3614
void ScGetMonth()
Definition: interpr2.cxx:125
void ScProbability()
Definition: interpr3.cxx:4449
void PopExternalDoubleRef(sal_uInt16 &rFileId, OUString &rTabName, ScComplexRefData &rRef)
Definition: interpr4.cxx:1194
void ScPercentrank(bool bInclusive)
Definition: interpr3.cxx:3733
void ScIsErr()
Definition: interpr1.cxx:2895
formula::FormulaToken * CreateDoubleOrTypedToken(double fVal)
Definition: interpr4.cxx:1759
void ScClean()
Definition: interpr1.cxx:3450
void ScGetDayOfWeek()
Definition: interpr2.cxx:186
bool CheckStringResultLen(OUString &rResult, const OUString &rAdd)
Definition: interpre.hxx:1122
void ScExternal()
Definition: interpr4.cxx:2509
const formula::FormulaConstTokenRef & GetResultToken() const
Definition: interpre.hxx:1030
void ScExact()
Definition: interpr1.cxx:8974
void ScFDist()
Definition: interpr3.cxx:1691
void ScForecast()
Definition: interpr3.cxx:4731
void ScMultiArea()
Definition: interpr1.cxx:8741
void ScSearch()
Definition: interpr1.cxx:9327
void ScArcSin()
Definition: interpr1.cxx:1860
void ScGrowth()
Definition: interpr5.cxx:2927
void TreatDoubleError(double &rVal)
Definition: interpre.hxx:1144
const formula::FormulaToken * pPointer[MAXSTACK]
Definition: interpre.hxx:101
void PushTokenRef(const formula::FormulaConstTokenRef &)
Pushes the token or substitutes with formula::FormulaErrorToken in case nGlobalError is set and the t...
Definition: interpr4.cxx:661
static void MEMat(const ScMatrixRef &mM, SCSIZE n)
Definition: interpr5.cxx:753
::std::vector< ScComplexRefData > ScRefList
Definition: token.hxx:38
double Compare(ScQueryOp eOp)
Definition: interpr1.cxx:882
void ScCombin()
Definition: interpr3.cxx:1170
void ScArcTanHyp()
Definition: interpr1.cxx:1914
static double ScGetPV(double fRate, double fNper, double fPmt, double fFv, bool bPayInAdvance)
Definition: interpr2.cxx:1610
void PushStringBuffer(const sal_Unicode *pString)
Definition: interpr4.cxx:1782
double GetBetaDistPDF(double fX, double fA, double fB)
Definition: interpr3.cxx:859
void ScSubstitute()
Definition: interpr1.cxx:9685
void ScQuartile(bool bInclusive)
Definition: interpr3.cxx:3490
void IterateParametersIfs(double(*ResultFunc)(const sc::ParamIfsResult &rRes))
Definition: interpr1.cxx:5828
void ScValue()
Definition: interpr1.cxx:3270
void ScProduct()
Definition: interpr6.cxx:1048
void ScIsValue()
Definition: interpr1.cxx:2620
double GetGammaDistPDF(double fX, double fAlpha, double fLambda)
Gamma distribution, probability density function.
Definition: interpr6.cxx:144
void ScArcCosHyp()
Definition: interpr1.cxx:1905
void ScZTest()
Definition: interpr3.cxx:2455
void ScCombinA()
Definition: interpr3.cxx:1183
void ScCountIf()
Definition: interpr1.cxx:5631
void SetError(FormulaError nError)
Definition: interpre.hxx:1019
double GetMedian(::std::vector< double > &rArray)
Definition: interpr3.cxx:3379
bool GetBool()
Definition: interpre.hxx:444
static bool CheckStringPositionArgument(double &fVal)
Check if a double is suitable as string position or length argument.
Definition: interpre.hxx:1091
Each instance of this struct represents a single filtering criteria.
Definition: queryentry.hxx:33
VolatileType GetVolatileType() const
Definition: interpre.hxx:185
void ScTableOp()
Definition: interpr4.cxx:3562
void ScFixed()
Definition: interpr1.cxx:8885
void DoubleRefToVars(const formula::FormulaToken *p, SCCOL &rCol1, SCROW &rRow1, SCTAB &rTab1, SCCOL &rCol2, SCROW &rRow2, SCTAB &rTab2)
Definition: interpr4.cxx:938
void ScStDev(bool bTextAsZero=false)
Definition: interpr1.cxx:4172
double div(const double &fNumerator, const double &fDenominator)
Return fNumerator/fDenominator if fDenominator!=0 else #DIV/0! error coded into double.
Definition: math.hxx:31
static double GetPercentrank(::std::vector< double > &rArray, double fVal, bool bInclusive)
Definition: interpr3.cxx:3771
static double ScGetGCD(double fx, double fy)
Definition: interpr5.cxx:108
void ScHyperLink()
Definition: interpr2.cxx:3184
bool GetDoubleOrString(double &rValue, svl::SharedString &rString)
returns TRUE if double (or error, check nGlobalError), else FALSE
Definition: interpr4.cxx:2242
sal_Int16 SCTAB
Definition: types.hxx:23
void ScTTest()
Definition: interpr3.cxx:2649
void ScHarMean()
Definition: interpr3.cxx:2915
void ScIfError(bool bNAonly)
Definition: interpr1.cxx:240
void ScPercentSign()
Definition: interpr1.cxx:1596
void ScSNormInv()
Definition: interpr3.cxx:2134
void ScColor()
Definition: interpr7.cxx:516
void ScMatMult()
Definition: interpr5.cxx:1078
bool IsInArrayContext() const
Definition: interpre.hxx:1035
void ScDBProduct()
Definition: interpr1.cxx:7978
double GetBetaDist(double x, double alpha, double beta)
Definition: interpr3.cxx:982
void ScAveDev()
Definition: interpr3.cxx:4282
#define MAXSTACK
Definition: interpre.hxx:96
static double integralPhi(double x)
Definition: interpr3.cxx:197
bool operator()(const formula::FormulaConstTokenRef &r1, const formula::FormulaConstTokenRef &r2) const
Definition: interpre.hxx:134
sal_uInt32 nCurFmtIndex
Definition: interpre.hxx:215
void ScGamma()
Definition: interpr3.cxx:771
void ScCovarianceP()
Definition: interpr3.cxx:4520