summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorEike Rathke <erack@erack.de>2011-08-26 02:40:40 +0200
committerEike Rathke <erack@erack.de>2011-08-26 13:34:58 +0200
commit0e735d61b2601392c2054188166b055bdc061d43 (patch)
tree20118097ab1d164dc7b4356c995800cb497eabb5 /formula
parent319fcca010ceca3eacfd93e8768ae75008750127 (diff)
ensureCapacity on OUStringBuffer
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 346c8e3bd235..e1122c22b0fd 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1569,7 +1569,7 @@ void FormulaCompiler::CreateStringFromTokenArray( String& rFormula )
{
rtl::OUStringBuffer aBuffer( pArr->GetLen() * 5 );
CreateStringFromTokenArray( aBuffer );
- rFormula = aBuffer;
+ rFormula = aBuffer.makeStringAndClear();
}
void FormulaCompiler::CreateStringFromTokenArray( rtl::OUStringBuffer& rBuffer )
@@ -1578,6 +1578,8 @@ void FormulaCompiler::CreateStringFromTokenArray( rtl::OUStringBuffer& rBuffer )
if( !pArr->GetLen() )
return;
+ rBuffer.ensureCapacity( pArr->GetLen() * 5 );
+
FormulaTokenArray* pSaveArr = pArr;
bool bODFF = FormulaGrammar::isODFF( meGrammar);
if (bODFF || FormulaGrammar::isPODF( meGrammar) )