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>
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index ad7ea28..6ab4e59 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)