summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-03-06 22:39:53 +0100
committerEike Rathke <erack@redhat.com>2015-03-07 00:24:45 +0100
commit40c9a46b78b8919aae82dd9b94774d63bb9cb4e6 (patch)
treefbc51a26cea27cb11193433bf2c73043bc4b7a57 /formula
parentbc4293bde13001a5e959ff90c189111932c05b3b (diff)
add FormulaTokenArray::ReplaceToken()
Change-Id: I42c893677c1b8a35ee502a9ae438d4c0f19867d3
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/token.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index 567c12cb8350..117f276fb6c4 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -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 )