From 117fc49c979d65e5479635eab3ce10d74d076679 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 27 Oct 2016 20:55:49 +0100 Subject: ScopedVclPtr vs std::unique_ptr for VclAbstractDialog derivatives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5e43312b6f42ce0c63946f366eaf1e6dcb9629b2 Reviewed-on: https://gerrit.libreoffice.org/30344 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sd/source/ui/func/fuscale.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'sd/source/ui/func/fuscale.cxx') diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx index 023660ad827e..e71d93a17378 100644 --- a/sd/source/ui/func/fuscale.cxx +++ b/sd/source/ui/func/fuscale.cxx @@ -109,14 +109,9 @@ void FuScale::DoExecute( SfxRequest& rReq ) pZoomItem->SetValueSet( nZoomValues ); aNewAttr.Put( *pZoomItem ); - std::unique_ptr pDlg; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - if(pFact) - { - pDlg.reset(pFact->CreateSvxZoomDialog(nullptr, aNewAttr)); - } - - if( pDlg ) + ScopedVclPtr pDlg(pFact ? pFact->CreateSvxZoomDialog(nullptr, aNewAttr) : nullptr); + if (pDlg) { pDlg->SetLimits( (sal_uInt16)mpWindow->GetMinZoom(), (sal_uInt16)mpWindow->GetMaxZoom() ); sal_uInt16 nResult = pDlg->Execute(); @@ -136,7 +131,7 @@ void FuScale::DoExecute( SfxRequest& rReq ) const SfxItemSet aArgs (*(pDlg->GetOutputItemSet ())); - pDlg.reset(); + pDlg.disposeAndClear(); if (!mpViewShell) return; -- cgit