From d92b0efe58b77247e1e5292c1a989baa934df797 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 12 Sep 2018 10:44:14 +0200 Subject: loplugin:useuniqueptr in lcl_DoDragCells Change-Id: Id50deec2b4b0e1de6b15e9d8a486b0818e0edfe1 Reviewed-on: https://gerrit.libreoffice.org/60412 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/ui/navipi/content.cxx | 6 ++---- 1 file 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 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) -- cgit v1.2.3