From 4ae7b66286f391839b0d8d6c5a73ee7849eb4d1f Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 5 Jan 2016 22:26:45 +0100 Subject: 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 --- include/formula/tokenarray.hxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/formula') diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index 292b3182cb8b..bf3056a392b3 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -296,7 +296,12 @@ public: */ virtual void CheckToken( const FormulaToken& t ); + /** Clones the token and then adds the clone to the pCode array. + For just new'ed tokens use Add() instead of cloning it again. + Use this AddToken() when adding a token from another origin. + */ FormulaToken* AddToken( const FormulaToken& ); + FormulaToken* AddString( const svl::SharedString& rStr ); FormulaToken* AddDouble( double fVal ); FormulaToken* AddExternal( const sal_Unicode* pStr ); -- cgit