LibreOffice Module sc (master) 1
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ScTokenArray Class Referencefinal

#include <tokenarray.hxx>

Inheritance diagram for ScTokenArray:
[legend]
Collaboration diagram for ScTokenArray:
[legend]

Public Member Functions

 ScTokenArray (const ScDocument &rDoc)
 
 ScTokenArray (ScSheetLimits &)
 
 ScTokenArray (const ScTokenArray &)=default
 Assignment with incrementing references of FormulaToken entries (not copied!) More...
 
 ScTokenArray (ScTokenArray &&)=default
 
virtual ~ScTokenArray () override
 
bool EqualTokens (const ScTokenArray *pArr2) const
 
virtual void Clear () override
 
std::unique_ptr< ScTokenArrayClone () const
 
ScTokenArray CloneValue () const
 True copy! More...
 
void GenHash ()
 True copy! More...
 
size_t GetHash () const
 
ScFormulaVectorState GetVectorState () const
 
void ResetVectorState ()
 
bool IsFormulaVectorDisabled () const
 
bool IsInvariant () const
 If the array contains at least one relative row reference or named expression, it's variant. More...
 
bool IsReference (ScRange &rRange, const ScAddress &rPos) const
 Exactly and only one range (valid or deleted) More...
 
bool IsValidReference (ScRange &rRange, const ScAddress &rPos) const
 Exactly and only one valid range (no #REF!s) More...
 
bool GetAdjacentExtendOfOuterFuncRefs (SCCOLROW &nExtend, const ScAddress &rPos, ScDirection)
 Determines the extent of direct adjacent references. More...
 
formula::FormulaTokenAddRawToken (const ScRawToken &)
 
virtual bool AddFormulaToken (const css::sheet::FormulaToken &rToken, svl::SharedStringPool &rSPool, formula::ExternalReferenceHelper *_pRef) override
 
virtual void CheckToken (const formula::FormulaToken &r) override
 
virtual formula::FormulaTokenAddOpCode (OpCode eCode) override
 
formula::FormulaTokenAddSingleReference (const ScSingleRefData &rRef)
 ScSingleRefToken with ocPush. More...
 
formula::FormulaTokenAddMatrixSingleReference (const ScSingleRefData &rRef)
 ScSingleRefOpToken with ocMatRef. More...
 
formula::FormulaTokenAddDoubleReference (const ScComplexRefData &rRef)
 
void AddRangeName (sal_uInt16 n, sal_Int16 nSheet)
 
formula::FormulaTokenAddDBRange (sal_uInt16 n)
 
formula::FormulaTokenAddExternalName (sal_uInt16 nFileId, const svl::SharedString &rName)
 
void AddExternalSingleReference (sal_uInt16 nFileId, const svl::SharedString &rTabName, const ScSingleRefData &rRef)
 
formula::FormulaTokenAddExternalDoubleReference (sal_uInt16 nFileId, const svl::SharedString &rTabName, const ScComplexRefData &rRef)
 
formula::FormulaTokenAddMatrix (const ScMatrixRef &p)
 
formula::FormulaTokenAddColRowName (const ScSingleRefData &rRef)
 ScSingleRefOpToken with ocColRowName. More...
 
virtual formula::FormulaTokenMergeArray () override
 
void MergeRangeReference (const ScAddress &rPos)
 Merge very last SingleRef+ocRange+SingleRef combination into DoubleRef and adjust pCode array, or do nothing if conditions not met. More...
 
void AssignXMLString (const OUString &rText, const OUString &rFormulaNmsp)
 Assign XML string placeholder to the array. More...
 
ScTokenArrayoperator= (const ScTokenArray &)
 Assignment with incrementing references of FormulaToken entries (not copied!) More...
 
ScTokenArrayoperator= (ScTokenArray &&)
 
void ReadjustAbsolute3DReferences (const ScDocument &rOldDoc, ScDocument &rNewDoc, const ScAddress &rPos, bool bRangeName=false)
 Make all absolute references external references pointing to the old document. More...
 
void AdjustAbsoluteRefs (const ScDocument &rOldDoc, const ScAddress &rOldPos, const ScAddress &rNewPos, bool bCheckCopyArea)
 Make all absolute references pointing to the copied range if the range is copied too. More...
 
void AdjustSheetLocalNameReferences (SCTAB nOldTab, SCTAB nNewTab)
 When copying a sheet-local named expression, move sheet references that point to the originating sheet to point to the new sheet instead. More...
 
bool ReferencesSheet (SCTAB nTab, SCTAB nPosTab) const
 Returns true if the sheet nTab is referenced in code. More...
 
sc::RefUpdateResult AdjustReferenceOnShift (const sc::RefUpdateContext &rCxt, const ScAddress &rOldPos)
 Adjust all references in response to shifting of cells during cell insertion and deletion. More...
 
sc::RefUpdateResult AdjustReferenceOnMove (const sc::RefUpdateContext &rCxt, const ScAddress &rOldPos, const ScAddress &rNewPos)
 
void MoveReferenceColReorder (const ScAddress &rPos, SCTAB nTab, SCROW nRow1, SCROW nRow2, const sc::ColRowReorderMapType &rColMap)
 Move reference positions in response to column reordering. More...
 
void MoveReferenceRowReorder (const ScAddress &rPos, SCTAB nTab, SCCOL nCol1, SCCOL nCol2, const sc::ColRowReorderMapType &rRowMap)
 
sc::RefUpdateResult AdjustReferenceInName (const sc::RefUpdateContext &rCxt, const ScAddress &rPos)
 Adjust all references in named expression. More...
 
sc::RefUpdateResult AdjustReferenceInMovedName (const sc::RefUpdateContext &rCxt, const ScAddress &rPos)
 
sc::RefUpdateResult AdjustReferenceOnDeletedTab (const sc::RefUpdateDeleteTabContext &rCxt, const ScAddress &rOldPos)
 Adjust all references on sheet deletion. More...
 
sc::RefUpdateResult AdjustReferenceOnInsertedTab (const sc::RefUpdateInsertTabContext &rCxt, const ScAddress &rOldPos)
 
sc::RefUpdateResult AdjustReferenceOnMovedTab (const sc::RefUpdateMoveTabContext &rCxt, const ScAddress &rOldPos)
 
void AdjustReferenceOnMovedOrigin (const ScAddress &rOldPos, const ScAddress &rNewPos)
 Adjust all internal references on base position change. More...
 
void AdjustReferenceOnMovedOriginIfOtherSheet (const ScAddress &rOldPos, const ScAddress &rNewPos)
 Adjust all internal references on base position change if they point to a sheet other than the one of rOldPos. More...
 
void AdjustReferenceOnCopy (const ScAddress &rNewPos)
 Adjust internal range references on base position change to justify / put in order the relative references. More...
 
void ClearTabDeleted (const ScAddress &rPos, SCTAB nStartTab, SCTAB nEndTab)
 Clear sheet deleted flag from internal reference tokens if the sheet index falls within specified range. More...
 
void CheckRelativeReferenceBounds (const sc::RefUpdateContext &rCxt, const ScAddress &rPos, SCROW nGroupLen, std::vector< SCROW > &rBounds) const
 
void CheckRelativeReferenceBounds (const ScAddress &rPos, SCROW nGroupLen, const ScRange &rRange, std::vector< SCROW > &rBounds) const
 
void CheckExpandReferenceBounds (const sc::RefUpdateContext &rCxt, const ScAddress &rPos, SCROW nGroupLen, std::vector< SCROW > &rBounds) const
 
OUString CreateString (sc::TokenStringContext &rCxt, const ScAddress &rPos) const
 Create a string representation of formula token array without modifying the internal state of the token array. More...
 
void WrapReference (const ScAddress &rPos, SCCOL nMaxCol, SCROW nMaxRow)
 
sal_Int32 GetWeight () const
 
bool IsEnabledForOpenCL () const
 
bool IsEnabledForThreading () const
 
- Public Member Functions inherited from formula::FormulaTokenArray
FormulaTokenReplaceToken (sal_uInt16 nOffset, FormulaToken *, ReplaceMode eMode)
 
sal_uInt16 RemoveToken (sal_uInt16 nOffset, sal_uInt16 nCount)
 
 FormulaTokenArray ()
 
 FormulaTokenArray (const FormulaTokenArray &)
 
 FormulaTokenArray (FormulaTokenArray &&)
 
virtual ~FormulaTokenArray ()
 
virtual void Clear ()
 
void Finalize ()
 
void SetFromRangeName (bool b)
 
bool IsFromRangeName () const
 
void SetShareable (bool b)
 
bool IsShareable () const
 
void DelRPN ()
 
FormulaTokenFirstToken () const
 
FormulaTokenTokenAt (sal_uInt16 nIdx) const
 
FormulaTokenPeekPrev (sal_uInt16 &nIdx) const
 
OpCode OpCodeBefore (sal_uInt16 nIdx) const
 
FormulaTokenFirstRPNToken () const
 
FormulaTokenLastRPNToken () const
 
bool HasReferences () const
 
bool HasExternalRef () const
 
bool HasOpCode (OpCode) const
 
bool HasOpCodeRPN (OpCode) const
 
bool HasNameOrColRowName () const
 
bool HasOpCodes (const unordered_opcode_set &rOpCodes) const
 
void CreateNewRPNArrayFromData (FormulaToken **pData, sal_uInt16 nSize)
 
FormulaToken ** GetArray () const
 
FormulaTokenArrayStandardRange Tokens () const
 
FormulaToken ** GetCode () const
 
FormulaTokenArrayStandardRange RPNTokens () const
 
FormulaTokenArrayReferencesRange References () const
 
sal_uInt16 GetLen () const
 
sal_uInt16 GetCodeLen () const
 
FormulaError GetCodeError () const
 
void SetCodeError (FormulaError n)
 
void SetHyperLink (bool bVal)
 
bool IsHyperLink () const
 
ScRecalcMode GetRecalcMode () const
 
void SetCombinedBitsRecalcMode (ScRecalcMode nBits)
 
ScRecalcMode GetCombinedBitsRecalcMode () const
 
void SetMaskedRecalcMode (ScRecalcMode nBits)
 
void AddRecalcMode (ScRecalcMode nBits)
 
void ClearRecalcMode ()
 
void SetExclusiveRecalcModeNormal ()
 
void SetExclusiveRecalcModeAlways ()
 
void SetRecalcModeForced ()
 
void SetRecalcModeOnRefMove ()
 
bool IsRecalcModeNormal () const
 
bool IsRecalcModeAlways () const
 
bool IsRecalcModeForced () const
 
bool IsRecalcModeOnRefMove () const
 
bool IsRecalcModeMustAfterImport () const
 
void ClearRecalcModeMustAfterImport ()
 
OpCode GetOuterFuncOpCode () const
 
bool HasMatrixDoubleRefOps () const
 
virtual FormulaTokenAddOpCode (OpCode e)
 
virtual bool AddFormulaToken (const css::sheet::FormulaToken &rToken, svl::SharedStringPool &rSPool, ExternalReferenceHelper *pExtRef)
 
bool Fill (const css::uno::Sequence< css::sheet::FormulaToken > &rSequence, svl::SharedStringPool &rSPool, ExternalReferenceHelper *pExtRef)
 
virtual void CheckToken (const FormulaToken &t)
 
void CheckAllRPNTokens ()
 
FormulaTokenAddToken (const FormulaToken &)
 
FormulaTokenAddString (const svl::SharedString &rStr)
 
FormulaTokenAddDouble (double fVal)
 
void AddExternal (const sal_Unicode *pStr)
 
FormulaTokenAddExternal (const OUString &rStr, OpCode eOp=ocExternal)
 
FormulaTokenAddBad (const OUString &rStr)
 
FormulaTokenAddStringXML (const OUString &rStr)
 
virtual FormulaTokenMergeArray ()
 
FormulaTokenArrayoperator= (const FormulaTokenArray &)
 
FormulaTokenArrayoperator= (FormulaTokenArray &&)
 
bool NeedsPodfRewrite (const MissingConventionODF &rConv)
 
bool NeedsOoxmlRewrite ()
 
FormulaTokenArrayRewriteMissing (const MissingConvention &rConv)
 
bool MayReferenceFollow ()
 
void ReinternStrings (svl::SharedStringPool &rPool)
 

Private Member Functions

bool ImplGetReference (ScRange &rRange, const ScAddress &rPos, bool bValidOnly) const
 
void CheckForThreading (const formula::FormulaToken &r)
 

Private Attributes

rtl::Reference< ScSheetLimitsmxSheetLimits
 
size_t mnHashValue
 
ScFormulaVectorState meVectorState: 4
 
bool mbOpenCLEnabled: 1
 
bool mbThreadingEnabled: 1
 

Friends

class ScCompiler
 

Additional Inherited Members

- Public Types inherited from formula::FormulaTokenArray
enum  ReplaceMode
 
- Public Attributes inherited from formula::FormulaTokenArray
 CODE_ONLY
 
 CODE_AND_RPN
 
- Protected Member Functions inherited from formula::FormulaTokenArray
void Assign (const FormulaTokenArray &)
 
void Assign (sal_uInt16 nCode, FormulaToken **pTokens)
 
void Move (FormulaTokenArray &&)
 
FormulaTokenAdd (FormulaToken *)
 
- Protected Attributes inherited from formula::FormulaTokenArray
std::unique_ptr< FormulaToken *[]> pCode
 
FormulaToken ** pRPN
 
sal_uInt16 nLen
 
sal_uInt16 nRPN
 
FormulaError nError
 
ScRecalcMode nMode
 
bool bHyperLink
 
bool mbFromRangeName
 
bool mbShareable
 
bool mbFinalized
 

Detailed Description

Definition at line 48 of file tokenarray.hxx.

Constructor & Destructor Documentation

◆ ScTokenArray() [1/4]

ScTokenArray::ScTokenArray ( const ScDocument rDoc)

Definition at line 1867 of file token.cxx.

References ResetVectorState().

Referenced by Clone().

◆ ScTokenArray() [2/4]

ScTokenArray::ScTokenArray ( ScSheetLimits rLimits)

Definition at line 1874 of file token.cxx.

References ResetVectorState().

◆ ScTokenArray() [3/4]

ScTokenArray::ScTokenArray ( const ScTokenArray )
default

Assignment with incrementing references of FormulaToken entries (not copied!)

◆ ScTokenArray() [4/4]

ScTokenArray::ScTokenArray ( ScTokenArray &&  )
default

References Clone().

◆ ~ScTokenArray()

ScTokenArray::~ScTokenArray ( )
overridevirtual

Definition at line 1881 of file token.cxx.

Member Function Documentation

◆ AddColRowName()

FormulaToken * ScTokenArray::AddColRowName ( const ScSingleRefData rRef)

ScSingleRefOpToken with ocColRowName.

Definition at line 2319 of file token.cxx.

References formula::FormulaTokenArray::Add(), mxSheetLimits, and ocColRowName.

Referenced by AddFormulaToken(), and TokenPool::GetElement().

◆ AddDBRange()

FormulaToken * ScTokenArray::AddDBRange ( sal_uInt16  n)

Definition at line 2297 of file token.cxx.

References formula::FormulaTokenArray::Add(), n, and ocDBArea.

Referenced by AddFormulaToken().

◆ AddDoubleReference()

FormulaToken * ScTokenArray::AddDoubleReference ( const ScComplexRefData rRef)

◆ AddExternalDoubleReference()

FormulaToken * ScTokenArray::AddExternalDoubleReference ( sal_uInt16  nFileId,
const svl::SharedString rTabName,
const ScComplexRefData rRef 
)

Definition at line 2313 of file token.cxx.

References formula::FormulaTokenArray::Add().

Referenced by AddFormulaToken(), and TokenPool::GetElement().

◆ AddExternalName()

FormulaToken * ScTokenArray::AddExternalName ( sal_uInt16  nFileId,
const svl::SharedString rName 
)

Definition at line 2302 of file token.cxx.

References formula::FormulaTokenArray::Add().

Referenced by AddFormulaToken(), and TokenPool::GetElement().

◆ AddExternalSingleReference()

void ScTokenArray::AddExternalSingleReference ( sal_uInt16  nFileId,
const svl::SharedString rTabName,
const ScSingleRefData rRef 
)

◆ AddFormulaToken()

bool ScTokenArray::AddFormulaToken ( const css::sheet::FormulaToken &  rToken,
svl::SharedStringPool rSPool,
formula::ExternalReferenceHelper _pRef 
)
overridevirtual

◆ AddMatrix()

FormulaToken * ScTokenArray::AddMatrix ( const ScMatrixRef p)

Definition at line 2287 of file token.cxx.

References formula::FormulaTokenArray::Add(), and p.

Referenced by AddFormulaToken(), TokenPool::GetElement(), and MergeArray().

◆ AddMatrixSingleReference()

FormulaToken * ScTokenArray::AddMatrixSingleReference ( const ScSingleRefData rRef)

ScSingleRefOpToken with ocMatRef.

Definition at line 2277 of file token.cxx.

References formula::FormulaTokenArray::Add(), mxSheetLimits, and ocMatRef.

◆ AddOpCode()

FormulaToken * ScTokenArray::AddOpCode ( OpCode  eCode)
overridevirtual

◆ AddRangeName()

void ScTokenArray::AddRangeName ( sal_uInt16  n,
sal_Int16  nSheet 
)

Definition at line 2292 of file token.cxx.

References formula::FormulaTokenArray::Add(), n, and ocName.

Referenced by AddFormulaToken(), and TokenPool::GetElement().

◆ AddRawToken()

FormulaToken * ScTokenArray::AddRawToken ( const ScRawToken r)

◆ AddSingleReference()

FormulaToken * ScTokenArray::AddSingleReference ( const ScSingleRefData rRef)

◆ AdjustAbsoluteRefs()

void ScTokenArray::AdjustAbsoluteRefs ( const ScDocument rOldDoc,
const ScAddress rOldPos,
const ScAddress rNewPos,
bool  bCheckCopyArea 
)

Make all absolute references pointing to the copied range if the range is copied too.

Parameters
bCheckCopyAreashould reference pointing into the copy area be adjusted independently from being absolute, should be true only for copy&paste between documents

Definition at line 2597 of file token.cxx.

References formula::FormulaTokenArray::nLen, formula::FormulaTokenArray::nRPN, p, formula::FormulaTokenArray::pCode, formula::FormulaTokenArray::pRPN, ScComplexRefData::Ref1, ScComplexRefData::Ref2, svDoubleRef, and svSingleRef.

Referenced by ScFormulaCell::ScFormulaCell().

◆ AdjustReferenceInMovedName()

sc::RefUpdateResult ScTokenArray::AdjustReferenceInMovedName ( const sc::RefUpdateContext rCxt,
const ScAddress rPos 
)

◆ AdjustReferenceInName()

sc::RefUpdateResult ScTokenArray::AdjustReferenceInName ( const sc::RefUpdateContext rCxt,
const ScAddress rPos 
)

◆ AdjustReferenceOnCopy()

void ScTokenArray::AdjustReferenceOnCopy ( const ScAddress rNewPos)

Adjust internal range references on base position change to justify / put in order the relative references.

Definition at line 4581 of file token.cxx.

References formula::FormulaTokenArray::nLen, formula::FormulaTokenArray::nRPN, p, formula::FormulaTokenArray::pCode, formula::FormulaTokenArray::pRPN, ScComplexRefData::PutInOrder(), and svDoubleRef.

Referenced by ScFormulaCell::ScFormulaCell().

◆ AdjustReferenceOnDeletedTab()

sc::RefUpdateResult ScTokenArray::AdjustReferenceOnDeletedTab ( const sc::RefUpdateDeleteTabContext rCxt,
const ScAddress rOldPos 
)

Adjust all references on sheet deletion.

Parameters
nDelPosposition of sheet being deleted.
nSheetsnumber of sheets to delete.
rOldPosposition of formula cell prior to the deletion.
Returns
true if at least one reference has changed its sheet reference.

Definition at line 4255 of file token.cxx.

References sc::RefUpdateDeleteTabContext::maUpdatedNames, sc::RefUpdateResult::mbNameModified, sc::RefUpdateResult::mbReferenceModified, sc::RefUpdateDeleteTabContext::mnDeletePos, sc::RefUpdateDeleteTabContext::mnSheets, sc::RefUpdateDeleteTabContext::mrDoc, mxSheetLimits, formula::FormulaTokenArray::nLen, formula::FormulaTokenArray::nRPN, ocDBArea, ocName, ocTableRef, p, formula::FormulaTokenArray::pCode, formula::FormulaTokenArray::pRPN, SCTAB_MAX, svDoubleRef, svIndex, svSingleRef, and ScRangeUpdater::UpdateDeleteTab().

Referenced by ScFormulaCell::UpdateDeleteTab().

◆ AdjustReferenceOnInsertedTab()

sc::RefUpdateResult ScTokenArray::AdjustReferenceOnInsertedTab ( const sc::RefUpdateInsertTabContext rCxt,
const ScAddress rOldPos 
)

◆ AdjustReferenceOnMove()

sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove ( const sc::RefUpdateContext rCxt,
const ScAddress rOldPos,
const ScAddress rNewPos 
)

◆ AdjustReferenceOnMovedOrigin()

void ScTokenArray::AdjustReferenceOnMovedOrigin ( const ScAddress rOldPos,
const ScAddress rNewPos 
)

◆ AdjustReferenceOnMovedOriginIfOtherSheet()

void ScTokenArray::AdjustReferenceOnMovedOriginIfOtherSheet ( const ScAddress rOldPos,
const ScAddress rNewPos 
)

◆ AdjustReferenceOnMovedTab()

sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMovedTab ( const sc::RefUpdateMoveTabContext rCxt,
const ScAddress rOldPos 
)

◆ AdjustReferenceOnShift()

sc::RefUpdateResult ScTokenArray::AdjustReferenceOnShift ( const sc::RefUpdateContext rCxt,
const ScAddress rOldPos 
)

◆ AdjustSheetLocalNameReferences()

void ScTokenArray::AdjustSheetLocalNameReferences ( SCTAB  nOldTab,
SCTAB  nNewTab 
)

When copying a sheet-local named expression, move sheet references that point to the originating sheet to point to the new sheet instead.

Definition at line 2645 of file token.cxx.

References ScSingleRefData::IsTabRel(), formula::FormulaTokenArray::nLen, formula::FormulaTokenArray::nRPN, p, formula::FormulaTokenArray::pCode, formula::FormulaTokenArray::pRPN, ScComplexRefData::Ref1, ScComplexRefData::Ref2, ScSingleRefData::SetAbsTab(), svDoubleRef, svSingleRef, and ScSingleRefData::Tab().

◆ AssignXMLString()

void ScTokenArray::AssignXMLString ( const OUString &  rText,
const OUString &  rFormulaNmsp 
)

Assign XML string placeholder to the array.

Definition at line 2324 of file token.cxx.

References formula::FormulaTokenArray::Assign(), and ocStringXML.

Referenced by ScMyTables::AddMatrixRange(), and ScDocFunc::EnterMatrix().

◆ CheckExpandReferenceBounds()

void ScTokenArray::CheckExpandReferenceBounds ( const sc::RefUpdateContext rCxt,
const ScAddress rPos,
SCROW  nGroupLen,
std::vector< SCROW > &  rBounds 
) const

◆ CheckForThreading()

void ScTokenArray::CheckForThreading ( const formula::FormulaToken r)
private

◆ CheckRelativeReferenceBounds() [1/2]

void ScTokenArray::CheckRelativeReferenceBounds ( const sc::RefUpdateContext rCxt,
const ScAddress rPos,
SCROW  nGroupLen,
std::vector< SCROW > &  rBounds 
) const

◆ CheckRelativeReferenceBounds() [2/2]

void ScTokenArray::CheckRelativeReferenceBounds ( const ScAddress rPos,
SCROW  nGroupLen,
const ScRange rRange,
std::vector< SCROW > &  rBounds 
) const

◆ CheckToken()

void ScTokenArray::CheckToken ( const formula::FormulaToken r)
overridevirtual

Reimplemented from formula::FormulaTokenArray.

Definition at line 1355 of file token.cxx.

References CheckForThreading(), FormulaVectorCheckReference, FormulaVectorDisabledByOpCode, FormulaVectorDisabledByStackVariable, FormulaVectorDisabledNotInSubSet, ScInterpreter::GetGlobalConfig(), formula::FormulaToken::GetOpCode(), formula::FormulaToken::GetType(), IsFormulaVectorDisabled(), mbOpenCLEnabled, mbThreadingEnabled, meVectorState, ScCalcConfig::mpOpenCLSubsetOpCodes, ocAbs, ocAnd, ocArcCos, ocArcCosHyp, ocArcCot, ocArcCotHyp, ocArcSin, ocArcSinHyp, ocArcTan, ocArcTan2, ocArcTanHyp, ocArrayClose, ocArrayColSep, ocArrayOpen, ocArrayRowSep, ocAveDev, ocAverage, ocAverageA, ocAverageIf, ocAverageIfs, ocB, ocBad, ocBetaDist, ocBetaInv, ocBinomDist, ocBitAnd, ocBitLshift, ocBitOr, ocBitRshift, ocBitXor, ocCeil, ocChiDist, ocChiInv, ocChiSqDist, ocChiSqInv, ocChoose, ocClose, ocColRowName, ocColRowNameAuto, ocCombin, ocCombinA, ocConfidence, ocCorrel, ocCos, ocCosecant, ocCosecantHyp, ocCosHyp, ocCot, ocCotHyp, ocCount, ocCount2, ocCountIf, ocCountIfs, ocCovar, ocCritBinom, ocDB, ocDBArea, ocDBAverage, ocDBCount, ocDBCount2, ocDBMax, ocDBMin, ocDBProduct, ocDBStdDev, ocDBStdDevP, ocDBSum, ocDBVar, ocDBVarP, ocDDB, ocDeg, ocDevSq, ocErrDivZero, ocErrNA, ocErrName, ocErrNull, ocErrNum, ocErrRef, ocErrValue, ocEven, ocExp, ocExpDist, ocExternal, ocFact, ocFDist, ocFInv, ocFisher, ocFisherInv, ocFloor, ocForecast, ocFTest, ocFV, ocGamma, ocGammaDist, ocGammaInv, ocGammaLn, ocGauss, ocGeoMean, ocHarMean, ocHypGeomDist, ocIf, ocIfError, ocIfNA, ocInt, ocIntercept, ocIpmt, ocIRR, ocIsEven, ocIsOdd, ocISPMT, ocKurt, ocLn, ocLog, ocLog10, ocLogInv, ocLogNormDist, ocMax, ocMaxA, ocMedian, ocMin, ocMinA, ocMIRR, ocMissing, ocMod, ocName, ocNegBinomVert, ocNegSub, ocNormDist, ocNormInv, ocNot, ocNotAvail, ocNper, ocNPV, ocOdd, ocOpen, ocOr, ocPDuration, ocPearson, ocPercentSign, ocPermut, ocPermutationA, ocPhi, ocPi, ocPMT, ocPoissonDist, ocPower, ocPpmt, ocProduct, ocPush, ocPV, ocRad, ocRandom, ocRate, ocRound, ocRoundDown, ocRoundUp, ocRRI, ocRSQ, ocSecant, ocSecantHyp, ocSep, ocSin, ocSinHyp, ocSkew, ocSkewp, ocSkip, ocSLN, ocSlope, ocSNormInv, ocSpaces, ocSqrt, ocStandard, ocStDev, ocStDevA, ocStDevP, ocStDevPA, ocStdNormDist, ocSTEYX, ocStop, ocSum, ocSumIf, ocSumIfs, ocSumProduct, ocSumSQ, ocSumX2DY2, ocSumX2MY2, ocSumXMY2, ocSYD, ocTableRef, ocTan, ocTanHyp, ocTDist, ocTInv, ocTrunc, ocTTest, ocVar, ocVarA, ocVarP, ocVarPA, ocVBD, ocVLookup, ocWeibull, ocWhitespace, ocXor, ocZTest, SAL_INFO, SC_OPCODE_START_BIN_OP, SC_OPCODE_START_FUNCTION, SC_OPCODE_STOP_FUNCTION, SC_OPCODE_STOP_UN_OP, StackVarEnumToString(), svByte, svDouble, svDoubleRef, svEmptyCell, svError, svExternal, svExternalDoubleRef, svExternalName, svExternalSingleRef, svFAP, svHybridCell, svIndex, svJump, svJumpMatrix, svMatrix, svMatrixCell, svMissing, svRefList, svSep, svSingleRef, svString, and svUnknown.

◆ Clear()

void ScTokenArray::Clear ( )
overridevirtual

◆ ClearTabDeleted()

void ScTokenArray::ClearTabDeleted ( const ScAddress rPos,
SCTAB  nStartTab,
SCTAB  nEndTab 
)

Clear sheet deleted flag from internal reference tokens if the sheet index falls within specified range.

Note that when a reference is on a sheet that's been deleted, its referenced sheet index retains the original index of the deleted sheet.

Parameters
rPosposition of formula cell
nStartTabindex of first sheet, inclusive.
nEndTabindex of last sheet, inclusive.

Definition at line 4623 of file token.cxx.

References formula::FormulaToken::GetDoubleRef(), formula::FormulaToken::GetSingleRef(), mxSheetLimits, formula::FormulaTokenArray::nLen, p, formula::FormulaTokenArray::pCode, ScComplexRefData::Ref1, ScComplexRefData::Ref2, svDoubleRef, and svSingleRef.

◆ Clone()

std::unique_ptr< ScTokenArray > ScTokenArray::Clone ( ) const

◆ CloneValue()

ScTokenArray ScTokenArray::CloneValue ( ) const

◆ CreateString()

OUString ScTokenArray::CreateString ( sc::TokenStringContext rCxt,
const ScAddress rPos 
) const

◆ EqualTokens()

bool ScTokenArray::EqualTokens ( const ScTokenArray pArr2) const

◆ GenHash()

void ScTokenArray::GenHash ( )

◆ GetAdjacentExtendOfOuterFuncRefs()

bool ScTokenArray::GetAdjacentExtendOfOuterFuncRefs ( SCCOLROW nExtend,
const ScAddress rPos,
ScDirection  eDir 
)

◆ GetHash()

size_t ScTokenArray::GetHash ( ) const
inline

Definition at line 79 of file tokenarray.hxx.

Referenced by ScFormulaCell::GetHash().

◆ GetVectorState()

ScFormulaVectorState ScTokenArray::GetVectorState ( ) const
inline

◆ GetWeight()

sal_Int32 ScTokenArray::GetWeight ( ) const

◆ ImplGetReference()

bool ScTokenArray::ImplGetReference ( ScRange rRange,
const ScAddress rPos,
bool  bValidOnly 
) const
private

◆ IsEnabledForOpenCL()

bool ScTokenArray::IsEnabledForOpenCL ( ) const
inline

Definition at line 268 of file tokenarray.hxx.

Referenced by ScFormulaCell::InterpretFormulaGroupOpenCL().

◆ IsEnabledForThreading()

bool ScTokenArray::IsEnabledForThreading ( ) const
inline

◆ IsFormulaVectorDisabled()

bool ScTokenArray::IsFormulaVectorDisabled ( ) const

◆ IsInvariant()

bool ScTokenArray::IsInvariant ( ) const

If the array contains at least one relative row reference or named expression, it's variant.

Otherwise invariant.

Definition at line 1823 of file token.cxx.

References ScSingleRefData::IsRowRel(), formula::FormulaTokenArray::nLen, p, formula::FormulaTokenArray::pCode, ScComplexRefData::Ref1, ScComplexRefData::Ref2, svDoubleRef, svExternalDoubleRef, svExternalSingleRef, svIndex, and svSingleRef.

◆ IsReference()

bool ScTokenArray::IsReference ( ScRange rRange,
const ScAddress rPos 
) const

Exactly and only one range (valid or deleted)

Definition at line 1857 of file token.cxx.

References ImplGetReference().

◆ IsValidReference()

bool ScTokenArray::IsValidReference ( ScRange rRange,
const ScAddress rPos 
) const

Exactly and only one valid range (no #REF!s)

Definition at line 1862 of file token.cxx.

References ImplGetReference().

Referenced by ScValidationData::GetSelectionFromFormula().

◆ MergeArray()

FormulaToken * ScTokenArray::MergeArray ( )
overridevirtual

◆ MergeRangeReference()

void ScTokenArray::MergeRangeReference ( const ScAddress rPos)

Merge very last SingleRef+ocRange+SingleRef combination into DoubleRef and adjust pCode array, or do nothing if conditions not met.

Definition at line 2237 of file token.cxx.

References formula::FormulaToken::DecRef(), extendRangeReference(), formula::FormulaToken::GetOpCode(), mxSheetLimits, formula::FormulaTokenArray::nLen, ocRange, p, formula::FormulaTokenArray::pCode, and formula::FormulaTokenArray::PeekPrev().

◆ MoveReferenceColReorder()

void ScTokenArray::MoveReferenceColReorder ( const ScAddress rPos,
SCTAB  nTab,
SCROW  nRow1,
SCROW  nRow2,
const sc::ColRowReorderMapType rColMap 
)

Move reference positions in response to column reordering.

A range reference gets moved only when the whole range fits in a single column.

Parameters
rPosposition of this formula cell
nTabsheet where columns are reordered.
nRow1top row of reordered range.
nRow2bottom row of reordered range.
rColMapold-to-new column mapping.

Definition at line 3524 of file token.cxx.

References ScRange::aEnd, ScRange::aStart, ScAddress::Col(), sc::ColRowReorderMapType::end(), sc::ColRowReorderMapType::find(), mxSheetLimits, formula::FormulaTokenArray::nLen, formula::FormulaTokenArray::nRPN, p, formula::FormulaTokenArray::pCode, formula::FormulaTokenArray::pRPN, ScAddress::Row(), ScSingleRefData::SetAddress(), ScAddress::SetCol(), ScComplexRefData::SetRange(), svDoubleRef, svSingleRef, ScAddress::Tab(), ScSingleRefData::toAbs(), and ScComplexRefData::toAbs().

Referenced by ScFormulaCell::Notify().

◆ MoveReferenceRowReorder()

void ScTokenArray::MoveReferenceRowReorder ( const ScAddress rPos,
SCTAB  nTab,
SCCOL  nCol1,
SCCOL  nCol2,
const sc::ColRowReorderMapType rRowMap 
)

◆ operator=() [1/2]

ScTokenArray & ScTokenArray::operator= ( const ScTokenArray rArr)

Assignment with incrementing references of FormulaToken entries (not copied!)

Definition at line 1885 of file token.cxx.

References formula::FormulaTokenArray::Assign(), Clear(), mbOpenCLEnabled, mbThreadingEnabled, meVectorState, and mnHashValue.

◆ operator=() [2/2]

ScTokenArray & ScTokenArray::operator= ( ScTokenArray &&  rArr)

◆ ReadjustAbsolute3DReferences()

void ScTokenArray::ReadjustAbsolute3DReferences ( const ScDocument rOldDoc,
ScDocument rNewDoc,
const ScAddress rPos,
bool  bRangeName = false 
)

Make all absolute references external references pointing to the old document.

Parameters
rOldDocold document
rNewDocnew document
rPosposition of the cell to determine if the reference is in the copied area
bRangeNameset for range names, range names have special handling for absolute sheet ref + relative col/row ref

Definition at line 2545 of file token.cxx.

References formula::FormulaTokenArray::CODE_AND_RPN, ScDocument::GetSharedStringPool(), svl::SharedStringPool::intern(), ScSingleRefData::IsFlag3D(), ScSingleRefData::IsTabRel(), formula::FormulaTokenArray::nLen, formula::FormulaTokenArray::pCode, ScComplexRefData::Ref1, ScComplexRefData::Ref2, formula::FormulaTokenArray::ReplaceToken(), svDoubleRef, svSingleRef, and ScSingleRefData::Tab().

Referenced by ScFormulaCell::ScFormulaCell().

◆ ReferencesSheet()

bool ScTokenArray::ReferencesSheet ( SCTAB  nTab,
SCTAB  nPosTab 
) const

◆ ResetVectorState()

void ScTokenArray::ResetVectorState ( )

◆ WrapReference()

void ScTokenArray::WrapReference ( const ScAddress rPos,
SCCOL  nMaxCol,
SCROW  nMaxRow 
)

Friends And Related Function Documentation

◆ ScCompiler

friend class ScCompiler
friend

Definition at line 50 of file tokenarray.hxx.

Member Data Documentation

◆ mbOpenCLEnabled

bool ScTokenArray::mbOpenCLEnabled
private

Definition at line 58 of file tokenarray.hxx.

Referenced by CheckToken(), Clone(), CloneValue(), operator=(), and ResetVectorState().

◆ mbThreadingEnabled

bool ScTokenArray::mbThreadingEnabled
private

◆ meVectorState

ScFormulaVectorState ScTokenArray::meVectorState
private

◆ mnHashValue

size_t ScTokenArray::mnHashValue
private

Definition at line 56 of file tokenarray.hxx.

Referenced by Clear(), Clone(), CloneValue(), GenHash(), and operator=().

◆ mxSheetLimits

rtl::Reference<ScSheetLimits> ScTokenArray::mxSheetLimits
private

The documentation for this class was generated from the following files: