summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-03-11 09:46:19 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-03-12 13:42:38 +0000
commitbaa938b44d1067f81a9dad772e1d15eb48fd12e6 (patch)
treef91bed8827e8a180d8b0950ba329060e30387346 /sc/qa/unit/ucalc.cxx
parent91831f3af171673b67b095ecb70c607bbfca1300 (diff)
fix memory leak in ucalc
Change-Id: Iad38472638438eb52e9e46be0a284adbb8ccb689 Reviewed-on: https://gerrit.libreoffice.org/23169 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/qa/unit/ucalc.cxx')
-rw-r--r--sc/qa/unit/ucalc.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 4e021653091b..d97e92f17d33 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -3441,15 +3441,14 @@ void Test::testCopyPasteTranspose()
ScDocument aNewClipDoc(SCDOCMODE_CLIP);
copyToClip(m_pDoc, aSrcRange, &aNewClipDoc);
- ::std::unique_ptr<ScDocument> pTransClip;
- pTransClip.reset(new ScDocument(SCDOCMODE_CLIP));
+ ::std::unique_ptr<ScDocument> pTransClip(new ScDocument(SCDOCMODE_CLIP));
aNewClipDoc.TransposeClip(pTransClip.get(), InsertDeleteFlags::ALL, false);
- ScDocument* pTransposedClip = pTransClip.release();
ScRange aDestRange = ScRange(3,1,1,3,3,1);//target: Sheet2.D2:D4
ScMarkData aMark;
aMark.SetMarkArea(aDestRange);
- m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::ALL, nullptr, pTransposedClip);
+ m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::ALL, nullptr, pTransClip.get());
+ pTransClip.reset();
//check cell content after transposed copy/paste
OUString aString = m_pDoc->GetString(3, 3, 1);