summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-01-05 22:26:45 +0100
committerEike Rathke <erack@redhat.com>2016-01-05 23:42:07 +0100
commit4ae7b66286f391839b0d8d6c5a73ee7849eb4d1f (patch)
treec28933b70a8c5bcf62d93a6e5feaa86d62183a5c /formula
parentd7e0d0135ba65243fab5ee038c21290b8e74e548 (diff)
use new'ed FormulaToken and FormulaTokenArray::Add()
... instead of a temporary instance and AddToken() that just clones it again. Add function comment describing the difference. Change-Id: I3f089965d394b33d7bbbb9a1c3f69dc1c4182fd2
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/token.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index c16f3cad4332..3668b4df73bd 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -395,11 +395,11 @@ bool FormulaTokenArray::AddFormulaToken(
// long is svIndex, used for name / database area, or "byte" for spaces
sal_Int32 nValue = rToken.Data.get<sal_Int32>();
if ( eOpCode == ocDBArea )
- AddToken( formula::FormulaIndexToken( eOpCode, static_cast<sal_uInt16>(nValue) ) );
+ Add( new formula::FormulaIndexToken( eOpCode, static_cast<sal_uInt16>(nValue) ) );
else if ( eOpCode == ocTableRef )
bError = true; /* TODO: implementation */
else if ( eOpCode == ocSpaces )
- AddToken( formula::FormulaByteToken( ocSpaces, static_cast<sal_uInt8>(nValue) ) );
+ Add( new formula::FormulaByteToken( ocSpaces, static_cast<sal_uInt8>(nValue) ) );
else
bError = true;
}
@@ -414,7 +414,7 @@ bool FormulaTokenArray::AddFormulaToken(
else if ( eOpCode == ocStringXML )
AddStringXML( aStrVal );
else if ( eOpCode == ocExternal || eOpCode == ocMacro )
- AddToken( formula::FormulaExternalToken( eOpCode, aStrVal ) );
+ Add( new formula::FormulaExternalToken( eOpCode, aStrVal ) );
else
bError = true; // unexpected string: don't know what to do with it
}
@@ -1600,7 +1600,7 @@ FormulaToken* FormulaTokenArray::AddOpCode( OpCode eOp )
pRet = new FormulaByteToken( eOp, 0, false );
break;
}
- return AddToken( *pRet );
+ return Add( pRet );
}
void FormulaTokenArray::ReinternStrings( svl::SharedStringPool& rPool )