summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-08-21 21:11:41 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-08-21 21:58:56 +0100
commit264466bd604d7613aa0a5e4b34c149ad66414580 (patch)
tree05e634ebb87dc610543ef62c6eb65241487266f5 /sc/qa/unit/ucalc.cxx
parentfdcec8131e6e2c5eb9df243c34f34f7742b975bc (diff)
coverity#1371453 try silence Wrapper object use after free
Change-Id: I707debb1dab694b3de2942e1c8b9a1bd7ec2d283
Diffstat (limited to 'sc/qa/unit/ucalc.cxx')
-rw-r--r--sc/qa/unit/ucalc.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index c61574cc0277..19c9460d0785 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -3419,7 +3419,7 @@ void Test::testCopyPasteSkipEmpty()
// Create undo document.
ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
pUndoDoc->InitUndo(m_pDoc, 0, 0);
- m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::ALL, false, pUndoDoc, &aMark);
+ m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::ALL, false, *pUndoDoc, &aMark);
// Paste clipboard content onto A1:A5 but skip empty cells.
bool bSkipEmpty = true;
@@ -3428,7 +3428,7 @@ void Test::testCopyPasteSkipEmpty()
// Create redo document.
ScDocument* pRedoDoc = new ScDocument(SCDOCMODE_UNDO);
pRedoDoc->InitUndo(m_pDoc, 0, 0);
- m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::ALL, false, pRedoDoc, &aMark);
+ m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::ALL, false, *pRedoDoc, &aMark);
// Create an undo object for this.
ScRefUndoData* pRefUndoData = new ScRefUndoData(m_pDoc);
@@ -3620,7 +3620,7 @@ void Test::testUndoCut()
// Set up an undo object for cutting A1:A3.
ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO);
pUndoDoc->InitUndo(m_pDoc, 0 ,0);
- m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL, false, pUndoDoc);
+ m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL, false, *pUndoDoc);
ASSERT_DOUBLES_EQUAL( 1.0, pUndoDoc->GetValue(ScAddress(0,0,0)));
ASSERT_DOUBLES_EQUAL( 10.0, pUndoDoc->GetValue(ScAddress(0,1,0)));
ASSERT_DOUBLES_EQUAL(100.0, pUndoDoc->GetValue(ScAddress(0,2,0)));
@@ -5427,7 +5427,7 @@ void Test::testDeleteContents()
std::unique_ptr<ScDocument> pUndoDoc(new ScDocument(SCDOCMODE_UNDO));
pUndoDoc->InitUndo(m_pDoc, 0, 0);
- m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::CONTENTS, false, pUndoDoc.get(), &aMark);
+ m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::CONTENTS, false, *pUndoDoc, &aMark);
ScUndoDeleteContents aUndo(&getDocShell(), aMark, aRange, std::move(pUndoDoc), false, InsertDeleteFlags::CONTENTS, true);
clearRange(m_pDoc, aRange);