summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-12 10:44:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-13 08:31:45 +0200
commitd92b0efe58b77247e1e5292c1a989baa934df797 (patch)
tree8a1289a776a6969172dcffb1987fcc4802afc5bc /sc
parent9abbe6746cb4d36e3ccb384f96ccafb9e0612cd6 (diff)
loplugin:useuniqueptr in lcl_DoDragCells
Change-Id: Id50deec2b4b0e1de6b15e9d8a486b0818e0edfe1 Reviewed-on: https://gerrit.libreoffice.org/60412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/navipi/content.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index ad7ea280d8c7..6ab4e597fa15 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1306,7 +1306,7 @@ static void lcl_DoDragCells( ScDocShell* pSrcShell, const ScRange& rRange, ScDra
void ScContentTree::DoDrag()
{
- ScDocumentLoader* pDocLoader = nullptr;
+ std::unique_ptr<ScDocumentLoader> pDocLoader;
bIsInDrag = true;
ScModule* pScMod = SC_MOD();
@@ -1395,7 +1395,7 @@ void ScContentTree::DoDrag()
{
OUString aFilter, aOptions;
OUString aURL = aHiddenName;
- pDocLoader = new ScDocumentLoader( aURL, aFilter, aOptions );
+ pDocLoader.reset(new ScDocumentLoader( aURL, aFilter, aOptions ));
if (!pDocLoader->IsError())
pSrcShell = pDocLoader->GetDocShell();
}
@@ -1450,8 +1450,6 @@ void ScContentTree::DoDrag()
}
bIsInDrag = false; // static member
-
- delete pDocLoader; // if document was load for dragging
}
IMPL_LINK_NOARG(ScContentTree, ExecDragHdl, void*, void)