summaryrefslogtreecommitdiff
path: root/formula/source/core/api/token.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'formula/source/core/api/token.cxx')
-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 c5d7da7ee28c..30b0e162d97c 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -687,6 +687,24 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r )
}
}
+/// Optimisiation for efficiently creating StringXML placeholders
+void FormulaTokenArray::Assign( sal_uInt16 nCode, FormulaToken **pTokens )
+{
+ assert( nLen = 0 );
+ assert( pCode == NULL );
+
+ nLen = nCode;
+ pCode = new FormulaToken*[ nLen ];
+
+ for( sal_uInt16 i = 0; i < nLen; i++ )
+ {
+ FormulaToken *t = pTokens[ i ];
+ assert( t->GetOpCode() == ocStringXML );
+ pCode[ i ] = t;
+ t->IncRef();
+ }
+}
+
FormulaTokenArray& FormulaTokenArray::operator=( const FormulaTokenArray& rArr )
{
Clear();