Kaydet (Commit) 326fc28c authored tarafından Markus Mohrhard's avatar Markus Mohrhard

let us use scoped_ptr when possible

Change-Id: Ia8199bdc63ee732bada51687df195c9ab9cae9aa
üst f41c3e50
...@@ -1308,7 +1308,7 @@ static String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScA ...@@ -1308,7 +1308,7 @@ static String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScA
if (rFormula.Len()) if (rFormula.Len())
{ {
ScFormulaCell* pCell = new ScFormulaCell( pDoc, rPos, rFormula ); boost::scoped_ptr<ScFormulaCell> pCell(new ScFormulaCell( pDoc, rPos, rFormula ));
// HACK! um bei ColRowNames kein #REF! zu bekommen, // HACK! um bei ColRowNames kein #REF! zu bekommen,
// wenn ein Name eigentlich als Bereich in die Gesamt-Formel // wenn ein Name eigentlich als Bereich in die Gesamt-Formel
...@@ -1325,8 +1325,7 @@ static String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScA ...@@ -1325,8 +1325,7 @@ static String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScA
aBraced.append('('); aBraced.append('(');
aBraced.append(rFormula); aBraced.append(rFormula);
aBraced.append(')'); aBraced.append(')');
delete pCell; pCell.reset(new ScFormulaCell( pDoc, rPos, aBraced.makeStringAndClear() ));
pCell = new ScFormulaCell( pDoc, rPos, aBraced.makeStringAndClear() );
} }
else else
bColRowName = false; bColRowName = false;
...@@ -1370,7 +1369,6 @@ static String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScA ...@@ -1370,7 +1369,6 @@ static String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScA
} }
else else
aValue = ScGlobal::GetErrorString(nErrCode); aValue = ScGlobal::GetErrorString(nErrCode);
delete pCell;
} }
return aValue; return aValue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment