summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-14 08:57:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-08-14 13:36:25 +0200
commit6d5a82f04d73f52efc9cb9a81c15087f06f35b5c (patch)
treea6380351bdbf419c258b7f714042999ee39971d9 /sc
parentc86e4ad53391d17d1eb54845b5999889f7e65061 (diff)
use std::unique_ptr
Change-Id: Ib76d6a82037e36a41cebdf86af9754a51aab213c Reviewed-on: https://gerrit.libreoffice.org/58968 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/impex.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index b28d7522a746..bcb2c39f2720 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1930,22 +1930,21 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
* better GRAM_ENGLISH_XL_R1C1. */
const formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_PODF_A1;
ScCompiler aComp( pDoc, aPos, eGrammar);
- ScTokenArray* pCode = aComp.CompileString( aText );
- pDoc->CheckLinkFormulaNeedingCheck( *pCode);
+ std::unique_ptr<ScTokenArray> xCode(aComp.CompileString(aText)); // ctor/InsertMatrixFormula did copy TokenArray
+ pDoc->CheckLinkFormulaNeedingCheck(*xCode);
if ( ch == 'M' )
{
ScMarkData aMark;
aMark.SelectTable( aPos.Tab(), true );
pDoc->InsertMatrixFormula( nCol, nRow, nRefCol,
- nRefRow, aMark, EMPTY_OUSTRING, pCode );
+ nRefRow, aMark, EMPTY_OUSTRING, xCode.get() );
}
else
{
ScFormulaCell* pFCell = new ScFormulaCell(
- pDoc, aPos, *pCode, eGrammar, ScMatrixMode::NONE);
+ pDoc, aPos, *xCode, eGrammar, ScMatrixMode::NONE);
pDoc->SetFormulaCell(aPos, pFCell);
}
- delete pCode; // ctor/InsertMatrixFormula did copy TokenArray
}
break;
}