summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-09-28 15:56:04 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-09-28 15:56:04 +0200
commitee9b3c1f1cb7445f0a7e76736e32fe81878f8d00 (patch)
tree4c6baa8f301db8ac4cc90e2cd93e6a4f9cbfff01 /sc/qa/unit/ucalc.cxx
parent36739d33d3dfee4bc95b546bc297015f7cb6ca00 (diff)
Return the std::unique_ptr itself here, not a raw pointer
Change-Id: I8f649229ffce60de16e6b4611b1c081811cef225
Diffstat (limited to 'sc/qa/unit/ucalc.cxx')
-rw-r--r--sc/qa/unit/ucalc.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b5264dbd5196..469abc276288 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -87,7 +87,9 @@
#include <sfx2/docfile.hxx>
#include <iostream>
+#include <memory>
#include <sstream>
+#include <utility>
#include <vector>
#include <com/sun/star/i18n/TransliterationModules.hpp>
@@ -6212,10 +6214,10 @@ void Test::testDeleteContents()
aMark.SelectOneTable(0);
aMark.SetMarkArea(aRange);
- ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
+ std::unique_ptr<ScDocument> pUndoDoc(new ScDocument(SCDOCMODE_UNDO));
pUndoDoc->InitUndo(m_pDoc, 0, 0);
- m_pDoc->CopyToDocument(aRange, IDF_CONTENTS, false, pUndoDoc, &aMark);
- ScUndoDeleteContents aUndo(&getDocShell(), aMark, aRange, pUndoDoc, false, IDF_CONTENTS, true);
+ m_pDoc->CopyToDocument(aRange, IDF_CONTENTS, false, pUndoDoc.get(), &aMark);
+ ScUndoDeleteContents aUndo(&getDocShell(), aMark, aRange, std::move(pUndoDoc), false, IDF_CONTENTS, true);
clearRange(m_pDoc, aRange);
CPPUNIT_ASSERT_EQUAL(3.0, m_pDoc->GetValue(ScAddress(3,15,0))); // formula