Kaydet (Commit) 40c9a46b authored tarafından Eike Rathke's avatar Eike Rathke

add FormulaTokenArray::ReplaceToken()

Change-Id: I42c893677c1b8a35ee502a9ae438d4c0f19867d3
üst bc4293bd
......@@ -849,6 +849,24 @@ FormulaToken* FormulaTokenArray::MergeArray( )
return NULL;
}
FormulaToken* FormulaTokenArray::ReplaceToken( sal_uInt16 nOffset, FormulaToken* t )
{
if (nOffset < nLen)
{
CheckToken(*t);
sal_uInt16 nPos = nLen - nOffset - 1;
t->IncRef();
pCode[nPos]->DecRef();
pCode[nPos] = t;
return t;
}
else
{
t->Delete();
return NULL;
}
}
FormulaToken* FormulaTokenArray::Add( FormulaToken* t )
{
if( !pCode )
......
......@@ -115,6 +115,10 @@ protected:
/// Also used by the compiler. The token MUST had been allocated with new!
FormulaToken* Add( FormulaToken* );
/** Also used by the compiler. The token MUST had been allocated with new!
@param nOffset negative offset of token, 0==last, 1==previous, ...
*/
FormulaToken* ReplaceToken( sal_uInt16 nOffset, FormulaToken* );
inline void SetCombinedBitsRecalcMode( ScRecalcMode nBits )
{ nMode |= (nBits & ~RECALCMODE_EMASK); }
inline ScRecalcMode GetCombinedBitsRecalcMode() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment