summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-30 11:14:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-31 07:33:23 +0100
commit7b8e5bbfb5819ee6fec544792c14e91bc6075d29 (patch)
treea838a3b95d67b5c6c6b83cf3465cef2076db0ef1 /sfx2
parentea277ae70ee7f676ffa21fc1e7dd06ce06616d27 (diff)
loplugin:useuniqueptr in SfxSplitWindow
Change-Id: I30ece3781df9f705c96f9fc69e2b2a943625f6b3 Reviewed-on: https://gerrit.libreoffice.org/62659 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/splitwin.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 36302fb5957f..9dd57d90615a 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -243,7 +243,7 @@ SfxSplitWindow::SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl,
sal_uInt16 nCount = static_cast<sal_uInt16>(aWinData.getToken(i++, ',').toInt32());
for ( sal_uInt16 n=0; n<nCount; n++ )
{
- SfxDock_Impl *pDock = new SfxDock_Impl;
+ std::unique_ptr<SfxDock_Impl> pDock(new SfxDock_Impl);
pDock->pWin = nullptr;
pDock->bNewLine = false;
pDock->bHide = true;
@@ -255,14 +255,13 @@ SfxSplitWindow::SfxSplitWindow( vcl::Window* pParent, SfxChildAlignment eAl,
if ( !pDock->nType )
{
// Read error
- delete pDock;
break;
}
else
pDock->bNewLine = true;
}
- maDockArr.insert(maDockArr.begin() + n, std::unique_ptr<SfxDock_Impl>(pDock));
+ maDockArr.insert(maDockArr.begin() + n, std::move(pDock));
}
}
}