From 09cb92096919e5a7bf4cf5fe66689e312ebc7f9c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 28 Oct 2016 09:11:02 +0200 Subject: convert std::unique_ptr to VclPtr Change-Id: Ifdd2a0599efd701def02b4a4d2a1c489cb1b27fa --- cui/source/options/optlingu.cxx | 2 +- desktop/source/deployment/gui/dp_gui_dialog2.cxx | 2 +- extensions/source/propctrlr/eventhandler.cxx | 2 +- sc/source/ui/view/tabvwshf.cxx | 2 +- scripting/source/protocolhandler/scripthandler.cxx | 2 +- sd/qa/unit/dialogs-test.cxx | 2 +- sd/source/ui/docshell/docshel3.cxx | 2 +- sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 10 ++++------ sd/source/ui/view/drviews2.cxx | 13 ++++++------- sd/source/ui/view/drviews3.cxx | 5 ++--- sd/source/ui/view/outlnvs2.cxx | 11 +++++------ sfx2/source/appl/appserv.cxx | 2 +- sfx2/source/doc/objmisc.cxx | 11 ++++++----- svx/source/dialog/srchdlg.cxx | 2 +- sw/source/uibase/shells/basesh.cxx | 4 ++-- sw/source/uibase/shells/langhelper.cxx | 2 +- sw/source/uibase/shells/tabsh.cxx | 4 ++-- sw/source/uibase/shells/textidx.cxx | 6 +++--- sw/source/uibase/shells/textsh.cxx | 2 +- sw/source/uibase/shells/textsh1.cxx | 10 +++------- sw/source/uibase/table/tablemgr.cxx | 2 +- sw/source/uibase/uiview/view0.cxx | 2 +- sw/source/uibase/uiview/view2.cxx | 4 ++-- test/source/screenshot_test.cxx | 4 ++-- 24 files changed, 50 insertions(+), 58 deletions(-) diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 2b374b136cbc..1172777d0a6b 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1587,7 +1587,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, Button *, pBtn, void ) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr aDlg(pFact->CreateSvxEditDictionaryDialog( this, xDic->getName() )); + ScopedVclPtr aDlg(pFact->CreateSvxEditDictionaryDialog( this, xDic->getName() )); DBG_ASSERT(aDlg, "Dialog creation failed!"); aDlg->Execute(); } diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index a2b7988d390c..4c6cd322a9ae 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -505,7 +505,7 @@ IMPL_LINK_NOARG(ExtBoxWithBtns_Impl, HandleOptionsBtn, Button*, void) if ( pFact ) { OUString sExtensionId = GetEntryData( nActive )->m_xPackage->getIdentifier().Value; - std::unique_ptr pDlg(pFact->CreateOptionsDialog( this, sExtensionId, OUString() )); + ScopedVclPtr pDlg(pFact->CreateOptionsDialog( this, sExtensionId, OUString() )); pDlg->Execute(); } diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index a1b6240f08d4..f314ad43c279 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -832,7 +832,7 @@ namespace pcr if ( !pFactory ) return InteractiveSelectionResult_Cancelled; - ::std::unique_ptr< VclAbstractDialog > pDialog( pFactory->CreateSvxMacroAssignDlg( + ScopedVclPtr pDialog( pFactory->CreateSvxMacroAssignDlg( PropertyHandlerHelper::getDialogParentWindow( m_xContext ), impl_getContextFrame_nothrow(), m_bIsDialogElement, diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index d01ab664bd7d..b8b1d3f18e10 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -796,7 +796,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) SvxAbstractDialogFactory* pDlgFactory = SvxAbstractDialogFactory::Create(); if (pDlgFactory) { - std::unique_ptr pDialog( pDlgFactory->CreateSvxMacroAssignDlg( + ScopedVclPtr pDialog( pDlgFactory->CreateSvxMacroAssignDlg( GetDialogParent(), xFrame, false, xEvents, 0 ) ); if ( pDialog.get() && pDialog->Execute() == RET_OK ) { diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index 85573b51a5c3..cd82b1931f5f 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -273,7 +273,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification( if ( pFact != nullptr ) { - std::unique_ptr pDlg( + ScopedVclPtr pDlg( pFact->CreateScriptErrorDialog( aException )); if ( pDlg ) diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx index 679c999f001b..4acc570ca599 100644 --- a/sd/qa/unit/dialogs-test.cxx +++ b/sd/qa/unit/dialogs-test.cxx @@ -623,7 +623,7 @@ void SdDialogsTest::openAnyDialog() // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui" // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui" // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui" - std::unique_ptr pDlg(createDialogByID(5)); + ScopedVclPtr pDlg(createDialogByID(5)); if (pDlg) { diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index 5aa32ba9f24e..35f8a38ebe0d 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -283,7 +283,7 @@ void DrawDocShell::Execute( SfxRequest& rReq ) SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); if (pFact && mpViewShell) { - std::unique_ptr pDlg(pFact->CreateVclDialog( mpViewShell->GetActiveWindow(), SID_LANGUAGE_OPTIONS )); + ScopedVclPtr pDlg(pFact->CreateVclDialog( mpViewShell->GetActiveWindow(), SID_LANGUAGE_OPTIONS )); pDlg->Execute(); } } diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 26336fb033a9..a42d222b1417 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -259,14 +259,12 @@ void SlotManager::FuTemporary (SfxRequest& rRequest) case SID_PHOTOALBUM: { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr pDlg(pFact ? pFact->CreateSdPhotoAlbumDialog( - mrSlideSorter.GetContentWindow(), - pDocument) : nullptr); - - if (pDlg) + if (pFact) { + ScopedVclPtr pDlg(pFact->CreateSdPhotoAlbumDialog( + mrSlideSorter.GetContentWindow(), + pDocument)); pDlg->Execute(); - pDlg.reset(); } rRequest.Done (); } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 2d08d7320208..66a94d53a195 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -2365,7 +2365,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); if( pFact ) { - std::unique_ptr pDlg(pFact->CreateBreakDlg(GetActiveWindow(), mpDrawView, GetDocSh(), nCount, static_cast(nAnz) )); + ScopedVclPtr pDlg(pFact->CreateBreakDlg(GetActiveWindow(), mpDrawView, GetDocSh(), nCount, static_cast(nAnz) )); if( pDlg ) { pDlg->Execute(); @@ -2879,14 +2879,13 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_PHOTOALBUM: { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr pDlg(pFact ? pFact->CreateSdPhotoAlbumDialog( - GetActiveWindow(), - GetDoc()) : nullptr); - - if (pDlg) + if (pFact) { + ScopedVclPtr pDlg(pFact->CreateSdPhotoAlbumDialog( + GetActiveWindow(), + GetDoc())); + pDlg->Execute(); - pDlg.reset(); } Cancel(); rReq.Ignore (); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 7f71b4747865..54b649a1ab30 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -315,11 +315,10 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) pPage = static_cast(&pPage->TRG_GetMasterPage()); SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr pDlg(pFact ? pFact->CreateMasterLayoutDialog( GetActiveWindow(), GetDoc(), pPage ) : nullptr); - if( pDlg ) + if (pFact) { + ScopedVclPtr pDlg(pFact->CreateMasterLayoutDialog( GetActiveWindow(), GetDoc(), pPage )); pDlg->Execute(); - pDlg.reset(); Invalidate(); } rReq.Done (); diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx index c8135930073f..ea7dcb951a4e 100644 --- a/sd/source/ui/view/outlnvs2.cxx +++ b/sd/source/ui/view/outlnvs2.cxx @@ -311,14 +311,13 @@ void OutlineViewShell::FuTemporary(SfxRequest &rReq) case SID_PHOTOALBUM: { SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); - std::unique_ptr pDlg(pFact ? pFact->CreateSdPhotoAlbumDialog( - GetActiveWindow(), - GetDoc()) : nullptr); - - if (pDlg) + if (pFact) { + ScopedVclPtr pDlg(pFact->CreateSdPhotoAlbumDialog( + GetActiveWindow(), + GetDoc())); + pDlg->Execute(); - pDlg.reset(); } Cancel(); rReq.Ignore (); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index b7da7a4af5e8..e9750b4d3dbb 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -606,7 +606,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr pDlg(pFact->CreateVclDialog( nullptr, RID_DEFAULTABOUT )); + ScopedVclPtr pDlg(pFact->CreateVclDialog( nullptr, RID_DEFAULTABOUT )); pDlg->Execute(); bDone = true; } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 473176c20ef1..f750d1ee74dd 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1477,14 +1477,15 @@ ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptCon if ( bCaughtException && bRaiseError ) { - std::unique_ptr< VclAbstractDialog > pScriptErrDlg; SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); if ( pFact ) - pScriptErrDlg.reset( pFact->CreateScriptErrorDialog( aException ) ); - OSL_ENSURE( pScriptErrDlg.get(), "SfxObjectShell::CallXScript: no script error dialog!" ); + { + ScopedVclPtr pScriptErrDlg( pFact->CreateScriptErrorDialog( aException ) ); + OSL_ENSURE( pScriptErrDlg.get(), "SfxObjectShell::CallXScript: no script error dialog!" ); - if ( pScriptErrDlg.get() ) - pScriptErrDlg->Execute(); + if ( pScriptErrDlg.get() ) + pScriptErrDlg->Execute(); + } } OSL_TRACE( "leaving CallXScript" ); diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 177dd16fea87..a035d61abb95 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -2103,7 +2103,7 @@ IMPL_LINK_NOARG(SvxSearchDialog, AttributeHdl_Impl, Button*, void) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); if(pFact) { - std::unique_ptr pDlg(pFact->CreateSvxSearchAttributeDialog( this, *pSearchList, pImpl->pRanges )); + ScopedVclPtr pDlg(pFact->CreateSvxSearchAttributeDialog( this, *pSearchList, pImpl->pRanges )); DBG_ASSERT(pDlg, "Dialog creation failed!"); pDlg->Execute(); } diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 832da5fd261a..ea45810304be 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2396,7 +2396,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) case FN_FORMAT_TITLEPAGE_DLG: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - std::unique_ptr pDlg(pFact->CreateTitlePageDlg( pMDI )); + ScopedVclPtr pDlg(pFact->CreateTitlePageDlg( pMDI )); pDlg->Execute(); } break; @@ -2870,7 +2870,7 @@ void SwBaseShell::ExecField( SfxRequest& rReq ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr pDlg(pFact->CreateSwChangeDBDlg(GetView())); + ScopedVclPtr pDlg(pFact->CreateSwChangeDBDlg(GetView())); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->Execute(); } diff --git a/sw/source/uibase/shells/langhelper.cxx b/sw/source/uibase/shells/langhelper.cxx index a879fac088d7..453a4adba303 100644 --- a/sw/source/uibase/shells/langhelper.cxx +++ b/sw/source/uibase/shells/langhelper.cxx @@ -126,7 +126,7 @@ namespace SwLangHelper SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); if (pFact) { - std::unique_ptr pDlg(pFact->CreateVclDialog( rView.GetWindow(), SID_LANGUAGE_OPTIONS )); + ScopedVclPtr pDlg(pFact->CreateVclDialog( rView.GetWindow(), SID_LANGUAGE_OPTIONS )); pDlg->Execute(); } } diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 09235458cb75..7c5875a5c375 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -833,7 +833,7 @@ void SwTableShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr pDlg(pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, DLG_ROW_HEIGHT )); + ScopedVclPtr pDlg(pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, DLG_ROW_HEIGHT )); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->Execute(); break; @@ -1049,7 +1049,7 @@ void SwTableShell::Execute(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr pDlg(pFact->CreateTableMergeDialog(GetView().GetWindow(), bPrev)); + ScopedVclPtr pDlg(pFact->CreateTableMergeDialog(GetView().GetWindow(), bPrev)); OSL_ENSURE(pDlg, "Dialog creation failed!"); if( RET_OK != pDlg->Execute()) bPrev = bNext = false; diff --git a/sw/source/uibase/shells/textidx.cxx b/sw/source/uibase/shells/textidx.cxx index 5b7d55a4ce89..8aab95d1a405 100644 --- a/sw/source/uibase/shells/textidx.cxx +++ b/sw/source/uibase/shells/textidx.cxx @@ -58,7 +58,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr pDlg(pFact->CreateVclAbstractDialog( pMDI, GetShell(), DLG_EDIT_AUTHMARK)); + ScopedVclPtr pDlg(pFact->CreateVclAbstractDialog( pMDI, GetShell(), DLG_EDIT_AUTHMARK)); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->Execute(); } @@ -84,7 +84,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) { // Several marks, which should it be? SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr pMultDlg(pFact->CreateMultiTOXMarkDlg(pMDI, aMgr)); + ScopedVclPtr pMultDlg(pFact->CreateMultiTOXMarkDlg(pMDI, aMgr)); OSL_ENSURE(pMultDlg, "Dialog creation failed!"); nRet = pMultDlg->Execute(); } @@ -92,7 +92,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr pDlg(pFact->CreateIndexMarkModalDlg(pMDI, GetShell(), aMgr.GetCurTOXMark())); + ScopedVclPtr pDlg(pFact->CreateIndexMarkModalDlg(pMDI, GetShell(), aMgr.GetCurTOXMark())); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->Execute(); } diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 7613cadb4673..2db970ded529 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -532,7 +532,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr pColDlg(pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, DLG_COLUMN)); + ScopedVclPtr pColDlg(pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, DLG_COLUMN)); OSL_ENSURE(pColDlg, "Dialog creation failed!"); pColDlg->Execute(); } diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 918c501e1585..efab29c75f79 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -338,7 +338,7 @@ void SwTextShell::Execute(SfxRequest &rReq) SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); if (pFact) { - std::unique_ptr pDlg(pFact->CreateVclDialog( GetView().GetWindow(), SID_LANGUAGE_OPTIONS )); + ScopedVclPtr pDlg(pFact->CreateVclDialog( GetView().GetWindow(), SID_LANGUAGE_OPTIONS )); pDlg->Execute(); } } @@ -626,7 +626,7 @@ void SwTextShell::Execute(SfxRequest &rReq) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr pDlg(pFact->CreateSwInsertBookmarkDlg( GetView().GetWindow(), rWrtSh, rReq )); + ScopedVclPtr pDlg(pFact->CreateSwInsertBookmarkDlg( GetView().GetWindow(), rWrtSh, rReq )); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->Execute(); } @@ -721,12 +721,8 @@ void SwTextShell::Execute(SfxRequest &rReq) case FN_SORTING_DLG: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - - std::unique_ptr pDlg(pFact->CreateVclAbstractDialog( GetView().GetWindow(), rWrtSh, DLG_SORTING )); - OSL_ENSURE(pDlg, "Dialog creation failed!"); + ScopedVclPtr pDlg(pFact->CreateVclAbstractDialog( GetView().GetWindow(), rWrtSh, DLG_SORTING )); pDlg->Execute(); - pDlg.reset(); rReq.Done(); } break; diff --git a/sw/source/uibase/table/tablemgr.cxx b/sw/source/uibase/table/tablemgr.cxx index b2e7cd076a66..af57206b04a2 100644 --- a/sw/source/uibase/table/tablemgr.cxx +++ b/sw/source/uibase/table/tablemgr.cxx @@ -56,7 +56,7 @@ void SwTableFUNC::ColWidthDlg( vcl::Window *pParent ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr pDlg(pFact->CreateSwTableWidthDlg(pParent, *this)); + ScopedVclPtr pDlg(pFact->CreateSwTableWidthDlg(pParent, *this)); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->Execute(); } diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index 93430e1bdcb7..b242e4314709 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -606,7 +606,7 @@ void SwView::ExecFormatFootnote() SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - std::unique_ptr pDlg(pFact->CreateSwFootNoteOptionDlg(GetWindow(), GetWrtShell())); + ScopedVclPtr pDlg(pFact->CreateSwFootNoteOptionDlg(GetWindow(), GetWrtShell())); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->Execute(); } diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 81716baa9793..531b9234bbb2 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -534,7 +534,7 @@ void SwView::Execute(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); - std::unique_ptr pDlg(pFact->CreateVclSwViewDialog(*this)); + ScopedVclPtr pDlg(pFact->CreateVclSwViewDialog(*this)); OSL_ENSURE(pDlg, "Dialog creation failed!"); pDlg->Execute(); break; @@ -2387,7 +2387,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument) SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); if ( pFact ) { - std::unique_ptr pDlg(pFact->CreateVclDialog( nullptr, SID_OPTIONS_DATABASES )); + ScopedVclPtr pDlg(pFact->CreateVclDialog( nullptr, SID_OPTIONS_DATABASES )); pDlg->Execute(); } } diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx index 6c22d9fa56c9..650b9cd70912 100644 --- a/test/source/screenshot_test.cxx +++ b/test/source/screenshot_test.cxx @@ -198,7 +198,7 @@ void ScreenshotTest::processAllKnownDialogs() { for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); ++i) { - std::unique_ptr pDlg(createDialogByID((*i).second)); + ScopedVclPtr pDlg(createDialogByID((*i).second)); if (pDlg) { @@ -227,7 +227,7 @@ void ScreenshotTest::processDialogBatchFile(const OUString& rFile) if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment)) { // first check if it's a known dialog - std::unique_ptr pDlg(createDialogByName(aNextUIFile)); + ScopedVclPtr pDlg(createDialogByName(aNextUIFile)); if (pDlg) { -- cgit