diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-16 12:53:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-16 14:41:33 +0100 |
commit | 8b992d6f86298e115079a9d93e2569f7bef5b47e (patch) | |
tree | c81d61aa4d5d6eea138adf9ddc42e003270c4f9c | |
parent | 2c6f3773f2ad3b1119593fd5d0c7fb6356da95b0 (diff) |
use more ScopedVclPtr to avoid missing dispose
follow on to
commit 315be3a276b01e88c794da1dbc6252a8b803d269
Author: Caolán McNamara <caolanm@redhat.com>
Date: Fri Jan 12 10:48:59 2018 +0000
VclPtr, missing dispose
Change-Id: Idfa4709f10928ef6d53ada93db0f5452e5d5c4eb
Reviewed-on: https://gerrit.libreoffice.org/47982
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/docshell/docshel2.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/dialog/macassgn.cxx | 4 |
4 files changed, 6 insertions, 8 deletions
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index d718c7c1fcd5..67f7f26f4874 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1138,7 +1138,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bCenter ) bool bShowDialog = officecfg::Office::Calc::Compatibility::MergeCells::ShowDialog::get(); if (!bApi && bShowDialog) { - VclPtr<ScMergeCellsDialog> aBox = VclPtr<ScMergeCellsDialog>::Create( GetViewData().GetDialogParent() ); + ScopedVclPtr<ScMergeCellsDialog> aBox( VclPtr<ScMergeCellsDialog>::Create( GetViewData().GetDialogParent() ) ); sal_uInt16 nRetVal = aBox->Execute(); if ( nRetVal == RET_OK ) diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx index 6ac506bb3d5e..1e02c6e8e4d7 100644 --- a/sd/source/ui/docshell/docshel2.cxx +++ b/sd/source/ui/docshell/docshel2.cxx @@ -284,9 +284,9 @@ bool DrawDocShell::CheckPageName (vcl::Window* pWin, OUString& rName ) { OUString aDesc( SdResId( STR_WARN_PAGE_EXISTS ) ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - VclPtr<AbstractSvxNameDialog> aNameDlg = pFact ? pFact->CreateSvxNameDialog( pWin, aStrForDlg, aDesc ) : nullptr; - if( aNameDlg ) + if( pFact ) { + ScopedVclPtr<AbstractSvxNameDialog> aNameDlg( pFact->CreateSvxNameDialog( pWin, aStrForDlg, aDesc ) ); aNameDlg->SetEditHelpId( HID_SD_NAMEDIALOG_PAGE ); aNameDlg->SetCheckNameHdl( LINK( this, DrawDocShell, RenameSlideHdl ) ); @@ -300,7 +300,6 @@ bool DrawDocShell::CheckPageName (vcl::Window* pWin, OUString& rName ) aNameDlg->GetName( rName ); bIsNameValid = IsNewPageNameValid( rName ); } - aNameDlg.disposeAndClear(); } } diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 2b902d2ad529..defe7f1fdd2e 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1550,11 +1550,10 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) OUString aLang( aLanguage ); SAL_INFO("sfx.appl", "SfxApplication::OfaExec_Impl: about to create dialog for: " << aLang); // not sure about the vcl::Window* - VclPtr<VclAbstractDialog> pDlg = pFact->CreateSvxScriptOrgDialog( GetTopWindow(), aLanguage ); + ScopedVclPtr<VclAbstractDialog> pDlg( pFact->CreateSvxScriptOrgDialog( GetTopWindow(), aLanguage ) ); if( pDlg ) { pDlg->Execute(); - pDlg.disposeAndClear(); } else { diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx index 735752aacf78..ff9d3905108c 100644 --- a/sw/source/ui/dialog/macassgn.cxx +++ b/sw/source/ui/dialog/macassgn.cxx @@ -120,9 +120,9 @@ bool SwMacroAssignDlg::INetFormatDlg( vcl::Window* pParent, SwWrtShell& rSh, aSet.Put( AddEvents( MACASSGN_INETFMT ) ); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - VclPtr<SfxAbstractDialog> pMacroDlg = pFact->CreateSfxDialog( pParent, aSet, + ScopedVclPtr<SfxAbstractDialog> pMacroDlg( pFact->CreateSfxDialog( pParent, aSet, rSh.GetView().GetViewFrame()->GetFrame().GetFrameInterface(), - SID_EVENTCONFIG ); + SID_EVENTCONFIG ) ); if ( pMacroDlg && pMacroDlg->Execute() == RET_OK ) { const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet(); |