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 <scdllapi.h>
29 #include <types.hxx>
30 #include <externalrefmgr.hxx>
31 #include <calcconfig.hxx>
32 #include <token.hxx>
33 #include <math.hxx>
34 #include "parclass.hxx"
35 
36 #include <map>
37 #include <memory>
38 #include <vector>
39 #include <limits>
40 #include <ostream>
41 
42 namespace sfx2 { class LinkManager; }
43 
44 class ScDocument;
45 class SbxVariable;
46 class ScFormulaCell;
47 class ScDBRangeBase;
48 struct ScQueryParam;
49 struct ScDBQueryParamBase;
50 struct ScQueryEntry;
51 
52 struct ScSingleRefData;
53 struct ScComplexRefData;
55 
56 class ScJumpMatrix;
57 struct ScRefCellValue;
58 
59 namespace sc {
60 
61 struct CompareOptions;
62 
64 {
65  double mfSum = 0.0;
66  double mfMem = 0.0;
67  double mfCount = 0.0;
68  double mfMin = std::numeric_limits<double>::max();
69  double mfMax = std::numeric_limits<double>::lowest();
70 };
71 
72 template<typename charT, typename traits>
73 inline std::basic_ostream<charT, traits> & operator <<(std::basic_ostream<charT, traits> & stream, const ParamIfsResult& rRes)
74 {
75  stream << "{" <<
76  "sum=" << rRes.mfSum << "," <<
77  "mem=" << rRes.mfMem << "," <<
78  "count=" << rRes.mfCount << "," <<
79  "min=" << rRes.mfMin << "," <<
80  "max=" << rRes.mfMax << "," <<
81  "}";
82 
83  return stream;
84 }
85 
86 }
87 
88 namespace svl {
89 
90 class SharedStringPool;
91 
92 }
93 
95 constexpr sal_Int32 kScInterpreterMaxStrLen = SAL_MAX_INT32 / 8;
96 
97 #define MAXSTACK (4096 / sizeof(formula::FormulaToken*))
98 
100 {
101 public:
103 };
104 
106  ifSUM, // Add up
107  ifSUMSQ, // Sums of squares
108  ifPRODUCT, // Product
109  ifAVERAGE, // Average
110  ifCOUNT, // Count Values
111  ifCOUNT2, // Count Values (not empty)
112  ifMIN, // Minimum
113  ifMAX // Maximum
114 };
115 
117 {
118  ifSUMIF, // Conditional sum
119  ifAVERAGEIF // Conditional average
120 };
121 
123 {
131 };
132 
134 {
136  { return r1.get() < r2.get(); }
137 };
138 typedef ::std::map< const formula::FormulaConstTokenRef, formula::FormulaConstTokenRef, FormulaTokenRef_less> ScTokenMatrixMap;
139 
141 {
142  // distribution function objects need the GetxxxDist methods
143  friend class ScGammaDistFunction;
144  friend class ScBetaDistFunction;
145  friend class ScTDistFunction;
146  friend class ScFDistFunction;
147  friend class ScChiDistFunction;
148  friend class ScChiSqDistFunction;
149 
150 public:
151  static void SetGlobalConfig(const ScCalcConfig& rConfig);
152  static const ScCalcConfig& GetGlobalConfig();
153 
154  static void GlobalExit(); // called by ScGlobal::Clear()
155 
159  static bool MayBeRegExp( const OUString& rStr, bool bIgnoreWildcards = false );
160 
165  static bool MayBeWildcard( const OUString& rStr );
166 
170  static utl::SearchParam::SearchType DetectSearchType( const OUString& rStr, const ScDocument* pDoc );
171 
174  static inline double div( const double& fNumerator, const double& fDenominator );
175 
176  ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR, bool bEmpty = false);
177 
178  ScMatrixRef GetNewMat(SCSIZE nC, SCSIZE nR, const std::vector<double>& rValues);
179 
184  };
185 
187 
188 private:
191 
192  static thread_local std::unique_ptr<ScTokenStack> pGlobalStack;
193  static thread_local bool bGlobalStackInUse;
194 
204  ScJumpMatrix* pJumpMatrix; // currently active array condition, if any
205  std::unique_ptr<ScTokenMatrixMap> pTokenMatrixMap; // map FormulaToken* to formula::FormulaTokenRef if in array condition
206  ScFormulaCell* pMyFormulaCell; // the cell of this formula expression
208 
209  const formula::FormulaToken* pCur; // current token
210  ScTokenStack* pStackObj; // contains the stacks
211  const formula::FormulaToken ** pStack; // the current stack
212  FormulaError nGlobalError; // global (local to this formula expression) error
213  sal_uInt16 sp; // stack pointer
214  sal_uInt16 maxsp; // the maximal used stack pointer
215  sal_uInt32 nFuncFmtIndex; // NumberFormatIndex of a function
216  sal_uInt32 nCurFmtIndex; // current NumberFormatIndex
217  sal_uInt32 nRetFmtIndex; // NumberFormatIndex of an expression, if any
218  SvNumFormatType nFuncFmtType; // NumberFormatType of a function
219  SvNumFormatType nCurFmtType; // current NumberFormatType
220  SvNumFormatType nRetFmtType; // NumberFormatType of an expression
221  FormulaError mnStringNoValueError; // the error set in ConvertStringToValue() if no value
222  SubtotalFlags mnSubTotalFlags; // flags for subtotal and aggregate functions
223  sal_uInt8 cPar; // current count of parameters
224  bool bCalcAsShown; // precision as shown
225  bool bMatrixFormula; // formula cell is a matrix formula
226 
228 
229  void MakeMatNew(ScMatrixRef& rMat, SCSIZE nC, SCSIZE nR);
230 
232  void MergeCalcConfig();
233 
234  // nMust <= nAct <= nMax ? ok : PushError
235  inline bool MustHaveParamCount( short nAct, short nMust );
236  inline bool MustHaveParamCount( short nAct, short nMust, short nMax );
237  inline bool MustHaveParamCountMin( short nAct, short nMin );
238  void PushParameterExpected();
239  void PushIllegalParameter();
240  void PushIllegalArgument();
241  void PushNoValue();
242  void PushNA();
243 
244  // Functions for accessing a document
245 
246  void ReplaceCell( ScAddress& ); // for TableOp
247  bool IsTableOpInRange( const ScRange& );
248  sal_uInt32 GetCellNumberFormat( const ScAddress& rPos, ScRefCellValue& rCell );
249  double ConvertStringToValue( const OUString& );
250 public:
251  static double ScGetGCD(double fx, double fy);
254  double ConvertStringToValue( const OUString&, FormulaError& rError, SvNumFormatType& rCurFmtType );
255 private:
256  double GetCellValue( const ScAddress&, ScRefCellValue& rCell );
257  double GetCellValueOrZero( const ScAddress&, ScRefCellValue& rCell );
258  double GetValueCellValue( const ScAddress&, double fOrig );
259  void GetCellString( svl::SharedString& rStr, ScRefCellValue& rCell );
260  static FormulaError GetCellErrCode( const ScRefCellValue& rCell );
261 
262  bool CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
263  SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
264  bool CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
265  SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
266  bool CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
267  SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8* pCellArr);
268 
269  // Stack operations
270 
274  void Push( const formula::FormulaToken& r );
275 
279  void PushWithoutError( const formula::FormulaToken& r );
280 
288 
293 
301 
307  {
308  if (nGlobalError != FormulaError::NONE)
309  {
311  return true;
312  }
313  return false;
314  }
315 
331  void PushCellResultToken( bool bDisplayEmptyAsString, const ScAddress & rAddress,
332  SvNumFormatType * pRetTypeExpr, sal_uInt32 * pRetIndexExpr, bool bFinalResult = false );
333 
335  void Pop();
336  void PopError();
337  double PopDouble();
339  void ValidateRef( const ScSingleRefData & rRef );
340  void ValidateRef( const ScComplexRefData & rRef );
341  void ValidateRef( const ScRefList & rRefList );
342  void SingleRefToVars( const ScSingleRefData & rRef, SCCOL & rCol, SCROW & rRow, SCTAB & rTab );
343  void PopSingleRef( ScAddress& );
344  void PopSingleRef(SCCOL& rCol, SCROW &rRow, SCTAB& rTab);
345  void DoubleRefToRange( const ScComplexRefData&, ScRange&, bool bDontCheckForTableOp = false );
354  void PopDoubleRef( ScRange & rRange, short & rParam, size_t & rRefInList );
355  void PopDoubleRef( ScRange&, bool bDontCheckForTableOp = false );
356  void DoubleRefToVars( const formula::FormulaToken* p,
357  SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1,
358  SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2 );
360  void PopDoubleRef(SCCOL& rCol1, SCROW &rRow1, SCTAB& rTab1,
361  SCCOL& rCol2, SCROW &rRow2, SCTAB& rTab2 );
362 
363  void PopExternalSingleRef(sal_uInt16& rFileId, OUString& rTabName, ScSingleRefData& rRef);
364 
367 
369  void PopExternalSingleRef(sal_uInt16& rFileId, OUString& rTabName, ScSingleRefData& rRef,
371 
372  void PopExternalDoubleRef(sal_uInt16& rFileId, OUString& rTabName, ScComplexRefData& rRef);
374  void PopExternalDoubleRef(ScMatrixRef& rMat);
375  void GetExternalDoubleRef(sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& aData, ScExternalRefCache::TokenArrayRef& rArray);
376  bool PopDoubleRefOrSingleRef( ScAddress& rAdr );
377  void PopDoubleRefPushMatrix();
379  // If MatrixFormula: convert svDoubleRef to svMatrix, create JumpMatrix.
380  // Else convert area reference parameters marked as ForceArray to array.
381  // Returns true if JumpMatrix created.
383  // If MatrixFormula: ConvertMatrixJumpConditionToMatrix()
384  inline void MatrixJumpConditionToMatrix();
385  // For MatrixFormula (preconditions already checked by
386  // MatrixJumpConditionToMatrix()): convert svDoubleRef to svMatrix, or if
387  // JumpMatrix currently in effect convert also other types to svMatrix so
388  // another JumpMatrix will be created by jump commands.
390  // If MatrixFormula or ForceArray: ConvertMatrixParameters()
391  inline bool MatrixParameterConversion();
392  // If MatrixFormula or ForceArray. Can be used within spreadsheet functions
393  // that do not depend on the formula cell's matrix size, for which only
394  // bMatrixFormula can be used.
395  inline bool IsInArrayContext() const;
398  void QueryMatrixType(const ScMatrixRef& xMat, SvNumFormatType& rRetTypeExpr, sal_uInt32& rRetIndexExpr);
399 
400  formula::FormulaToken* CreateFormulaDoubleToken( double fVal, SvNumFormatType nFmt = SvNumFormatType::NUMBER );
402 
403  void PushDouble(double nVal);
404  void PushInt( int nVal );
405  void PushStringBuffer( const sal_Unicode* pString );
406  void PushString( const OUString& rStr );
407  void PushString( const svl::SharedString& rString );
408  void PushSingleRef(SCCOL nCol, SCROW nRow, SCTAB nTab);
409  void PushDoubleRef(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
410  SCCOL nCol2, SCROW nRow2, SCTAB nTab2);
411  void PushExternalSingleRef(sal_uInt16 nFileId, const OUString& rTabName,
412  SCCOL nCol, SCROW nRow, SCTAB nTab);
413  void PushExternalDoubleRef(sal_uInt16 nFileId, const OUString& rTabName,
414  SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
415  SCCOL nCol2, SCROW nRow2, SCTAB nTab2);
416  void PushSingleRef( const ScRefAddress& rRef );
417  void PushDoubleRef( const ScRefAddress& rRef1, const ScRefAddress& rRef2 );
418  void PushMatrix( const sc::RangeMatrix& rMat );
419  void PushMatrix(const ScMatrixRef& pMat);
420  void PushError( FormulaError nError );
425  // peek StackType of Parameter, Parameter 1 == TOS, 2 == TOS-1, ...
427  sal_uInt8 GetByte() const { return cPar; }
428  // reverse order of stack
430  // generates a position-dependent SingleRef out of a DoubleRef
431  bool DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr );
432  double GetDoubleFromMatrix(const ScMatrixRef& pMat);
433  double GetDouble();
434  double GetDoubleWithDefault(double nDefault);
435  bool IsMissing() const;
436  sal_Int32 double_to_int32(double fVal);
438  sal_Int32 GetInt32();
440  sal_Int32 GetInt32WithDefault( sal_Int32 nDefault );
442  sal_Int16 GetInt16();
444  sal_uInt32 GetUInt32();
445  bool GetBool() { return GetDouble() != 0.0; }
447  bool GetDoubleOrString( double& rValue, svl::SharedString& rString );
450  svl::SharedString GetStringFromDouble( const double fVal);
451  // pop matrix and obtain one element, upper left or according to jump matrix
452  ScMatValType GetDoubleOrStringFromMatrix( double& rDouble, svl::SharedString& rString );
454  SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
455  SCCOL nCol2, SCROW nRow2, SCTAB nTab2 );
457  static std::unique_ptr<ScTokenMatrixMap> CreateTokenMatrixMap();
459  ScMatrixRef GetMatrix( short & rParam, size_t & rInRefList );
461 
462  void ScTableOp(); // repeated operations
463 
464  // common helper functions
465 
467  { nFuncFmtType = nCurFmtType; nFuncFmtIndex = nCurFmtIndex; }
468 
479  static inline bool CheckStringPositionArgument( double & fVal );
480 
485  inline sal_Int32 GetStringPositionArgument();
486 
487  // Check for String overflow of rResult+rAdd and set error and erase rResult
488  // if so. Return true if ok, false if overflow
489  inline bool CheckStringResultLen( OUString& rResult, const OUString& rAdd );
490 
491  // Check for String overflow of rResult+rAdd and set error and erase rResult
492  // if so. Return true if ok, false if overflow
493  inline bool CheckStringResultLen( OUStringBuffer& rResult, const OUString& rAdd );
494 
495  // Set error according to rVal, and set rVal to 0.0 if there was an error.
496  inline void TreatDoubleError( double& rVal );
497  // Lookup using ScLookupCache, @returns true if found and result address
498  bool LookupQueryWithCache( ScAddress & o_rResultPos,
499  const ScQueryParam & rParam ) const;
500 
501  void ScIfJump();
502  void ScIfError( bool bNAonly );
503  void ScChooseJump();
504 
505  // Be sure to only call this if pStack[sp-nStackLevel] really contains a
506  // ScJumpMatrixToken, no further checks are applied!
507  // Returns true if last jump was executed and result matrix pushed.
508  bool JumpMatrix( short nStackLevel );
509 
510  double Compare( ScQueryOp eOp );
514  sc::RangeMatrix CompareMat( ScQueryOp eOp, sc::CompareOptions* pOptions = nullptr );
515  ScMatrixRef QueryMat( const ScMatrixRef& pMat, sc::CompareOptions& rOptions );
516  void ScEqual();
517  void ScNotEqual();
518  void ScLess();
519  void ScGreater();
520  void ScLessEqual();
521  void ScGreaterEqual();
522  void ScAnd();
523  void ScOr();
524  void ScXor();
525  void ScNot();
526  void ScNeg();
527  void ScPercentSign();
528  void ScIntersect();
529  void ScRangeFunc();
530  void ScUnionFunc();
531  void ScPi();
532  void ScRandom();
533  void ScRandbetween();
534  void ScRandomImpl( const std::function<double( double fFirst, double fLast )>& RandomFunc,
535  double fFirst, double fLast );
536  void ScTrue();
537  void ScFalse();
538  void ScDeg();
539  void ScRad();
540  void ScSin();
541  void ScCos();
542  void ScTan();
543  void ScCot();
544  void ScArcSin();
545  void ScArcCos();
546  void ScArcTan();
547  void ScArcCot();
548  void ScSinHyp();
549  void ScCosHyp();
550  void ScTanHyp();
551  void ScCotHyp();
552  void ScArcSinHyp();
553  void ScArcCosHyp();
554  void ScArcTanHyp();
555  void ScArcCotHyp();
556  void ScCosecant();
557  void ScSecant();
558  void ScCosecantHyp();
559  void ScSecantHyp();
560  void ScExp();
561  void ScLn();
562  void ScLog10();
563  void ScSqrt();
564  void ScIsEmpty();
565  bool IsString();
566  void ScIsString();
567  void ScIsNonString();
568  void ScIsLogical();
569  void ScType();
570  void ScCell();
571  void ScCellExternal();
572  void ScIsRef();
573  void ScIsValue();
574  void ScIsFormula();
575  void ScFormula();
576  void ScRoman();
577  void ScArabic();
578  void ScIsNV();
579  void ScIsErr();
580  void ScIsError();
581  bool IsEven();
582  void ScIsEven();
583  void ScIsOdd();
584  void ScN();
585  void ScCode();
586  void ScTrim();
587  void ScUpper();
588  void ScProper();
589  void ScLower();
590  void ScLen();
591  void ScT();
592  void ScValue();
593  void ScNumberValue();
594  void ScClean();
595  void ScChar();
596  void ScJis();
597  void ScAsc();
598  void ScUnicode();
599  void ScUnichar();
600  void ScMin( bool bTextAsZero = false );
601  void ScMax( bool bTextAsZero = false );
604  size_t GetRefListArrayMaxSize( short nParamCount );
607  bool SwitchToArrayRefList( ScMatrixRef& xResMat, SCSIZE nMatRows, double fCurrent,
608  const std::function<void( SCSIZE i, double fCurrent )>& MatOpFunc, bool bDoMatOp );
609  void IterateParameters( ScIterFunc, bool bTextAsZero = false );
610  void ScSumSQ();
611  void ScSum();
612  void ScProduct();
613  void ScAverage( bool bTextAsZero = false );
614  void ScCount();
615  void ScCount2();
616  void GetStVarParams( bool bTextAsZero, double(*VarResult)( double fVal, size_t nValCount ) );
617  void ScVar( bool bTextAsZero = false );
618  void ScVarP( bool bTextAsZero = false );
619  void ScStDev( bool bTextAsZero = false );
620  void ScStDevP( bool bTextAsZero = false );
621  void ScRawSubtract();
622  void ScColumns();
623  void ScRows();
624  void ScSheets();
625  void ScColumn();
626  void ScRow();
627  void ScSheet();
628  void ScMatch();
630  void ScCountIf();
631  void ScSumIf();
632  void ScAverageIf();
633  void IterateParametersIfs( double(*ResultFunc)( const sc::ParamIfsResult& rRes ) );
634  void ScSumIfs();
635  void ScAverageIfs();
636  void ScCountIfs();
637  void ScCountEmptyCells();
638  void ScLookup();
639  void ScHLookup();
640  void ScVLookup();
641  void ScSubTotal();
642 
643  // If upon call rMissingField==true then the database field parameter may be
644  // missing (Xcl DCOUNT() syntax), or may be faked as missing by having the
645  // value 0.0 or being exactly the entire database range reference (old SO
646  // compatibility). If this was the case then rMissingField is set to true upon
647  // return. If rMissingField==false upon call all "missing cases" are considered
648  // to be an error.
649  std::unique_ptr<ScDBQueryParamBase> GetDBParams( bool& rMissingField );
650 
651  void DBIterator( ScIterFunc );
652  void ScDBSum();
653  void ScDBCount();
654  void ScDBCount2();
655  void ScDBAverage();
656  void ScDBGet();
657  void ScDBMax();
658  void ScDBMin();
659  void ScDBProduct();
660  void GetDBStVarParams( double& rVal, double& rValCount );
661  void ScDBStdDev();
662  void ScDBStdDevP();
663  void ScDBVar();
664  void ScDBVarP();
665  void ScIndirect();
666  void ScAddressFunc();
667  void ScOffset();
668  void ScIndex();
669  void ScMultiArea();
670  void ScAreas();
671  void ScCurrency();
672  void ScReplace();
673  void ScFixed();
674  void ScFind();
675  void ScExact();
676  void ScLeft();
677  void ScRight();
678  void ScSearch();
679  void ScMid();
680  void ScText();
681  void ScSubstitute();
682  void ScRept();
683  void ScRegex();
684  void ScConcat();
685  void ScConcat_MS();
686  void ScTextJoin_MS();
687  void ScIfs_MS();
688  void ScSwitch_MS();
689  void ScMinIfs_MS();
690  void ScMaxIfs_MS();
691  void ScExternal();
692  void ScMissing();
693  void ScMacro();
694  bool SetSbxVariable( SbxVariable* pVar, const ScAddress& );
696  void ScErrorType();
697  void ScErrorType_ODF();
698  void ScDBArea();
699  void ScColRowNameAuto();
700  void ScGetPivotData();
701  void ScHyperLink();
702  void ScBahtText();
703  void ScBitAnd();
704  void ScBitOr();
705  void ScBitXor();
706  void ScBitRshift();
707  void ScBitLshift();
708  void ScTTT();
709  void ScDebugVar();
710 
721  double GetDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, bool bStrict );
722 
723  void ScGetActDate();
724  void ScGetActTime();
725  void ScGetYear();
726  void ScGetMonth();
727  void ScGetDay();
728  void ScGetDayOfWeek();
729  void ScGetWeekOfYear();
730  void ScGetIsoWeekOfYear();
731  void ScWeeknumOOo();
732  void ScEasterSunday();
733  FormulaError GetWeekendAndHolidayMasks( const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,
734  ::std::vector<double>& rSortArray, bool bWeekendMask[ 7 ] );
735  FormulaError GetWeekendAndHolidayMasks_MS( const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,
736  ::std::vector<double>& rSortArray, bool bWeekendMask[ 7 ], bool bWorkdayFunction );
737  static inline sal_Int16 GetDayOfWeek( sal_Int32 n );
738  void ScNetWorkdays( bool bOOXML_Version );
739  void ScWorkday_MS();
740  void ScGetHour();
741  void ScGetMin();
742  void ScGetSec();
743  void ScPlusMinus();
744  void ScAbs();
745  void ScInt();
746  void ScEven();
747  void ScOdd();
748  void ScCeil( bool bODFF );
749  void ScCeil_MS();
750  void ScCeil_Precise();
751  void ScFloor( bool bODFF );
752  void ScFloor_MS();
753  void ScFloor_Precise();
754  void RoundNumber( rtl_math_RoundingMode eMode );
755  void ScRound();
756  void ScRoundUp();
757  void ScRoundDown();
758  void ScGetDateValue();
759  void ScGetTimeValue();
760  void ScArcTan2();
761  void ScLog();
762  void ScGetDate();
763  void ScGetTime();
764  void ScGetDiffDate();
765  void ScGetDiffDate360();
766  void ScGetDateDif();
767  void ScPower();
768  void ScAmpersand();
769  void ScAdd();
770  void ScSub();
771  void ScMul();
772  void ScDiv();
773  void ScPow();
774  void ScCurrent();
775  void ScStyle();
776  void ScDde();
777  void ScBase();
778  void ScDecimal();
779  void ScConvertOOo();
780  void ScEuroConvert();
781  void ScRoundSignificant();
782  static void RoundSignificant( double fX, double fDigits, double &fRes );
783 
784  // financial functions
785  void ScNPV();
786  void ScIRR();
787  void ScMIRR();
788  void ScISPMT();
789 
790  static double ScGetPV(double fRate, double fNper, double fPmt,
791  double fFv, bool bPayInAdvance);
792  void ScPV();
793  void ScSYD();
794  static double ScGetDDB(double fCost, double fSalvage, double fLife,
795  double fPeriod, double fFactor);
796  void ScDDB();
797  void ScDB();
798  static double ScInterVDB(double fCost, double fSalvage, double fLife, double fLife1,
799  double fPeriod, double fFactor);
800  void ScVDB();
801  void ScPDuration();
802  void ScSLN();
803  static double ScGetPMT(double fRate, double fNper, double fPv,
804  double fFv, bool bPayInAdvance);
805  void ScPMT();
806  void ScRRI();
807  static double ScGetFV(double fRate, double fNper, double fPmt,
808  double fPv, bool bPayInAdvance);
809  void ScFV();
810  void ScNper();
811  static bool RateIteration(double fNper, double fPayment, double fPv,
812  double fFv, bool bPayType, double& fGuess);
813  void ScRate();
814  double ScGetIpmt(double fRate, double fPer, double fNper, double fPv,
815  double fFv, bool bPayInAdvance, double& fPmt);
816  void ScIpmt();
817  void ScPpmt();
818  void ScCumIpmt();
819  void ScCumPrinc();
820  void ScEffect();
821  void ScNominal();
822  void ScMod();
823  void ScIntercept();
824  void ScGCD();
825  void ScLCM();
826 
827  // matrix functions
828  void ScMatValue();
829  static void MEMat(const ScMatrixRef& mM, SCSIZE n);
830  void ScMatDet();
831  void ScMatInv();
832  void ScMatMult();
833  void ScMatTrans();
834  void ScEMat();
835  void ScMatRef();
836  ScMatrixRef MatConcat(const ScMatrixRef& pMat1, const ScMatrixRef& pMat2);
837  void ScSumProduct();
838  void ScSumX2MY2();
839  void ScSumX2DY2();
840  void ScSumXMY2();
841  void ScGrowth();
842  bool CalculateSkew(double& fSum,double& fCount,double& vSum,std::vector<double>& values);
843  void CalculateSkewOrSkewp( bool bSkewp );
844  void CalculateSlopeIntercept(bool bSlope);
845  void CalculateSmallLarge(bool bSmall);
846  void CalculatePearsonCovar( bool _bPearson, bool _bStexy, bool _bSample ); //fdo#70000 argument _bSample is ignored if _bPearson == true
847  bool CalculateTest( bool _bTemplin
848  ,const SCSIZE nC1, const SCSIZE nC2,const SCSIZE nR1,const SCSIZE nR2
849  ,const ScMatrixRef& pMat1,const ScMatrixRef& pMat2
850  ,double& fT,double& fF);
851  void CalculateLookup(bool bHLookup);
852  bool FillEntry(ScQueryEntry& rEntry);
853  void CalculateAddSub(bool _bSub);
854  void CalculateTrendGrowth(bool _bGrowth);
855  void CalculateRGPRKP(bool _bRKP);
856  void CalculateSumX2MY2SumX2DY2(bool _bSumX2DY2);
857  void CalculateMatrixValue(const ScMatrix* pMat,SCSIZE nC,SCSIZE nR);
858  bool CheckMatrix(bool _bLOG,sal_uInt8& nCase,SCSIZE& nCX,SCSIZE& nCY,SCSIZE& nRX,SCSIZE& nRY,SCSIZE& M,SCSIZE& N,ScMatrixRef& pMatX,ScMatrixRef& pMatY);
859  void ScLinest();
860  void ScLogest();
861  void ScForecast();
862  void ScForecast_Ets( ScETSType eETSType );
863  void ScFourier();
864  void ScNoName();
865  void ScBadName();
866  // Statistics:
867  static double taylor(const double* pPolynom, sal_uInt16 nMax, double x);
868  static double gauss(double x);
869 
870 public:
871  static double phi(double x);
872  static double integralPhi(double x);
873  static double gaussinv(double x);
874  static double GetPercentile( ::std::vector<double> & rArray, double fPercentile );
875 
876 
877 private:
878  double GetBetaDist(double x, double alpha, double beta); //cumulative distribution function
879  double GetBetaDistPDF(double fX, double fA, double fB); //probability density function)
880  double GetChiDist(double fChi, double fDF); // for LEGACY.CHIDIST, returns right tail
881  double GetChiSqDistCDF(double fX, double fDF); // for CHISQDIST, returns left tail
882  static double GetChiSqDistPDF(double fX, double fDF); // probability density function
883  double GetFDist(double x, double fF1, double fF2);
884  double GetTDist( double T, double fDF, int nType );
885  double Fakultaet(double x);
886  static double BinomKoeff(double n, double k);
887  double GetGamma(double x);
888  static double GetLogGamma(double x);
889  double GetBeta(double fAlpha, double fBeta);
890  static double GetLogBeta(double fAlpha, double fBeta);
891  double GetBinomDistPMF(double x, double n, double p); //probability mass function
892  double GetHypGeomDist( double x, double n, double M, double N );
893  void ScLogGamma();
894  void ScGamma();
895  void ScPhi();
896  void ScGauss();
897  void ScStdNormDist();
898  void ScStdNormDist_MS();
899  void ScFisher();
900  void ScFisherInv();
901  void ScFact();
902  void ScNormDist( int nMinParamCount );
903  void ScGammaDist( bool bODFF );
904  void ScGammaInv();
905  void ScExpDist();
906  void ScBinomDist();
907  void ScPoissonDist( bool bODFF );
908  void ScCombin();
909  void ScCombinA();
910  void ScPermut();
911  void ScPermutationA();
912  void ScB();
913  void ScHypGeomDist( int nMinParamCount );
914  void ScLogNormDist( int nMinParamCount );
915  void ScLogNormInv();
916  void ScTDist();
917  void ScTDist_MS();
918  void ScTDist_T( int nTails );
919  void ScFDist();
920  void ScFDist_LT();
921  void ScChiDist( bool bODFF); // for LEGACY.CHIDIST, returns right tail
922  void ScChiSqDist(); // returns left tail or density
923  void ScChiSqDist_MS();
924  void ScChiSqInv(); // inverse to CHISQDIST
925  void ScWeibull();
926  void ScBetaDist();
927  void ScBetaDist_MS();
928  void ScFInv();
929  void ScFInv_LT();
930  void ScTInv( int nType );
931  void ScChiInv();
932  void ScBetaInv();
933  void ScCritBinom();
934  void ScNegBinomDist();
935  void ScNegBinomDist_MS();
936  void ScKurt();
937  void ScHarMean();
938  void ScGeoMean();
939  void ScStandard();
940  void ScSkew();
941  void ScSkewp();
942  void ScMedian();
943  double GetMedian( ::std::vector<double> & rArray );
944  double GetPercentileExclusive( ::std::vector<double> & rArray, double fPercentile );
945  std::vector<double> GetTopNumberArray( SCSIZE& rCol, SCSIZE& rRow );
946  void GetNumberSequenceArray( sal_uInt8 nParamCount, ::std::vector<double>& rArray, bool bConvertTextInArray );
947  void GetSortArray( sal_uInt8 nParamCount, ::std::vector<double>& rSortArray, ::std::vector<long>* pIndexOrder, bool bConvertTextInArray, bool bAllowEmptyArray );
948  static void QuickSort(::std::vector<double>& rSortArray, ::std::vector<long>* pIndexOrder);
949  void ScModalValue();
950  void ScModalValue_MS( bool bSingle );
951  void ScAveDev();
952  void ScAggregate();
953  void ScDevSq();
954  void ScZTest();
955  void ScTTest();
956  void ScFTest();
957  void ScChiTest();
958  void ScRank( bool bAverage );
959  void ScPercentile( bool bInclusive );
960  void ScPercentrank( bool bInclusive );
961  static double GetPercentrank( ::std::vector<double> & rArray, double fVal, bool bInclusive );
962  void ScLarge();
963  void ScSmall();
964  void ScFrequency();
965  void ScQuartile( bool bInclusive );
966  void ScNormInv();
967  void ScSNormInv();
968  void ScConfidence();
969  void ScConfidenceT();
970  void ScTrimMean();
971  void ScProbability();
972  void ScCorrel();
973  void ScCovarianceP();
974  void ScCovarianceS();
975  void ScPearson();
976  void ScRSQ();
977  void ScSTEYX();
978  void ScSlope();
979  void ScTrend();
980  void ScInfo();
981  void ScLenB();
982  void ScRightB();
983  void ScLeftB();
984  void ScMidB();
985  void ScReplaceB();
986  void ScFindB();
987  void ScSearchB();
988 
989  void ScFilterXML();
990  void ScWebservice();
991  void ScEncodeURL();
992  void ScColor();
993  void ScErf();
994  void ScErfc();
995 
996  static const double fMaxGammaArgument;
997 
998  double GetGammaContFraction(double fA,double fX);
999  double GetGammaSeries(double fA,double fX);
1000  double GetLowRegIGamma(double fA,double fX); // lower regularized incomplete gamma function, GAMMAQ
1001  double GetUpRegIGamma(double fA,double fX); // upper regularized incomplete gamma function, GAMMAP
1002  // probability density function; fLambda is "scale" parameter
1003  double GetGammaDistPDF(double fX, double fAlpha, double fLambda);
1004  // cumulative distribution function; fLambda is "scale" parameter
1005  double GetGammaDist(double fX, double fAlpha, double fLambda);
1006  double GetTInv( double fAlpha, double fSize, int nType );
1007 
1008 public:
1009  ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc, ScInterpreterContext& rContext,
1010  const ScAddress&, ScTokenArray&, bool bForGroupThreading = false );
1011  ~ScInterpreter();
1012 
1013  // Used only for threaded formula-groups.
1014  // Resets the interpreter object, allowing reuse of interpreter object for each cell
1015  // in the group.
1016  void Init( ScFormulaCell* pCell, const ScAddress& rPos, ScTokenArray& rTokArray );
1017 
1019 
1020  void SetError(FormulaError nError)
1021  { if (nError != FormulaError::NONE && nGlobalError == FormulaError::NONE) nGlobalError = nError; }
1022  void AssertFormulaMatrix();
1023 
1025  { mpLinkManager = pLinkMgr; }
1026 
1027  FormulaError GetError() const { return nGlobalError; }
1028  formula::StackVar GetResultType() const { return xResult->GetType(); }
1030  double GetNumResult() const { return xResult->GetDouble(); }
1034 };
1035 
1037 {
1038  return bMatrixFormula || pCur->IsInForceArray();
1039 }
1040 
1042 {
1043  if (IsInArrayContext())
1045 }
1046 
1048 {
1050  !pJumpMatrix && sp > 0 )
1051  return ConvertMatrixParameters();
1052  return false;
1053 }
1054 
1056 {
1057  if (!pTokenMatrixMap)
1058  pTokenMatrixMap = CreateTokenMatrixMap();
1059  return *pTokenMatrixMap;
1060 }
1061 
1062 inline bool ScInterpreter::MustHaveParamCount( short nAct, short nMust )
1063 {
1064  if ( nAct == nMust )
1065  return true;
1066  if ( nAct < nMust )
1068  else
1070  return false;
1071 }
1072 
1073 inline bool ScInterpreter::MustHaveParamCount( short nAct, short nMust, short nMax )
1074 {
1075  if ( nMust <= nAct && nAct <= nMax )
1076  return true;
1077  if ( nAct < nMust )
1079  else
1081  return false;
1082 }
1083 
1084 inline bool ScInterpreter::MustHaveParamCountMin( short nAct, short nMin )
1085 {
1086  if ( nAct >= nMin )
1087  return true;
1089  return false;
1090 }
1091 
1093 {
1094  if (!std::isfinite( fVal))
1095  {
1096  fVal = -1.0;
1097  return false;
1098  }
1099  else if (fVal < 0.0)
1100  {
1101  fVal = 0.0;
1102  return false;
1103  }
1104  else if (fVal > SAL_MAX_INT32)
1105  {
1106  fVal = static_cast<double>(SAL_MAX_INT32);
1107  return false;
1108  }
1109  return true;
1110 }
1111 
1113 {
1114  double fVal = rtl::math::approxFloor( GetDouble());
1115  if (!CheckStringPositionArgument( fVal))
1116  {
1117  fVal = -1.0;
1118  SetError( FormulaError::IllegalArgument);
1119  }
1120  return static_cast<sal_Int32>(fVal);
1121 }
1122 
1123 inline bool ScInterpreter::CheckStringResultLen( OUString& rResult, const OUString& rAdd )
1124 {
1125  if (rAdd.getLength() > kScInterpreterMaxStrLen - rResult.getLength())
1126  {
1127  SetError( FormulaError::StringOverflow );
1128  rResult.clear();
1129  return false;
1130  }
1131  return true;
1132 }
1133 
1134 inline bool ScInterpreter::CheckStringResultLen( OUStringBuffer& rResult, const OUString& rAdd )
1135 {
1136  if (rAdd.getLength() > kScInterpreterMaxStrLen - rResult.getLength())
1137  {
1138  SetError( FormulaError::StringOverflow );
1139  rResult = OUStringBuffer();
1140  return false;
1141  }
1142  return true;
1143 }
1144 
1145 inline void ScInterpreter::TreatDoubleError( double& rVal )
1146 {
1147  if ( !std::isfinite( rVal ) )
1148  {
1149  FormulaError nErr = GetDoubleErrorValue( rVal );
1150  if ( nErr != FormulaError::NONE )
1151  SetError( nErr );
1152  else
1153  SetError( FormulaError::NoValue );
1154  rVal = 0.0;
1155  }
1156 }
1157 
1158 inline double ScInterpreter::div( const double& fNumerator, const double& fDenominator )
1159 {
1160  return sc::div(fNumerator, fDenominator);
1161 }
1162 
1163 inline sal_Int16 ScInterpreter::GetDayOfWeek( sal_Int32 n )
1164 { // monday = 0, ..., sunday = 6
1165  return static_cast< sal_Int16 >( ( n - 1 ) % 7 );
1166 }
1167 
1168 #endif
1169 
1170 /* 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:501
void ScFDist_LT()
Definition: interpr3.cxx:1706
void ScGCD()
Definition: interpr5.cxx:130
void ScDecimal()
Definition: interpr2.cxx:2971
double GetLowRegIGamma(double fA, double fX)
You must ensure fA>0.0 && fX>0.0)
Definition: interpr6.cxx:119
void ScRoundSignificant()
Definition: interpr2.cxx:1038
void ScFormula()
Definition: interpr1.cxx:2752
void ScGetDiffDate()
Definition: interpr2.cxx:679
::boost::intrusive_ptr< const FormulaToken > FormulaConstTokenRef
void ScFrequency()
Definition: interpr5.cxx:1864
void ScDBArea()
Definition: interpr4.cxx:3660
void ScBadName()
Definition: interpr3.cxx:182
void ScIndirect()
Definition: interpr1.cxx:8045
void ScArcTan2()
Definition: interpr2.cxx:1267
void GetExternalDoubleRef(sal_uInt16 nFileId, const OUString &rTabName, const ScComplexRefData &aData, ScExternalRefCache::TokenArrayRef &rArray)
Definition: interpr4.cxx:1266
void ScLessEqual()
Definition: interpr1.cxx:1234
void ScPearson()
Definition: interpr3.cxx:4530
void ScSumIfs()
Definition: interpr1.cxx:6484
ScIterFunc
Definition: interpre.hxx:105
sal_uInt32 nRetFmtIndex
Definition: interpre.hxx:217
sal_Int32 GetInt32()
if GetDouble() not within int32 limits sets nGlobalError and returns SAL_MAX_INT32 ...
Definition: interpr4.cxx:2191
void CalculateMatrixValue(const ScMatrix *pMat, SCSIZE nC, SCSIZE nR)
Definition: interpr5.cxx:691
void ScEasterSunday()
Definition: interpr2.cxx:313
static void RoundSignificant(double fX, double fDigits, double &fRes)
Definition: interpr2.cxx:1026
void ScVarP(bool bTextAsZero=false)
Definition: interpr1.cxx:4155
formula::FormulaTokenIterator aCode
Definition: interpre.hxx:196
SvNumFormatType nFuncFmtType
Definition: interpre.hxx:218
void ScGetTimeValue()
Definition: interpr2.cxx:933
void ScSwitch_MS()
Definition: interpr8.cxx:1919
void ScUnichar()
Definition: interpr1.cxx:3566
void ScErfc()
Definition: interpr7.cxx:511
void ScUnicode()
Definition: interpr1.cxx:3551
void ScDebugVar()
Definition: interpr7.cxx:454
void ScBetaInv()
Definition: interpr3.cxx:2214
void ScRank(bool bAverage)
Definition: interpr3.cxx:4219
void CalculateAddSub(bool _bSub)
Definition: interpr5.cxx:1263
void ScMacro()
Definition: interpr4.cxx:3196
static double GetPercentile(::std::vector< double > &rArray, double fPercentile)
Definition: interpr3.cxx:3413
void PushIllegalParameter()
Definition: interpr4.cxx:1914
void ScGauss()
Definition: interpr3.cxx:1142
void ScGetDay()
Definition: interpr2.cxx:140
void PushTempToken(formula::FormulaToken *)
Does substitute with formula::FormulaErrorToken in case nGlobalError is set and the token passed is n...
Definition: interpr4.cxx:620
void ScLCM()
Definition: interpr5.cxx:204
void ScCritBinom()
Definition: interpr3.cxx:1408
void ScEMat()
Definition: interpr5.cxx:714
void ScFloor_Precise()
Definition: interpr2.cxx:1217
static double phi(double x)
Definition: interpr3.cxx:192
FormulaError GetError() const
Definition: interpre.hxx:1027
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:2558
SvNumFormatType nRetFmtType
Definition: interpre.hxx:220
void CalculateSumX2MY2SumX2DY2(bool _bSumX2DY2)
Definition: interpr5.cxx:1785
void ScLog10()
Definition: interpr2.cxx:1304
void ScPDuration()
Definition: interpr2.cxx:1896
formula::StackVar Interpret()
Definition: interpr4.cxx:3948
void ScIntersect()
Definition: interpr2.cxx:2411
void ScStdNormDist_MS()
Definition: interpr3.cxx:1603
void PushSingleRef(SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: interpr4.cxx:1812
void ScNumberValue()
Definition: interpr1.cxx:3341
void ScLogest()
Definition: interpr5.cxx:2387
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:203
SubtotalFlags mnSubTotalFlags
Definition: interpre.hxx:222
void ScRound()
Definition: interpr2.cxx:1011
void ScOffset()
Definition: interpr1.cxx:8317
void ReverseStack(sal_uInt8 nParamCount)
Definition: interpr4.cxx:1985
void SetLinkManager(sfx2::LinkManager *pLinkMgr)
Definition: interpre.hxx:1024
void ScEffect()
Definition: interpr2.cxx:2354
void ScStandard()
Definition: interpr3.cxx:3208
void AssertFormulaMatrix()
Definition: interpr4.cxx:4754
double GetCellValueOrZero(const ScAddress &, ScRefCellValue &rCell)
Definition: interpr4.cxx:193
void ScHypGeomDist(int nMinParamCount)
Calculates a value of the hypergeometric distribution.
Definition: interpr3.cxx:1858
void ScRoman()
Definition: interpr2.cxx:3050
void ScLogNormInv()
Definition: interpr3.cxx:2145
void ScFourier()
Definition: interpr3.cxx:5491
static void QuickSort(::std::vector< double > &rSortArray,::std::vector< long > *pIndexOrder)
Definition: interpr3.cxx:4192
ScMatrixRef GetMatrix()
Definition: interpr5.cxx:462
sal_uIntPtr sal_uLong
double GetPercentileExclusive(::std::vector< double > &rArray, double fPercentile)
Definition: interpr3.cxx:3437
bool IsMissing() const
Definition: interpr4.cxx:1934
void ScDBMin()
Definition: interpr1.cxx:7965
ScCalcConfig maCalcConfig
Definition: interpre.hxx:195
sal_Int32 GetInt32WithDefault(sal_Int32 nDefault)
if GetDoubleWithDefault() not within int32 limits sets nGlobalError and returns SAL_MAX_INT32 ...
Definition: interpr4.cxx:2196
const formula::FormulaToken * pCur
Definition: interpre.hxx:209
void ScRightB()
Definition: interpr1.cxx:9042
bool DoubleRefToPosSingleRef(const ScRange &rRange, ScAddress &rAdr)
Definition: interpr4.cxx:1993
bool CalculateSkew(double &fSum, double &fCount, double &vSum, std::vector< double > &values)
Definition: interpr3.cxx:3223
void ScMax(bool bTextAsZero=false)
Definition: interpr1.cxx:3765
FormulaError GetWeekendAndHolidayMasks_MS(const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,::std::vector< double > &rSortArray, bool bWeekendMask[7], bool bWorkdayFunction)
Definition: interpr2.cxx:394
void ConvertMatrixJumpConditionToMatrix()
Definition: interpr4.cxx:1420
ScDocument * pDok
Definition: interpre.hxx:200
double GetGamma(double x)
You must ensure non integer arguments for fZ<1.
Definition: interpr3.cxx:582
void ScIsEven()
Definition: interpr1.cxx:3103
void ScGreater()
Definition: interpr1.cxx:1217
void ScDBVar()
Definition: interpr1.cxx:8031
void ScCeil_MS()
Definition: interpr2.cxx:1108
void ScHLookup()
Definition: interpr1.cxx:7186
static thread_local bool bGlobalStackInUse
Definition: interpre.hxx:193
void GetNumberSequenceArray(sal_uInt8 nParamCount,::std::vector< double > &rArray, bool bConvertTextInArray)
Definition: interpr3.cxx:3942
void ScColumn()
Definition: interpr1.cxx:4367
void ScCeil(bool bODFF)
tdf69552 ODFF1.2 function CEILING and Excel function CEILING.MATH In essence, the difference between ...
Definition: interpr2.cxx:1068
void PopSingleRef(ScAddress &)
Definition: interpr4.cxx:909
bool FillEntry(ScQueryEntry &rEntry)
Definition: interpr1.cxx:7444
void ScConcat_MS()
Definition: interpr8.cxx:1378
void ScIfs_MS()
Definition: interpr8.cxx:1852
void ScGetActDate()
Definition: interpr2.cxx:106
void ScDevSq()
Definition: interpr3.cxx:4440
void PushDoubleRef(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
Definition: interpr4.cxx:1822
void ScBitAnd()
Definition: interpr1.cxx:1643
double GetChiDist(double fChi, double fDF)
You must ensure fDF>0.0.
Definition: interpr3.cxx:666
OpCode GetOpCode() const
void ScIsEmpty()
Definition: interpr1.cxx:1969
formula::StackVar GetRawStackType()
Raw stack type without default replacements.
Definition: interpr4.cxx:1939
void ScChiSqDist_MS()
Definition: interpr3.cxx:747
void CalculateRGPRKP(bool _bRKP)
Definition: interpr5.cxx:2392
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:183
void ScChiSqDist()
Definition: interpr3.cxx:724
void ScStdNormDist()
Definition: interpr3.cxx:1598
void ScGetDiffDate360()
Definition: interpr2.cxx:689
void ScConcat()
Definition: interpr1.cxx:9702
void ScSumProduct()
Definition: interpr5.cxx:1733
void ScBitLshift()
Definition: interpr1.cxx:1688
void ScModalValue_MS(bool bSingle)
Definition: interpr3.cxx:3557
sal_uLong GetRetFormatIndex() const
Definition: interpre.hxx:1033
void ScDBCount2()
Definition: interpr1.cxx:7925
void ScGetMin()
Definition: interpr2.cxx:147
static utl::SearchParam::SearchType DetectSearchType(const OUString &rStr, const ScDocument *pDoc)
Detect if string should be used as regular expression or wildcard expression or literal string...
Definition: interpr1.cxx:9900
void ScArcCotHyp()
Definition: interpr1.cxx:1926
bool IsString()
Definition: interpr1.cxx:2023
void ScPermut()
Definition: interpr3.cxx:1196
void ScRawSubtract()
Definition: interpr6.cxx:1071
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:1166
void ScFilterXML()
Definition: interpr7.cxx:42
double GetDoubleWithDefault(double nDefault)
Definition: interpr4.cxx:2154
void ScGammaDist(bool bODFF)
Definition: interpr3.cxx:2093
bool IfErrorPushError()
If nGlobalError is set push formula::FormulaErrorToken.
Definition: interpre.hxx:306
bool ConvertMatrixParameters()
Definition: interpr4.cxx:1444
bool PopDoubleRefOrSingleRef(ScAddress &rAdr)
Definition: interpr4.cxx:1324
void ScRight()
Definition: interpr1.cxx:9234
void ScGetActTime()
Definition: interpr2.cxx:114
static std::unique_ptr< ScTokenMatrixMap > CreateTokenMatrixMap()
Definition: interpr4.cxx:1439
ScTokenMatrixMap & GetTokenMatrixMap()
Definition: interpre.hxx:1055
SvNumberFormatter * pFormatter
Definition: interpre.hxx:207
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:689
void ScNoName()
Definition: interpr3.cxx:177
void CurFmtToFuncFmt()
Definition: interpre.hxx:466
void ScCount2()
Definition: interpr6.cxx:1066
constexpr sal_Int32 kScInterpreterMaxStrLen
Arbitrary 256MB result string length limit.
Definition: interpre.hxx:95
void PushTempTokenWithoutError(const formula::FormulaToken *)
Does not substitute with formula::FormulaErrorToken in case nGlobalError is set.
Definition: interpr4.cxx:649
void PushParameterExpected()
Definition: interpr4.cxx:1909
void ScRandbetween()
Definition: interpr1.cxx:1799
SubtotalFlags
Definition: global.hxx:250
void ScCellExternal()
Definition: interpr1.cxx:2419
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:3581
sal_uInt16 sal_Unicode
void ScSumSQ()
Definition: interpr6.cxx:1041
sal_uInt32 GetCellNumberFormat(const ScAddress &rPos, ScRefCellValue &rCell)
Definition: interpr4.cxx:130
void ScReplaceB()
Definition: interpr1.cxx:9132
void ScCeil_Precise()
Definition: interpr2.cxx:1126
double PopDouble()
Definition: interpr4.cxx:783
double GetBeta(double fAlpha, double fBeta)
Definition: interpr3.cxx:797
char sal_uInt16 & nParamCount
Definition: callform.cxx:54
void ScGetHour()
Definition: interpr2.cxx:166
void ScSearchB()
Definition: interpr1.cxx:9189
void ScUnionFunc()
Definition: interpr2.cxx:2578
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:2205
void ScDBAverage()
Definition: interpr1.cxx:7955
void PushInt(int nVal)
Definition: interpr4.cxx:1784
void ScAverage(bool bTextAsZero=false)
Definition: interpr6.cxx:1056
SvNumFormatType nCurFmtType
Definition: interpre.hxx:219
sal_Int32 GetStringPositionArgument()
Obtain a sal_Int32 suitable as string position or length argument.
Definition: interpre.hxx:1112
std::unique_ptr< ScTokenMatrixMap > pTokenMatrixMap
Definition: interpre.hxx:205
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:299
static ScCalcConfig * mpGlobalConfig
Definition: interpre.hxx:190
void ScMatTrans()
Definition: interpr5.cxx:1111
void ScSinHyp()
Definition: interpr1.cxx:1883
void ScGetDateValue()
Definition: interpr2.cxx:174
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:1845
void ScFisher()
Definition: interpr3.cxx:1147
static double ScGetPMT(double fRate, double fNper, double fPv, double fFv, bool bPayInAdvance)
Definition: interpr2.cxx:1922
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:1973
ScIterFuncIf
Definition: interpre.hxx:116
void MatrixJumpConditionToMatrix()
Definition: interpre.hxx:1041
ScMatrixRef QueryMat(const ScMatrixRef &pMat, sc::CompareOptions &rOptions)
Definition: interpr1.cxx:1144
static double gaussinv(double x)
Definition: interpr3.cxx:265
ScETSType
Definition: interpre.hxx:122
void ScProper()
Definition: interpr1.cxx:3152
static const double fMaxGammaArgument
Definition: interpre.hxx:996
void ScFindB()
Definition: interpr1.cxx:9155
sal_Int32 double_to_int32(double fVal)
Definition: interpr4.cxx:2163
::boost::intrusive_ptr< ScMatrix > ScMatrixRef
Definition: types.hxx:26
void ScWebservice()
Definition: interpr7.cxx:276
void ScColumns()
Definition: interpr1.cxx:4206
void PushString(const OUString &rStr)
Definition: interpr4.cxx:1801
ScFormulaCell * pMyFormulaCell
Definition: interpre.hxx:206
FormulaError mnStringNoValueError
Definition: interpre.hxx:221
void ScArcSinHyp()
Definition: interpr1.cxx:1903
void ScSecantHyp()
Definition: interpr1.cxx:1950
FormulaError GetDoubleErrorValue(double fVal)
void ScMatDet()
Definition: interpr5.cxx:903
void ScRandomImpl(const std::function< double(double fFirst, double fLast)> &RandomFunc, double fFirst, double fLast)
Definition: interpr1.cxx:1739
void ScLinest()
Definition: interpr5.cxx:2381
const formula::FormulaToken ** pStack
Definition: interpre.hxx:211
void ScDBCount()
Definition: interpr1.cxx:7867
void ScConvertOOo()
Definition: interpr2.cxx:3027
void ScChooseJump()
Definition: interpr1.cxx:410
void ScIsString()
Definition: interpr1.cxx:2091
void PushError(FormulaError nError)
Definition: interpr4.cxx:1903
sc::RangeMatrix CompareMat(ScQueryOp eOp, sc::CompareOptions *pOptions=nullptr)
Definition: interpr1.cxx:982
void ScCount()
Definition: interpr6.cxx:1061
void ScChiSqInv()
Definition: interpr3.cxx:2405
void ScSumIf()
Definition: interpr1.cxx:5612
void ScGetWeekOfYear()
Definition: interpr2.cxx:253
double GetTDist(double T, double fDF, int nType)
Definition: interpr3.cxx:645
void ScSheet()
Definition: interpr1.cxx:4574
void ScFalse()
Definition: interpr1.cxx:1827
void ScGreaterEqual()
Definition: interpr1.cxx:1251
void ScNetWorkdays(bool bOOXML_Version)
Definition: interpr2.cxx:512
void ScColRowNameAuto()
Definition: interpr4.cxx:3677
void IterateParametersIf(ScIterFuncIf)
Definition: interpr1.cxx:5182
void ScFisherInv()
Definition: interpr3.cxx:1156
void MakeMatNew(ScMatrixRef &rMat, SCSIZE nC, SCSIZE nR)
Definition: interpr5.cxx:284
sc::RangeMatrix PopRangeMatrix()
Definition: interpr4.cxx:1650
void ScIsOdd()
Definition: interpr1.cxx:3108
double GetDouble()
Definition: interpr4.cxx:2073
std::unique_ptr< ScDBQueryParamBase > GetDBParams(bool &rMissingField)
Definition: interpr1.cxx:7651
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:464
ScInterpreterContext & mrContext
Definition: interpre.hxx:199
void ScInt()
Definition: interpr2.cxx:971
void ScEuroConvert()
Definition: interpr2.cxx:3322
bool LookupQueryWithCache(ScAddress &o_rResultPos, const ScQueryParam &rParam) const
Definition: interpr1.cxx:9985
bool MustHaveParamCount(short nAct, short nMust)
Definition: interpre.hxx:1062
static void SetGlobalConfig(const ScCalcConfig &rConfig)
Definition: interpr4.cxx:3871
svl::SharedString GetStringResult() const
Definition: interpr4.cxx:4759
void ScSkewp()
Definition: interpr3.cxx:3374
ScMatrixRef PopMatrix()
Definition: interpr4.cxx:1618
void ScFloor_MS()
Definition: interpr2.cxx:1196
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:602
formula::FormulaConstTokenRef PopToken()
Definition: interpr4.cxx:768
void ScGeoMean()
Definition: interpr3.cxx:3036
void DoubleRefToRange(const ScComplexRefData &, ScRange &, bool bDontCheckForTableOp=false)
Definition: interpr4.cxx:1031
void CalculateSmallLarge(bool bSmall)
Definition: interpr3.cxx:3643
::std::map< const formula::FormulaConstTokenRef, formula::FormulaConstTokenRef, FormulaTokenRef_less > ScTokenMatrixMap
Definition: interpre.hxx:138
void ScAddressFunc()
Definition: interpr1.cxx:8215
static void GlobalExit()
Definition: interpr4.cxx:3887
ScMatValType GetDoubleOrStringFromMatrix(double &rDouble, svl::SharedString &rString)
Definition: interpr4.cxx:2411
#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:1158
double ConvertStringToValue(const OUString &)
Definition: interpr4.cxx:168
sal_uInt16 sp
Definition: interpre.hxx:213
void ScLookup()
Definition: interpr1.cxx:6571
void ScTrimMean()
Definition: interpr3.cxx:3828
void ScVar(bool bTextAsZero=false)
Definition: interpr1.cxx:4143
void ScCountEmptyCells()
Definition: interpr1.cxx:5122
sfx2::LinkManager * mpLinkManager
Definition: interpre.hxx:201
void ScGetIsoWeekOfYear()
Definition: interpr2.cxx:303
bool IsTableOpInRange(const ScRange &)
Definition: interpr4.cxx:112
void ScLogGamma()
Definition: interpr3.cxx:788
void ScGetDateDif()
Definition: interpr2.cxx:784
svl::SharedString PopString()
Definition: interpr4.cxx:815
void CalculatePearsonCovar(bool _bPearson, bool _bStexy, bool _bSample)
Definition: interpr3.cxx:4535
void PushDouble(double nVal)
Definition: interpr4.cxx:1777
void ScIsRef()
Definition: interpr1.cxx:2560
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:2195
void ScErrorType()
Definition: interpr1.cxx:9789
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:966
sal_uInt16 & nParam
Definition: callform.cxx:58
void ScMaxIfs_MS()
Definition: interpr1.cxx:6554
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:317
void PopDoubleRef(ScRange &rRange, short &rParam, size_t &rRefInList)
If formula::StackVar formula::svDoubleRef pop ScDoubleRefToken and return values of ScComplexRefData...
Definition: interpr4.cxx:1049
bool IsInForceArray() const
void ScMedian()
Definition: interpr3.cxx:3403
void ScArcCos()
Definition: interpr1.cxx:1868
void ScMatValue()
Definition: interpr5.cxx:613
void ScAmpersand()
Definition: interpr5.cxx:1391
void ScSlope()
Definition: interpr3.cxx:4721
void ScArcTan()
Definition: interpr1.cxx:1873
void ScDBGet()
Definition: interpr4.cxx:2482
static ScCalcConfig & GetOrCreateGlobalConfig()
Definition: interpr4.cxx:3864
void ScIsFormula()
Definition: interpr1.cxx:2683
double GetDoubleFromMatrix(const ScMatrixRef &pMat)
Definition: interpr4.cxx:2032
formula::FormulaToken * CreateFormulaDoubleToken(double fVal, SvNumFormatType nFmt=SvNumFormatType::NUMBER)
Definition: interpr4.cxx:1742
bool MustHaveParamCountMin(short nAct, short nMin)
Definition: interpre.hxx:1084
SvNumFormatType GetRetFormatType() const
Definition: interpre.hxx:1032
void PushMatrix(const sc::RangeMatrix &rMat)
Definition: interpr4.cxx:1878
void ScTDist_T(int nTails)
Definition: interpr3.cxx:1658
ScTokenArray * pArr
Definition: interpre.hxx:198
void ScErrorType_ODF()
Definition: interpr1.cxx:9803
void ScIfJump()
Definition: interpr1.cxx:87
static FormulaError GetCellErrCode(const ScRefCellValue &rCell)
Definition: interpr4.cxx:163
VolatileType meVolatileType
Definition: interpre.hxx:227
void PushExternalSingleRef(sal_uInt16 nFileId, const OUString &rTabName, SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: interpr4.cxx:1833
void ScConfidence()
Definition: interpr3.cxx:2425
void QueryMatrixType(const ScMatrixRef &xMat, SvNumFormatType &rRetTypeExpr, sal_uInt32 &rRetIndexExpr)
Definition: interpr4.cxx:1690
SvNumFormatType
void GetCellString(svl::SharedString &rStr, ScRefCellValue &rCell)
Definition: interpr4.cxx:250
void ScCotHyp()
Definition: interpr1.cxx:1898
void ScCountIfs()
Definition: interpr1.cxx:6519
void ScGetYear()
Definition: interpr2.cxx:126
void ScAverageIfs()
Definition: interpr1.cxx:6502
sal_uInt8 cPar
Definition: interpre.hxx:223
void ScAreas()
Definition: interpr1.cxx:8697
FormulaError nGlobalError
Definition: interpre.hxx:212
void ScFTest()
Definition: interpr3.cxx:2732
void ScGetTime()
Definition: interpr2.cxx:663
bool CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8 *pCellArr)
Definition: interpr4.cxx:367
svl::SharedString GetStringFromMatrix(const ScMatrixRef &pMat)
Definition: interpr4.cxx:2389
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:8017
bool JumpMatrix(short nStackLevel)
Definition: interpr1.cxx:539
static double taylor(const double *pPolynom, sal_uInt16 nMax, double x)
Definition: interpr3.cxx:202
void ScIsLogical()
Definition: interpr1.cxx:2101
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:66
void PopRefListPushMatrixOrRef()
Definition: interpr4.cxx:1360
formula::StackVar GetResultType() const
Definition: interpre.hxx:1028
void GetSortArray(sal_uInt8 nParamCount,::std::vector< double > &rSortArray,::std::vector< long > *pIndexOrder, bool bConvertTextInArray, bool bAllowEmptyArray)
Definition: interpr3.cxx:4125
void ScNotEqual()
Definition: interpr1.cxx:1183
void ScRoundDown()
Definition: interpr2.cxx:1016
void ScCumPrinc()
Definition: interpr2.cxx:2311
void ScCosecantHyp()
Definition: interpr1.cxx:1945
sal_uInt32 nFuncFmtIndex
Definition: interpre.hxx:215
void ScSheets()
Definition: interpr1.cxx:4320
formula::StackVar GetStackType()
Stack type with replacement of defaults, e.g. svMissing and formula::svEmptyCell will result in formu...
Definition: interpr4.cxx:1954
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:2275
void ScDBStdDevP()
Definition: interpr1.cxx:8024
void ReplaceCell(ScAddress &)
Definition: interpr4.cxx:93
void ScConfidenceT()
Definition: interpr3.cxx:2439
static thread_local std::unique_ptr< ScTokenStack > pGlobalStack
Definition: interpre.hxx:192
void ScFloor(bool bODFF)
tdf69552 ODFF1.2 function FLOOR and Excel function FLOOR.MATH In essence, the difference between the ...
Definition: interpr2.cxx:1156
double GetValueCellValue(const ScAddress &, double fOrig)
Only ValueCell, formula cells already store the result rounded.
Definition: interpr4.cxx:153
void ScMissing()
Definition: interpr4.cxx:3098
void ScDBVarP()
Definition: interpr1.cxx:8038
FormulaError
sal_uInt8 GetByte() const
Definition: interpre.hxx:427
void ScGetSec()
Definition: interpr2.cxx:155
bool SetSbxVariable(SbxVariable *pVar, const ScAddress &)
static const ScCalcConfig & GetGlobalConfig()
Definition: interpr4.cxx:3876
void ScCosHyp()
Definition: interpr1.cxx:1888
void ScIndex()
Definition: interpr1.cxx:8479
void ValidateRef(const ScSingleRefData &rRef)
Definition: interpr4.cxx:843
void CalculateTrendGrowth(bool _bGrowth)
Definition: interpr5.cxx:2916
Reference< XOutputStream > stream
svl::SharedStringPool & mrStrPool
Definition: interpre.hxx:202
bool bCalcAsShown
Definition: interpre.hxx:224
static bool MayBeRegExp(const OUString &rStr, bool bIgnoreWildcards=false)
Could string be a regular expression? if regularExpressions are disabled the function returns false r...
Definition: interpr1.cxx:9859
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:3840
ScDBRangeBase * PopDBDoubleRef()
Definition: interpr4.cxx:967
FormulaError GetWeekendAndHolidayMasks(const sal_uInt8 nParamCount, const sal_uInt32 nNullDate,::std::vector< double > &rSortArray, bool bWeekendMask[7])
Definition: interpr2.cxx:354
void IterateParameters(ScIterFunc, bool bTextAsZero=false)
Definition: interpr6.cxx:511
Configuration options for formula interpreter.
Definition: calcconfig.hxx:43
void ScTanHyp()
Definition: interpr1.cxx:1893
void CalculateSkewOrSkewp(bool bSkewp)
Definition: interpr3.cxx:3329
void ScUpper()
Definition: interpr1.cxx:3146
void ScSmall()
Definition: interpr3.cxx:3728
void ScMatRef()
Definition: interpr5.cxx:3214
sal_uInt16 maxsp
Definition: interpre.hxx:214
void PushIllegalArgument()
Definition: interpr4.cxx:1919
void ScEncodeURL()
Returns a string in which all non-alphanumeric characters except stroke and underscore (-_) have been...
Definition: interpr7.cxx:417
sal_uInt32 GetUInt32()
if GetDouble() not within uint32 limits sets nGlobalError and returns SAL_MAX_UINT32 ...
Definition: interpr4.cxx:2234
void ScReplace()
Definition: interpr1.cxx:8790
::formula::FormulaTokenRef TokenRef
void ScGetDate()
Definition: interpr2.cxx:644
void ScWeeknumOOo()
Definition: interpr2.cxx:241
void ScCumIpmt()
Definition: interpr2.cxx:2269
sal_Int32 SCROW
Definition: types.hxx:18
void ScLower()
Definition: interpr1.cxx:3176
void ScIsNonString()
Definition: interpr1.cxx:2096
void ScModalValue()
Definition: interpr3.cxx:3513
void ScISPMT()
Definition: interpr2.cxx:1602
void ScBitRshift()
Definition: interpr1.cxx:1711
void PushWithoutError(const formula::FormulaToken &r)
Does not substitute with formula::FormulaErrorToken in case nGlobalError is set.
Definition: interpr4.cxx:586
void ScMinIfs_MS()
Definition: interpr1.cxx:6536
static double GetLogBeta(double fAlpha, double fBeta)
Definition: interpr3.cxx:830
void ScArcCot()
Definition: interpr1.cxx:1878
static bool RateIteration(double fNper, double fPayment, double fPv, double fFv, bool bPayType, double &fGuess)
Definition: interpr2.cxx:2035
void ScStyle()
Definition: interpr2.cxx:2663
void ScAggregate()
Definition: interpr1.cxx:7555
void ScStDevP(bool bTextAsZero=false)
Definition: interpr1.cxx:4177
void ScLarge()
Definition: interpr3.cxx:3723
static sal_Int16 GetDayOfWeek(sal_Int32 n)
Definition: interpre.hxx:1163
static double BinomKoeff(double n, double k)
Definition: interpr3.cxx:457
void ScPlusMinus()
Definition: interpr2.cxx:955
static double ScGetDDB(double fCost, double fSalvage, double fLife, double fPeriod, double fFactor)
Definition: interpr2.cxx:1671
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:1825
void ScDBMax()
Definition: interpr1.cxx:7960
void ScArabic()
Definition: interpr2.cxx:3136
unsigned char sal_uInt8
void ScForecast_Ets(ScETSType eETSType)
Definition: interpr8.cxx:1171
void ScRandom()
Definition: interpr1.cxx:1790
bool CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt8 *pCellArr)
Definition: interpr4.cxx:285
void ScMatInv()
Definition: interpr5.cxx:950
bool bMatrixFormula
Definition: interpre.hxx:225
void PopDoubleRefPushMatrix()
Definition: interpr4.cxx:1346
FormulaError GetErrorType()
Definition: interpr1.cxx:9717
void ScIsError()
Definition: interpr1.cxx:2950
void ScTrend()
Definition: interpr5.cxx:2906
void CalculateLookup(bool bHLookup)
Definition: interpr1.cxx:7191
void ScCurrency()
Definition: interpr1.cxx:8733
void ScLeftB()
Definition: interpr1.cxx:9091
std::shared_ptr< ScTokenArray > TokenArrayRef
void ScCurrent()
Definition: interpr2.cxx:2651
void GetStVarParams(bool bTextAsZero, double(*VarResult)(double fVal, size_t nValCount))
Definition: interpr1.cxx:3923
static double ScInterVDB(double fCost, double fSalvage, double fLife, double fLife1, double fPeriod, double fFactor)
Definition: interpr2.cxx:1765
ScJumpMatrix * pJumpMatrix
Definition: interpre.hxx:204
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:7862
ScAddress aPos
Definition: interpre.hxx:197
ScMatValType
Definition: types.hxx:32
void ScWorkday_MS()
Definition: interpr2.cxx:572
ScMatrixRef MatConcat(const ScMatrixRef &pMat1, const ScMatrixRef &pMat2)
Definition: interpr5.cxx:1214
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:865
svl::SharedString GetStringFromDouble(const double fVal)
Definition: interpr4.cxx:2472
void ScCosecant()
Definition: interpr1.cxx:1935
void ScNormDist(int nMinParamCount)
Definition: interpr3.cxx:1548
void ScSubTotal()
Definition: interpr1.cxx:7508
void RoundNumber(rtl_math_RoundingMode eMode)
Definition: interpr2.cxx:976
void ScBahtText()
Definition: interpr2.cxx:3494
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:401
svl::SharedString GetString()
Definition: interpr4.cxx:2310
These need to be in global namespace just like their respective types are.
double GetNumResult() const
Definition: interpre.hxx:1030
void ScVLookup()
Definition: interpr1.cxx:7503
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:1929
void ScNominal()
Definition: interpr2.cxx:2373
void ScPower()
Definition: interpr5.cxx:1642
bool MatrixParameterConversion()
Definition: interpre.hxx:1047
void ScSumX2MY2()
Definition: interpr5.cxx:1781
void ScGetPivotData()
Definition: interpr2.cxx:3561
void ScPermutationA()
Definition: interpr3.cxx:1216
ScQueryOp
Definition: global.hxx:821
void ScSTEYX()
Definition: interpr3.cxx:4645
void PopExternalSingleRef(sal_uInt16 &rFileId, OUString &rTabName, ScSingleRefData &rRef)
Definition: interpr4.cxx:1123
void ScSumXMY2()
Definition: interpr5.cxx:1830
void MergeCalcConfig()
Merge global and document specific settings.
Definition: interpr4.cxx:3881
void ScSecant()
Definition: interpr1.cxx:1940
Complex reference (a range) into the sheet.
Definition: refdata.hxx:123
void ScRoundUp()
Definition: interpr2.cxx:1021
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:7789
void ScMatch()
Definition: interpr1.cxx:4780
void ScRegex()
Definition: interpr1.cxx:9316
void GetDBStVarParams(double &rVal, double &rValCount)
Definition: interpr1.cxx:7975
void ScAverageIf()
Definition: interpr1.cxx:5617
void PopError()
Definition: interpr4.cxx:756
void ScWeibull()
Definition: interpr3.cxx:1765
ScTokenStack * pStackObj
Definition: interpre.hxx:210
static bool MayBeWildcard(const OUString &rStr)
Could string be a wildcard (*,?,~) expression? If wildcards are disabled the function returns false r...
Definition: interpr1.cxx:9880
sc::RangeMatrix GetRangeMatrix()
Definition: interpr5.cxx:599
void ScBitXor()
Definition: interpr1.cxx:1673
void ScBitOr()
Definition: interpr1.cxx:1658
void ScTDist()
Definition: interpr3.cxx:1643
void ScFInv_LT()
Definition: interpr3.cxx:2335
void ScMin(bool bTextAsZero=false)
Definition: interpr1.cxx:3607
void ScGetMonth()
Definition: interpr2.cxx:133
void ScProbability()
Definition: interpr3.cxx:4449
void PopExternalDoubleRef(sal_uInt16 &rFileId, OUString &rTabName, ScComplexRefData &rRef)
Definition: interpr4.cxx:1202
void ScPercentrank(bool bInclusive)
Definition: interpr3.cxx:3733
void ScIsErr()
Definition: interpr1.cxx:2887
formula::FormulaToken * CreateDoubleOrTypedToken(double fVal)
Definition: interpr4.cxx:1767
void ScClean()
Definition: interpr1.cxx:3442
void ScGetDayOfWeek()
Definition: interpr2.cxx:194
bool CheckStringResultLen(OUString &rResult, const OUString &rAdd)
Definition: interpre.hxx:1123
void ScExternal()
Definition: interpr4.cxx:2517
const formula::FormulaConstTokenRef & GetResultToken() const
Definition: interpre.hxx:1031
void ScExact()
Definition: interpr1.cxx:8917
void ScFDist()
Definition: interpr3.cxx:1691
void ScForecast()
Definition: interpr3.cxx:4731
void ScMultiArea()
Definition: interpr1.cxx:8684
void ScSearch()
Definition: interpr1.cxx:9270
void ScArcSin()
Definition: interpr1.cxx:1863
void ScGrowth()
Definition: interpr5.cxx:2911
void TreatDoubleError(double &rVal)
Definition: interpre.hxx:1145
const formula::FormulaToken * pPointer[MAXSTACK]
Definition: interpre.hxx:102
void PushTokenRef(const formula::FormulaConstTokenRef &)
Pushes the token or substitutes with formula::FormulaErrorToken in case nGlobalError is set and the t...
Definition: interpr4.cxx:669
static void MEMat(const ScMatrixRef &mM, SCSIZE n)
Definition: interpr5.cxx:737
::std::vector< ScComplexRefData > ScRefList
Definition: token.hxx:38
double Compare(ScQueryOp eOp)
Definition: interpr1.cxx:885
void ScCombin()
Definition: interpr3.cxx:1170
void ScArcTanHyp()
Definition: interpr1.cxx:1917
static double ScGetPV(double fRate, double fNper, double fPmt, double fFv, bool bPayInAdvance)
Definition: interpr2.cxx:1619
void PushStringBuffer(const sal_Unicode *pString)
Definition: interpr4.cxx:1790
double GetBetaDistPDF(double fX, double fA, double fB)
Definition: interpr3.cxx:859
void ScSubstitute()
Definition: interpr1.cxx:9626
void ScQuartile(bool bInclusive)
Definition: interpr3.cxx:3490
void IterateParametersIfs(double(*ResultFunc)(const sc::ParamIfsResult &rRes))
Definition: interpr1.cxx:5819
void ScValue()
Definition: interpr1.cxx:3262
void ScProduct()
Definition: interpr6.cxx:1051
void ScIsValue()
Definition: interpr1.cxx:2612
double GetGammaDistPDF(double fX, double fAlpha, double fLambda)
Gamma distribution, probability density function.
Definition: interpr6.cxx:144
void ScArcCosHyp()
Definition: interpr1.cxx:1908
void ScZTest()
Definition: interpr3.cxx:2455
void ScCombinA()
Definition: interpr3.cxx:1183
void ScCountIf()
Definition: interpr1.cxx:5622
ScInterpreter(ScFormulaCell *pCell, ScDocument *pDoc, ScInterpreterContext &rContext, const ScAddress &, ScTokenArray &, bool bForGroupThreading=false)
Definition: interpr4.cxx:3777
void SetError(FormulaError nError)
Definition: interpre.hxx:1020
double GetMedian(::std::vector< double > &rArray)
Definition: interpr3.cxx:3379
bool GetBool()
Definition: interpre.hxx:445
static bool CheckStringPositionArgument(double &fVal)
Check if a double is suitable as string position or length argument.
Definition: interpre.hxx:1092
Each instance of this struct represents a single filtering criteria.
Definition: queryentry.hxx:33
VolatileType GetVolatileType() const
Definition: interpre.hxx:186
void ScTableOp()
Definition: interpr4.cxx:3569
void ScFixed()
Definition: interpr1.cxx:8828
void DoubleRefToVars(const formula::FormulaToken *p, SCCOL &rCol1, SCROW &rRow1, SCTAB &rTab1, SCCOL &rCol2, SCROW &rRow2, SCTAB &rTab2)
Definition: interpr4.cxx:946
void ScStDev(bool bTextAsZero=false)
Definition: interpr1.cxx:4165
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:109
void ScHyperLink()
Definition: interpr2.cxx:3193
bool GetDoubleOrString(double &rValue, svl::SharedString &rString)
returns TRUE if double (or error, check nGlobalError), else FALSE
Definition: interpr4.cxx:2250
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:243
void ScPercentSign()
Definition: interpr1.cxx:1599
void ScSNormInv()
Definition: interpr3.cxx:2134
void ScColor()
Definition: interpr7.cxx:521
void ScMatMult()
Definition: interpr5.cxx:1062
bool IsInArrayContext() const
Definition: interpre.hxx:1036
void ScDBProduct()
Definition: interpr1.cxx:7970
double GetBetaDist(double x, double alpha, double beta)
Definition: interpr3.cxx:982
void ScAveDev()
Definition: interpr3.cxx:4282
#define MAXSTACK
Definition: interpre.hxx:97
static double integralPhi(double x)
Definition: interpr3.cxx:197
bool operator()(const formula::FormulaConstTokenRef &r1, const formula::FormulaConstTokenRef &r2) const
Definition: interpre.hxx:135
sal_uInt32 nCurFmtIndex
Definition: interpre.hxx:216
void ScGamma()
Definition: interpr3.cxx:771
void ScCovarianceP()
Definition: interpr3.cxx:4520