From fb310c42746c5f2452a7e8d9b0893640bf7b2019 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 10 Sep 2018 11:14:04 +0200 Subject: loplugin:useuniqueptr in DrawDocShell::Load Change-Id: I0d8b8c5c592b689bae33dd73f99cdf4ceb5f6c2d Reviewed-on: https://gerrit.libreoffice.org/60339 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/ui/docshell/docshel4.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index d2b9693deeec..fca227e683c7 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -358,9 +358,9 @@ bool DrawDocShell::Load( SfxMedium& rMedium ) */ bool DrawDocShell::LoadFrom( SfxMedium& rMedium ) { - WaitObject* pWait = nullptr; + std::unique_ptr pWait; if( mpViewShell ) - pWait = new WaitObject( static_cast(mpViewShell->GetActiveWindow()) ); + pWait.reset(new WaitObject( static_cast(mpViewShell->GetActiveWindow()) )); mpDoc->NewOrLoadCompleted( NEW_DOC ); mpDoc->CreateFirstPages(); @@ -379,8 +379,6 @@ bool DrawDocShell::LoadFrom( SfxMedium& rMedium ) pSet->Put( SfxUInt16Item( SID_VIEW_ID, 5 ) ); } - delete pWait; - return bRet; } -- cgit