diff options
45 files changed, 206 insertions, 197 deletions
diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx index eef9ae6f04e6..21f677e5cab8 100644 --- a/basic/source/runtime/inputbox.cxx +++ b/basic/source/runtime/inputbox.cxx @@ -183,8 +183,8 @@ RTLFUNC(InputBox) nX = rPar.Get(4)->GetLong(); nY = rPar.Get(5)->GetLong(); } - VclPtr<SvRTLInputBox> pDlg(new SvRTLInputBox(Application::GetDefDialogParent(), - rPrompt,aTitle,aDefault,nX,nY)); + VclPtrInstance<SvRTLInputBox> pDlg(Application::GetDefDialogParent(), + rPrompt,aTitle,aDefault,nX,nY); pDlg->Execute(); rPar.Get(0)->PutString( pDlg->GetText() ); } diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index ac8ba5e44ce8..62109eec0af7 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -109,7 +109,7 @@ void ChartController::executeDispatch_InsertAxes() AxisHelper::getAxisOrGridPossibilities( aDialogInput.aPossibilityList, xDiagram, true ); SolarMutexGuard aGuard; - ScopedVclPtr<SchAxisDlg> aDlg(new SchAxisDlg( m_pChartWindow, aDialogInput )); + ScopedVclPtrInstance<SchAxisDlg> aDlg( m_pChartWindow, aDialogInput ); if( aDlg->Execute() == RET_OK ) { // lock controllers till end of block @@ -397,8 +397,11 @@ void ChartController::executeDispatch_InsertTrendline() aDialogParameter.init( getModel() ); ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get()); SolarMutexGuard aGuard; - ScopedVclPtr<SchAttribTabDlg> aDialog(new SchAttribTabDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider, - uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ))); + ScopedVclPtrInstance<SchAttribTabDlg> aDialog( + m_pChartWindow, &aItemSet, &aDialogParameter, + &aViewElementListProvider, + uno::Reference< util::XNumberFormatsSupplier >( + getModel(), uno::UNO_QUERY ) ); // note: when a user pressed "OK" but didn't change any settings in the // dialog, the SfxTabDialog returns "Cancel" @@ -452,8 +455,11 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) aDialogParameter.init( getModel() ); ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get()); SolarMutexGuard aGuard; - ScopedVclPtr<SchAttribTabDlg> aDlg(new SchAttribTabDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider, - uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ))); + ScopedVclPtrInstance<SchAttribTabDlg> aDlg( + m_pChartWindow, &aItemSet, &aDialogParameter, + &aViewElementListProvider, + uno::Reference< util::XNumberFormatsSupplier >( + getModel(), uno::UNO_QUERY ) ); aDlg->SetAxisMinorStepWidthForErrorBarDecimals( InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, m_aSelection.getSelectedCID())); @@ -489,10 +495,10 @@ void ChartController::executeDispatch_InsertErrorBars( bool bYError ) //prepare and open dialog SolarMutexGuard aGuard; - ScopedVclPtr<InsertErrorBarsDialog> aDlg(new InsertErrorBarsDialog( + ScopedVclPtrInstance<InsertErrorBarsDialog> aDlg( m_pChartWindow, aItemSet, uno::Reference< chart2::XChartDocument >( getModel(), uno::UNO_QUERY ), - bYError ? ErrorBarResources::ERROR_BAR_Y : ErrorBarResources::ERROR_BAR_X)); + bYError ? ErrorBarResources::ERROR_BAR_Y : ErrorBarResources::ERROR_BAR_X); aDlg->SetAxisMinorStepWidthForErrorBarDecimals( InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( getModel(), m_xChartView, OUString() ) ); diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx index a1be8def4e7e..6ed346ee199e 100644 --- a/chart2/source/controller/main/ChartController_Properties.cxx +++ b/chart2/source/controller/main/ChartController_Properties.cxx @@ -761,8 +761,11 @@ bool ChartController::executeDlg_ObjectProperties_withoutUndoGuard( ViewElementListProvider aViewElementListProvider( m_pDrawModelWrapper.get() ); SolarMutexGuard aGuard; - ScopedVclPtr<SchAttribTabDlg> aDlg(new SchAttribTabDlg( m_pChartWindow, &aItemSet, &aDialogParameter, &aViewElementListProvider - , uno::Reference< util::XNumberFormatsSupplier >( getModel(), uno::UNO_QUERY ) )); + ScopedVclPtrInstance<SchAttribTabDlg> aDlg( + m_pChartWindow, &aItemSet, &aDialogParameter, + &aViewElementListProvider, + uno::Reference< util::XNumberFormatsSupplier >( + getModel(), uno::UNO_QUERY ) ); if(aDialogParameter.HasSymbolProperties()) { diff --git a/cppcanvas/qa/unit/test.cxx b/cppcanvas/qa/unit/test.cxx index 684980a78321..fa7b21e2ceaa 100644 --- a/cppcanvas/qa/unit/test.cxx +++ b/cppcanvas/qa/unit/test.cxx @@ -43,7 +43,7 @@ public: void CanvasTest::testComposite() { #ifdef LINUX - VclPtr<vcl::Window> pWin(new WorkWindow( (vcl::Window *)NULL )); + VclPtrInstance<WorkWindow> pWin( nullptr ); uno::Reference<rendering::XCanvas> xCanvas = pWin->GetCanvas (); if( !xCanvas.is() ) diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx index 74a9505bcf08..51a8c32b4568 100644 --- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx +++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx @@ -242,8 +242,8 @@ namespace cppcanvas // render our content into an appropriately sized // VirtualDevice with alpha channel - ScopedVclPtr<VirtualDevice> aVDev(new VirtualDevice( - *::Application::GetDefaultDevice(), 0, 0 )); + ScopedVclPtrInstance<VirtualDevice> aVDev( + *::Application::GetDefaultDevice(), 0, 0 ); aVDev->SetOutputSizePixel( aBitmapSizePixel ); aVDev->SetMapMode(); diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 032cabb939bc..44228cbd1961 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -2393,7 +2393,7 @@ short SvxMenuConfigPage::QueryReset() OUString label = replaceSaveInName( msg, saveInName ); - ScopedVclPtr<QueryBox> qbox(new QueryBox( this, WB_YES_NO, label )); + ScopedVclPtrInstance<QueryBox> qbox( this, WB_YES_NO, label ); return qbox->Execute(); } diff --git a/cui/source/dialogs/passwdomdlg.cxx b/cui/source/dialogs/passwdomdlg.cxx index e59e58183181..eade758348a5 100644 --- a/cui/source/dialogs/passwdomdlg.cxx +++ b/cui/source/dialogs/passwdomdlg.cxx @@ -101,8 +101,8 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG m_pPasswdToModifyED->GetText().isEmpty(); if (bInvalidState) { - ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(m_pParent, - m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2)); + ScopedVclPtrInstance<MessageDialog> aErrorBox(m_pParent, + m_bIsPasswordToModify? m_aInvalidStateForOkButton : m_aInvalidStateForOkButton_v2); aErrorBox->Execute(); } else // check for mismatched passwords... diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index c4c5b0df039c..0727f440c121 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -1498,11 +1498,10 @@ IMPL_LINK( SvxScriptErrorDialog, ShowDialog, OUString*, pMessage ) message = OUString( CUI_RES( RID_SVXSTR_ERROR_TITLE ) ); } - VclPtr<MessageDialog> pBox = new MessageDialog(NULL, message, VCL_MESSAGE_WARNING); + ScopedVclPtrInstance<MessageDialog> pBox( nullptr, message, VCL_MESSAGE_WARNING ); pBox->SetText( CUI_RES( RID_SVXSTR_ERROR_TITLE ) ); pBox->Execute(); - pBox.disposeAndClear(); delete pMessage; return 0; diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx index 87c5dd0af3cf..68fe0181527f 100644 --- a/cui/source/options/optchart.cxx +++ b/cui/source/options/optchart.cxx @@ -231,8 +231,8 @@ IMPL_LINK( SvxDefaultColorOptPage, RemoveChartColor, PushButton*, pButton ) { OSL_ENSURE(pColorConfig->GetColorList().size() > 1, "don't delete the last chart color"); - ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(pButton, "QueryDeleteChartColorDialog", - "cui/ui/querydeletechartcolordialog.ui")); + ScopedVclPtrInstance<MessageDialog> aQuery(pButton, "QueryDeleteChartColorDialog", + "cui/ui/querydeletechartcolordialog.ui"); if (RET_YES == aQuery->Execute()) { pColorConfig->GetColorList().remove( nIndex ); diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 018204399319..4ad9c3879284 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1673,8 +1673,8 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn ) } else if (m_pLinguDicsDelPB == pBtn) { - ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(this, "QueryDeleteDictionaryDialog", - "cui/ui/querydeletedictionarydialog.ui")); + ScopedVclPtrInstance<MessageDialog> aQuery(this, "QueryDeleteDictionaryDialog", + "cui/ui/querydeletedictionarydialog.ui"); if (RET_NO == aQuery->Execute()) return 0; diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx index b3b183dab918..fb789dcf02f9 100644 --- a/cui/source/tabpages/tpbitmap.cxx +++ b/cui/source/tabpages/tpbitmap.cxx @@ -446,10 +446,10 @@ long SvxBitmapTabPage::CheckChanges_Impl() { ResMgr& rMgr = CUI_MGR(); Image aWarningBoxImage = WarningBox::GetStandardImage(); - ScopedVclPtr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(), - SVX_RES( RID_SVXSTR_BITMAP ), - CUI_RES( RID_SVXSTR_ASK_CHANGE_BITMAP ), - &aWarningBoxImage )); + ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(), + SVX_RES( RID_SVXSTR_BITMAP ), + CUI_RES( RID_SVXSTR_ASK_CHANGE_BITMAP ), + &aWarningBoxImage ); DBG_ASSERT(aMessDlg, "Dialog creation failed!"); aMessDlg->SetButtonText( MESS_BTN_1, ResId( RID_SVXSTR_CHANGE, rMgr ) ); aMessDlg->SetButtonText( MESS_BTN_2, ResId( RID_SVXSTR_ADD, rMgr ) ); @@ -728,9 +728,10 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickModifyHdl_Impl) } else { - ScopedVclPtr<MessageDialog> aBox( new MessageDialog(GetParentDialog() + ScopedVclPtrInstance<MessageDialog> aBox( + GetParentDialog() ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui")); + ,"cui/ui/queryduplicatedialog.ui"); aBox->Execute(); } } diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 736f68224e6a..ff323782ec3d 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -539,10 +539,10 @@ long SvxColorTabPage::CheckChanges_Impl() { ResMgr& rMgr = CUI_MGR(); Image aWarningBoxImage = WarningBox::GetStandardImage(); - ScopedVclPtr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(), - SVX_RESSTR( RID_SVXSTR_COLOR ), - ResId( RID_SVXSTR_ASK_CHANGE_COLOR, rMgr ), - &aWarningBoxImage )); + ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(), + SVX_RESSTR( RID_SVXSTR_COLOR ), + ResId( RID_SVXSTR_ASK_CHANGE_COLOR, rMgr ), + &aWarningBoxImage ); aMessDlg->SetButtonText( MESS_BTN_1, ResId( RID_SVXSTR_CHANGE, rMgr ) ); aMessDlg->SetButtonText( MESS_BTN_2, @@ -705,9 +705,9 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl) // if yes, it is repeated and a new name is demanded if ( !bDifferent ) { - ScopedVclPtr<MessageDialog> aWarningBox(new MessageDialog( GetParentDialog() - ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui")); + ScopedVclPtrInstance<MessageDialog> aWarningBox( GetParentDialog() + ,"DuplicateNameDialog" + ,"cui/ui/queryduplicatedialog.ui"); aWarningBox->Execute(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); @@ -776,9 +776,9 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl) // if yes, it is repeated and a new name is demanded if ( !bDifferent ) { - ScopedVclPtr<MessageDialog> aWarningBox(new MessageDialog( GetParentDialog() - ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui")); + ScopedVclPtrInstance<MessageDialog> aWarningBox( GetParentDialog() + ,"DuplicateNameDialog" + ,"cui/ui/queryduplicatedialog.ui"); aWarningBox->Execute(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 7a388909ebca..daec497a531b 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -291,10 +291,10 @@ long SvxGradientTabPage::CheckChanges_Impl() { ResMgr& rMgr = CUI_MGR(); Image aWarningBoxImage = WarningBox::GetStandardImage(); - ScopedVclPtr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(), - SVX_RESSTR( RID_SVXSTR_GRADIENT ), - CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_GRADIENT ), - &aWarningBoxImage )); + ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(), + SVX_RESSTR( RID_SVXSTR_GRADIENT ), + CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_GRADIENT ), + &aWarningBoxImage ); DBG_ASSERT(aMessDlg, "Dialog creation failed!"); aMessDlg->SetButtonText( MESS_BTN_1, OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) ); @@ -589,9 +589,9 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl) } else { - ScopedVclPtr<MessageDialog> aBox( new MessageDialog( GetParentDialog() - ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui") ); + ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog() + ,"DuplicateNameDialog" + ,"cui/ui/queryduplicatedialog.ui" ); aBox->Execute(); } diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index d3f1aa33f3bd..800c18bd77ac 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -261,10 +261,10 @@ long SvxHatchTabPage::CheckChanges_Impl() { ResMgr& rMgr = CUI_MGR(); Image aWarningBoxImage = WarningBox::GetStandardImage(); - ScopedVclPtr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(), - SVX_RESSTR( RID_SVXSTR_HATCH ), - CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_HATCH ), - &aWarningBoxImage )); + ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(), + SVX_RESSTR( RID_SVXSTR_HATCH ), + CUI_RESSTR( RID_SVXSTR_ASK_CHANGE_HATCH ), + &aWarningBoxImage ); DBG_ASSERT(aMessDlg, "Dialog creation failed!"); aMessDlg->SetButtonText( MESS_BTN_1, OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) ); @@ -627,9 +627,9 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl) } else { - ScopedVclPtr<MessageDialog> aBox(new MessageDialog( GetParentDialog() - ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui")); + ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog() + ,"DuplicateNameDialog" + ,"cui/ui/queryduplicatedialog.ui" ); aBox->Execute(); } } diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index 9f1b5ebf3c82..81c0fdb70f75 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -246,10 +246,10 @@ void SvxLineDefTabPage::CheckChanges_Impl() { ResMgr& rMgr = CUI_MGR(); Image aWarningBoxImage = WarningBox::GetStandardImage(); - ScopedVclPtr<SvxMessDialog> aMessDlg(new SvxMessDialog(GetParentDialog(), - SVX_RESSTR( RID_SVXSTR_LINESTYLE ), - OUString( ResId( RID_SVXSTR_ASK_CHANGE_LINESTYLE, rMgr ) ), - &aWarningBoxImage )); + ScopedVclPtrInstance<SvxMessDialog> aMessDlg( GetParentDialog(), + SVX_RESSTR( RID_SVXSTR_LINESTYLE ), + OUString( ResId( RID_SVXSTR_ASK_CHANGE_LINESTYLE, rMgr ) ), + &aWarningBoxImage ); DBG_ASSERT(aMessDlg, "Dialog creation failed!"); aMessDlg->SetButtonText( MESS_BTN_1, OUString( ResId( RID_SVXSTR_CHANGE, rMgr ) ) ); aMessDlg->SetButtonText( MESS_BTN_2, OUString( ResId( RID_SVXSTR_ADD, rMgr ) ) ); @@ -618,10 +618,9 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl) } else { - - ScopedVclPtr<MessageDialog> aBox(new MessageDialog( GetParentDialog() - ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui")); + ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog() + ,"DuplicateNameDialog" + ,"cui/ui/queryduplicatedialog.ui" ); aBox->Execute(); } } @@ -697,9 +696,9 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickModifyHdl_Impl) } else { - ScopedVclPtr<MessageDialog> aBox(new MessageDialog( GetParentDialog() - ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui") ); + ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog() + ,"DuplicateNameDialog" + ,"cui/ui/queryduplicatedialog.ui" ); aBox->Execute(); } } @@ -715,9 +714,9 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickDeleteHdl_Impl) if ( nPos != LISTBOX_ENTRY_NOTFOUND ) { - ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog() - ,"AskDelLineStyleDialog" - ,"cui/ui/querydeletelinestyledialog.ui")); + ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog() + ,"AskDelLineStyleDialog" + ,"cui/ui/querydeletelinestyledialog.ui" ); if ( aQueryBox->Execute() == RET_YES ) { diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index b1fa34570a92..6b43ba93e4c1 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -206,10 +206,9 @@ void SvxLineEndDefTabPage::CheckChanges_Impl() if( aString != m_pLbLineEnds->GetSelectEntry() ) { - ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog() - ,"AskChangeLineEndDialog" - ,"cui/ui/querychangelineenddialog.ui")); - + ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog() + ,"AskChangeLineEndDialog" + ,"cui/ui/querychangelineenddialog.ui" ); if ( aQueryBox->Execute() == RET_YES ) ClickModifyHdl_Impl( this ); } @@ -343,9 +342,9 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl) // if yes, repeat and demand a new name if ( !bDifferent ) { - ScopedVclPtr<MessageDialog> aWarningBox(new MessageDialog( GetParentDialog() - ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui")); + ScopedVclPtrInstance<MessageDialog> aWarningBox( GetParentDialog() + ,"DuplicateNameDialog" + ,"cui/ui/queryduplicatedialog.ui" ); aWarningBox->Execute(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); @@ -497,9 +496,9 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl) } else { - ScopedVclPtr<MessageDialog> aBox(new MessageDialog( GetParentDialog() - ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui")); + ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog() + ,"DuplicateNameDialog" + ,"cui/ui/queryduplicatedialog.ui" ); aBox->Execute(); } } @@ -525,9 +524,9 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickDeleteHdl_Impl) if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog() - ,"AskDelLineEndDialog" - ,"cui/ui/querydeletelineenddialog.ui")); + ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog() + ,"AskDelLineEndDialog" + ,"cui/ui/querydeletelineenddialog.ui" ); if ( aQueryBox->Execute() == RET_YES ) { diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index a4dff8c95b42..8b9d89cec649 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -686,13 +686,14 @@ bool OApplicationController::paste( ElementType _eType, const ::svx::ODataAccess has a /table/ with that name) */ if ( bNeedAskForName ) { - ScopedVclPtr<OSaveAsDlg> aAskForName(new OSaveAsDlg( getView(), + ScopedVclPtrInstance<OSaveAsDlg> aAskForName( + getView(), CommandType::QUERY, getORB(), getConnection(), sTargetName, aNameChecker, - SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS)); + SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS ); if ( RET_OK != aAskForName->Execute() ) // cancelled by the user return false; diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 4c857cf2f3d4..8ade09ffccee 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -2172,9 +2172,9 @@ bool SbaXDataBrowserController::SaveModified(bool bAskFor) { getBrowserView()->getVclControl()->GrabFocus(); - ScopedVclPtr<MessageDialog> aQry(new MessageDialog(getBrowserView()->getVclControl(), - "SaveModifiedDialog", - "dbaccess/ui/savemodifieddialog.ui")); + ScopedVclPtrInstance<MessageDialog> aQry( getBrowserView()->getVclControl(), + "SaveModifiedDialog", + "dbaccess/ui/savemodifieddialog.ui" ); switch (aQry->Execute()) { diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index 7b71e75093a2..d1a4981da386 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -586,8 +586,8 @@ namespace dbaui if (aSelected->isModified() || aSelected->isNew()) { - ScopedVclPtr<MessageDialog> aQuestion(new MessageDialog(this, "SaveIndexDialog", - "dbaccess/ui/saveindexdialog.ui")); + ScopedVclPtrInstance<MessageDialog> aQuestion(this, "SaveIndexDialog", + "dbaccess/ui/saveindexdialog.ui" ); nResponse = aQuestion->Execute(); } } diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index ba1352b3c5ae..7f7f51a5f9e2 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -687,8 +687,8 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe { bool bHaveDefaultTable = !m_sDefaultTableName.isEmpty(); OUString sTableName( bHaveDefaultTable ? m_sDefaultTableName : _rTableName ); - ScopedVclPtr<OCopyTableWizard> aWizard(new OCopyTableWizard( - NULL, + ScopedVclPtrInstance<OCopyTableWizard> aWizard( + nullptr, sTableName, bHaveDefaultTable ? CopyTableOperation::AppendData : CopyTableOperation::CopyDefinitionAndData, m_aDestColumns, @@ -698,7 +698,7 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe getTypeSelectionPageFactory(), m_rInputStream, m_xContext - )); + ); bool bError = false; try diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index ff9d94a27642..e03f8084bd95 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1431,12 +1431,13 @@ bool insertHierachyElement( vcl::Window* _pParent, const Reference< XComponentCo // here we have everything needed to create a new query object ... HierarchicalNameCheck aNameChecker( _xNames.get(), sName ); // ... ehm, except a new name - ScopedVclPtr<OSaveAsDlg> aAskForName(new OSaveAsDlg( _pParent, + ScopedVclPtrInstance<OSaveAsDlg> aAskForName( + _pParent, _rxContext, sTargetName, sLabel, aNameChecker, - SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS)); + SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS ); if ( RET_OK != aAskForName->Execute() ) // cancelled by the user return false; diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index f5aabbb95d44..0506a3e1cb34 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1238,8 +1238,8 @@ void OQueryController::loadViewSettings( const ::comphelper::NamedValueCollectio void OQueryController::execute_QueryPropDlg() { - ScopedVclPtr<QueryPropertiesDialog> aQueryPropDlg(new QueryPropertiesDialog( - getContainer(), m_bDistinct, m_nLimit )); + ScopedVclPtrInstance<QueryPropertiesDialog> aQueryPropDlg( + getContainer(), m_bDistinct, m_nLimit ); if( aQueryPropDlg->Execute() == RET_OK ) { @@ -1398,14 +1398,14 @@ bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElements, b } DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::QUERY ); - ScopedVclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( + ScopedVclPtrInstance<OSaveAsDlg> aDlg( getView(), m_nCommandType, getORB(), getConnection(), aDefaultName, aNameChecker, - SAD_DEFAULT )); + SAD_DEFAULT ); bRet = ( aDlg->Execute() == RET_OK ); if ( bRet ) diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index 8415437ce6ba..f9a9dcf6cf6b 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -255,8 +255,8 @@ short ORelationController::saveModified() short nSaved = RET_YES; if(haveDataSource() && isModified()) { - ScopedVclPtr<MessageDialog> aQry(new MessageDialog(getView(), "DesignSaveModifiedDialog", - "dbaccess/ui/designsavemodifieddialog.ui")); + ScopedVclPtrInstance<MessageDialog> aQry(getView(), "DesignSaveModifiedDialog", + "dbaccess/ui/designsavemodifieddialog.ui"); nSaved = aQry->Execute(); if(nSaved == RET_YES) Execute(ID_BROWSER_SAVEDOC,Sequence<PropertyValue>()); diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 0adce50dce79..81c8e5970ab2 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -285,7 +285,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs) if (!xTablesSup.is()) { OUString aMessage(ModuleRes(STR_TABLEDESIGN_CONNECTION_MISSING)); - ScopedVclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), aMessage ) )->Execute(); + ScopedVclPtrInstance<OSQLWarningBox>(getView(), aMessage )->Execute(); return false; } @@ -522,7 +522,7 @@ void OTableController::impl_initialize() } catch(const SQLException&) { - ScopedVclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ) ) )->Execute(); + ScopedVclPtrInstance<OSQLWarningBox>(getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ))->Execute(); throw; } try @@ -563,8 +563,8 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti ::boost::mem_fn(&OTableRow::isValid)); if ( aIter != m_vRowList.end() ) { - ScopedVclPtr<MessageDialog> aQry(new MessageDialog(getView(), "TableDesignSaveModifiedDialog", - "dbaccess/ui/tabledesignsavemodifieddialog.ui")); + ScopedVclPtrInstance<MessageDialog> aQry(getView(), "TableDesignSaveModifiedDialog", + "dbaccess/ui/tabledesignsavemodifieddialog.ui"); switch (aQry->Execute()) { case RET_YES: @@ -580,8 +580,8 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti } else if ( !m_bNew ) { - ScopedVclPtr<MessageDialog> aQry(new MessageDialog(getView(), "DeleteAllRowsDialog", - "dbaccess/ui/deleteallrowsdialog.ui")); + ScopedVclPtrInstance<MessageDialog> aQry(getView(), "DeleteAllRowsDialog", + "dbaccess/ui/deleteallrowsdialog.ui"); switch (aQry->Execute()) { case RET_YES: @@ -936,7 +936,7 @@ bool OTableController::checkColumns(bool _bNew) { OUString strMessage = ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME); strMessage = strMessage.replaceFirst("$column$", pFieldDesc->GetName()); - ScopedVclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), strMessage ) )->Execute(); + ScopedVclPtrInstance<OSQLWarningBox>(getView(), strMessage)->Execute(); return false; } } diff --git a/desktop/source/app/lockfile2.cxx b/desktop/source/app/lockfile2.cxx index 679258c88dd3..7636431048a6 100644 --- a/desktop/source/app/lockfile2.cxx +++ b/desktop/source/app/lockfile2.cxx @@ -38,8 +38,8 @@ bool Lockfile_execWarning( Lockfile * that ) OString aTime = aConfig.ReadKey( LOCKFILE_TIMEKEY ); // display warning and return response - ScopedVclPtr<MessageDialog> aBox(new MessageDialog(NULL, DesktopResId(STR_QUERY_USERDATALOCKED), - VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtrInstance<MessageDialog> aBox(nullptr, DesktopResId(STR_QUERY_USERDATALOCKED), + VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); // set box title OUString aTitle = OUString( DesktopResId( STR_TITLE_USERDATALOCKED )); aBox->SetText( aTitle ); diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index fdfcf89dd133..b41fb3a56c8b 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -595,9 +595,8 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment:: if ( !bHadWarning && IsSharedPkgMgr( xPackage ) ) { const SolarMutexGuard guard; - ScopedVclPtr<MessageDialog> aInfoBox(new MessageDialog(pParent, getResId(nResID), - VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL)); - + ScopedVclPtrInstance<MessageDialog> aInfoBox(pParent, getResId(nResID), + VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL); bHadWarning = true; if ( RET_OK == aInfoBox->Execute() ) @@ -636,8 +635,8 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const { const SolarMutexGuard guard; - ScopedVclPtr<MessageDialog> aInfo(new MessageDialog(m_pVCLWindow, getResId(RID_STR_WARNING_INSTALL_EXTENSION), - VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL)); + ScopedVclPtrInstance<MessageDialog> aInfo(m_pVCLWindow, getResId(RID_STR_WARNING_INSTALL_EXTENSION), + VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL); OUString sText(aInfo->get_primary_text()); sText = sText.replaceAll("%NAME", rExtensionName); @@ -649,8 +648,8 @@ bool DialogHelper::installExtensionWarn( const OUString &rExtensionName ) const bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const { const SolarMutexGuard guard; - ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(m_pVCLWindow, "InstallForAllDialog", - "desktop/ui/installforalldialog.ui")); + ScopedVclPtrInstance<MessageDialog> aQuery(m_pVCLWindow, "InstallForAllDialog", + "desktop/ui/installforalldialog.ui"); short nRet = aQuery->Execute(); if (nRet == RET_CANCEL) @@ -794,8 +793,8 @@ void ExtMgrDialog::checkEntries() bool ExtMgrDialog::removeExtensionWarn( const OUString &rExtensionName ) const { const SolarMutexGuard guard; - ScopedVclPtr<MessageDialog> aInfo(new MessageDialog(const_cast<ExtMgrDialog*>(this), getResId(RID_STR_WARNING_REMOVE_EXTENSION), - VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL)); + ScopedVclPtrInstance<MessageDialog> aInfo(const_cast<ExtMgrDialog*>(this), getResId(RID_STR_WARNING_REMOVE_EXTENSION), + VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL); OUString sText(aInfo->get_primary_text()); sText = sText.replaceAll("%NAME", rExtensionName); diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx index 64480b14fc04..57005409442f 100644 --- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx @@ -451,8 +451,8 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const & verExc.Deployed->getDisplayName()); { SolarMutexGuard guard; - ScopedVclPtr<MessageDialog> box(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, - ResId(id, *DeploymentGuiResMgr::get()), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL)); + ScopedVclPtrInstance<MessageDialog> box(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, + ResId(id, *DeploymentGuiResMgr::get()), VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL); OUString s; if (bEqualNames) { diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 407f5b70ea7e..5fb6c116df7b 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2965,12 +2965,12 @@ namespace pcr OSL_PRECOND( impl_getContextControlContainer_nothrow().is(), "FormComponentPropertyHandler::impl_dialogChangeTabOrder_nothrow: invalid control context!" ); Reference< XTabControllerModel > xTabControllerModel( impl_getRowSet_nothrow(), UNO_QUERY ); - ScopedVclPtr<TabOrderDialog> aDialog(new TabOrderDialog( + ScopedVclPtrInstance<TabOrderDialog> aDialog( impl_getDefaultDialogParent_nothrow(), xTabControllerModel, impl_getContextControlContainer_nothrow(), m_xContext - )); + ); _rClearBeforeDialog.clear(); return ( RET_OK == aDialog->Execute() ); } diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx index c52a9fc10d0d..5d01cc891db5 100644 --- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx +++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx @@ -496,7 +496,7 @@ namespace pcr ::std::vector< OUString > aExistentNames; m_pHelper->getAvailableDataTypeNames( aExistentNames ); - ScopedVclPtr<NewDataTypeDialog> aDialog(new NewDataTypeDialog( NULL, pType->getName(), aExistentNames ) ); // TODO/eForms: proper parent + ScopedVclPtrInstance<NewDataTypeDialog> aDialog( nullptr, pType->getName(), aExistentNames ); // TODO/eForms: proper parent if ( aDialog->Execute() != RET_OK ) return false; @@ -535,7 +535,7 @@ namespace pcr // confirmation message OUString sConfirmation( PcrRes( RID_STR_CONFIRM_DELETE_DATA_TYPE ).toString() ); sConfirmation = sConfirmation.replaceFirst( "#type#", pType->getName() ); - ScopedVclPtr<QueryBox> aQuery(new QueryBox( NULL, WB_YES_NO, sConfirmation ) ); // TODO/eForms: proper parent + ScopedVclPtrInstance<QueryBox> aQuery( nullptr, WB_YES_NO, sConfirmation ); // TODO/eForms: proper parent if ( aQuery->Execute() != RET_YES ) return false; diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 6432190c9c25..5ead4fc1900e 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -4205,9 +4205,9 @@ void AutoRecovery::impl_showFullDiscError() if (sBackupPath.getLength() < 1) sBackupPath = sBackupURL; - ScopedVclPtr<ErrorBox> dlgError(new ErrorBox( + ScopedVclPtrInstance<ErrorBox> dlgError( 0, WB_OK, - sMsg.replaceAll("%PATH", sBackupPath))); + sMsg.replaceAll("%PATH", sBackupPath)); dlgError->SetButtonText(dlgError->GetButtonId(0), sBtn); dlgError->Execute(); } diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 5b7e37119812..e22a968d0db9 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -1027,8 +1027,9 @@ bool openDialogFormula_nothrow( OUString& _in_out_rFormula CharClass aCC(_xContext, aLangTag); svl::SharedStringPool aStringPool(&aCC); - ScopedVclPtr<FormulaDialog> aDlg(new FormulaDialog( - pParent, xServiceFactory, pFormulaManager, aFormula.getUndecoratedContent(), _xRowSet, aStringPool)); + ScopedVclPtrInstance<FormulaDialog> aDlg( + pParent, xServiceFactory, pFormulaManager, + aFormula.getUndecoratedContent(), _xRowSet, aStringPool); bSuccess = aDlg->Execute() == RET_OK; if ( bSuccess ) diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index e256afe9e952..de0fa71c11b1 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -2480,9 +2480,9 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _ } { // want the dialog to be destroyed before our set - ScopedVclPtr<ORptPageDialog> aDlg(new ORptPageDialog(getView(), pDescriptor.get(),_xSection.is() + ScopedVclPtr<ORptPageDialog> aDlg(getView(), pDescriptor.get(),_xSection.is() ? OUString("BackgroundDialog") - : OUString("PageDialog"))); + : OUString("PageDialog")); if (RET_OK == aDlg->Execute()) { diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index f52ebb8a01f0..c25004ecff3c 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -662,9 +662,9 @@ void WorkbookGlobals::recalcFormulaCells() if (rDoc.IsUserInteractionEnabled()) { // Ask the user if full re-calculation is desired. - ScopedVclPtr<QueryBox> aBox(new QueryBox( + ScopedVclPtrInstance<QueryBox> aBox( rDocSh.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), - ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS))); + ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS)); aBox->SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED)); sal_Int32 nRet = aBox->Execute(); diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 4d8c759b378a..da874ef34a41 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -171,8 +171,8 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl) sal_uInt16 nId = 1; ScModule* pScMod = SC_MOD(); pScMod->SetRefDialog( nId, true ); - VclPtr<ScCondFormatDlg> pDlg(new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(), - pFormat->GetRange().GetTopLeftCorner(), condformat::dialog::NONE)); + VclPtrInstance<ScCondFormatDlg> pDlg(this, mpDoc, pFormat, pFormat->GetRange(), + pFormat->GetRange().GetTopLeftCorner(), condformat::dialog::NONE); Show(false, 0); if(pDlg->Execute() == RET_OK) { @@ -217,8 +217,8 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl) sal_uInt16 nId = 1; ScModule* pScMod = SC_MOD(); pScMod->SetRefDialog( nId, true ); - VclPtr<ScCondFormatDlg> pDlg(new ScCondFormatDlg(this, mpDoc, NULL, ScRangeList(), - maPos, condformat::dialog::CONDITION)); + VclPtrInstance<ScCondFormatDlg> pDlg(this, mpDoc, NULL, ScRangeList(), + maPos, condformat::dialog::CONDITION); Show(false, 0); if(pDlg->Execute() == RET_OK) { diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index 629423c61f15..10b98cb72208 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -459,8 +459,8 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter, //! Link-Dialog muss Default-Parent setzen // "kann keine Zeilen einfuegen" - ScopedVclPtr<InfoBox> aBox(new InfoBox( Application::GetDefDialogParent(), - ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_2 ) ) ); + ScopedVclPtrInstance<InfoBox> aBox( Application::GetDefDialogParent(), + ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_2 ) ); aBox->Execute(); } diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 4a9298188916..d8e63818fb7e 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1269,8 +1269,8 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb // OutRange of pOldObj (pDestObj) is still old area if (!lcl_EmptyExcept(&rDoc, aNewOut, pOldObj->GetOutRange())) { - ScopedVclPtr<QueryBox> aBox(new QueryBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), - ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) ) ); + ScopedVclPtrInstance<QueryBox> aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) ); if (aBox->Execute() == RET_NO) { //! like above (not editable) @@ -1421,9 +1421,9 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool if (!bEmpty) { - ScopedVclPtr<QueryBox> aBox(new QueryBox( + ScopedVclPtrInstance<QueryBox> aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), - ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY))); + ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY)); if (aBox->Execute() == RET_NO) { @@ -1495,8 +1495,8 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) { if (!lcl_EmptyExcept(&rDoc, aNewOut, rDPObj.GetOutRange())) { - ScopedVclPtr<QueryBox> aBox(new QueryBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), - ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) ) ); + ScopedVclPtrInstance<QueryBox> aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) ); if (aBox->Execute() == RET_NO) { rDPObj = aUndoDPObj; @@ -1593,8 +1593,8 @@ void ScDBDocFunc::UpdateImport( const OUString& rTarget, const svx::ODataAccessD const ScDBData* pData = rDBColl.getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rTarget)); if (!pData) { - ScopedVclPtr<InfoBox> aInfoBox(new InfoBox(rDocShell.GetActiveDialogParent(), - ScGlobal::GetRscString( STR_TARGETNOTFOUND ) )); + ScopedVclPtrInstance<InfoBox> aInfoBox( rDocShell.GetActiveDialogParent(), + ScGlobal::GetRscString( STR_TARGETNOTFOUND ) ); aInfoBox->Execute(); return; } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index f5491790b42d..b8fd016fb433 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -472,9 +472,9 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::uno::R { // Generator is not LibreOffice. Ask if the user wants to perform // full re-calculation. - ScopedVclPtr<QueryBox> aBox(new QueryBox( + ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), - ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS))); + ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS)); aBox->SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED)); bHardRecalc = aBox->Execute() == RET_YES; @@ -689,8 +689,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) ScAppOptions aAppOptions = SC_MOD()->GetAppOptions(); if ( aAppOptions.GetShowSharedDocumentWarning() ) { - ScopedVclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ), - ScGlobal::GetRscString( STR_SHARED_DOC_WARNING ) ) ); + ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_OK ), + ScGlobal::GetRscString( STR_SHARED_DOC_WARNING ) ); aBox->SetDefaultCheckBoxText(); aBox->Execute(); bool bChecked = aBox->GetCheckBoxState(); @@ -896,8 +896,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) } else { - ScopedVclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ), - ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) ) ); + ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_OK ), + ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) ); aBox->Execute(); SfxBindings* pBindings = GetViewBindings(); @@ -937,8 +937,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) { if ( GetDocument().GetExternalRefManager()->containsUnsavedReferences() ) { - ScopedVclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_YES_NO ), - ScGlobal::GetRscString( STR_UNSAVED_EXT_REF ) ) ); + ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_YES_NO ), + ScGlobal::GetRscString( STR_UNSAVED_EXT_REF ) ); if( RET_NO == aBox->Execute()) { diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 2c5ee559df01..66269ec2ebbb 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -1205,8 +1205,8 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell ) ScopedVclPtr<ScConflictsDlg> aDlg(new ScConflictsDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList ) ); if ( aDlg->Execute() == RET_CANCEL ) { - ScopedVclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), - ScGlobal::GetRscString( STR_DOC_WILLNOTBESAVED ) ) ); + ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), + ScGlobal::GetRscString( STR_DOC_WILLNOTBESAVED ) ); if ( aBox->Execute() == RET_YES ) { return false; diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 318e521df8a2..9fd3dee3ef76 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -427,8 +427,8 @@ void ScDocShell::Execute( SfxRequest& rReq ) if(nSet==LM_ON_DEMAND) { - ScopedVclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), - ScGlobal::GetRscString(STR_RELOAD_TABLES) ) ); + ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScGlobal::GetRscString(STR_RELOAD_TABLES) ); nDlgRet=aBox->Execute(); } @@ -476,8 +476,8 @@ void ScDocShell::Execute( SfxRequest& rReq ) OSL_ENSURE(pViewSh,"SID_REIMPORT_AFTER_LOAD: keine View"); if (pViewSh && pDBColl) { - ScopedVclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), - ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD) ) ); + ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), + ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD) ); if (aBox->Execute() == RET_YES) { ScDBCollection::NamedDBs& rDBs = pDBColl->getNamedDBs(); @@ -575,9 +575,9 @@ void ScDocShell::Execute( SfxRequest& rReq ) if ( !pItem ) { // no dialog on playing the macro - ScopedVclPtr<WarningBox> aBox(new WarningBox( pParent ? pParent : GetActiveDialogParent(), + ScopedVclPtrInstance<WarningBox> aBox( pParent ? pParent : GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_NO), - ScGlobal::GetRscString( STR_END_REDLINING ) ) ); + ScGlobal::GetRscString( STR_END_REDLINING ) ); bDo = ( aBox->Execute() == RET_YES ); } @@ -644,9 +644,9 @@ void ScDocShell::Execute( SfxRequest& rReq ) { if ( nSlot == SID_DOCUMENT_COMPARE ) { //! old changes trace will be lost - ScopedVclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), + ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_NO), - ScGlobal::GetRscString( STR_END_REDLINING ) ) ); + ScGlobal::GetRscString( STR_END_REDLINING ) ); if( aBox->Execute() == RET_YES ) bDo = ExecuteChangeProtectionDialog( NULL, true ); else @@ -924,8 +924,8 @@ void ScDocShell::Execute( SfxRequest& rReq ) bool bContinue = true; if ( HasName() ) { - ScopedVclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), - ScGlobal::GetRscString( STR_DOC_WILLBESAVED ) ) ); + ScopedVclPtrInstance<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), + ScGlobal::GetRscString( STR_DOC_WILLBESAVED ) ); if ( aBox->Execute() == RET_NO ) { bContinue = false; @@ -1021,8 +1021,8 @@ void ScDocShell::Execute( SfxRequest& rReq ) } else { - ScopedVclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), - ScGlobal::GetRscString( STR_DOC_DISABLESHARED ) ) ); + ScopedVclPtrInstance<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), + ScGlobal::GetRscString( STR_DOC_DISABLESHARED ) ); if ( aBox->Execute() == RET_YES ) { xCloseable->close( sal_True ); @@ -1055,8 +1055,8 @@ void ScDocShell::Execute( SfxRequest& rReq ) else { xCloseable->close( sal_True ); - ScopedVclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ), - ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) ) ); + ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), WinBits( WB_OK ), + ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) ); aBox->Execute(); } } @@ -1130,8 +1130,8 @@ bool ScDocShell::ExecuteChangeProtectionDialog( vcl::Window* _pParent, bool bJus OUString aText( ScResId( SCSTR_PASSWORD ) ); OUString aPassword; - ScopedVclPtr<SfxPasswordDialog> pDlg(new SfxPasswordDialog( - _pParent ? _pParent : GetActiveDialogParent(), &aText )); + ScopedVclPtrInstance<SfxPasswordDialog> pDlg( + _pParent ? _pParent : GetActiveDialogParent(), &aText ); pDlg->SetText( aTitle ); pDlg->SetMinLen( 1 ); pDlg->SetHelpId( GetStaticInterface()->GetSlot(SID_CHG_PROTECT)->GetCommand() ); @@ -1156,8 +1156,8 @@ bool ScDocShell::ExecuteChangeProtectionDialog( vcl::Window* _pParent, bool bJus } else { - ScopedVclPtr<InfoBox> aBox(new InfoBox( GetActiveDialogParent(), - OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ) ); + ScopedVclPtrInstance<InfoBox> aBox( GetActiveDialogParent(), + OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ); aBox->Execute(); } } @@ -1486,8 +1486,8 @@ void ScDocShell::PageStyleModified( const OUString& rStyleName, bool bApi ) if (bWarn && !bApi) { ScWaitCursorOff aWaitOff( GetActiveDialogParent() ); - ScopedVclPtr<InfoBox> aInfoBox(new InfoBox(GetActiveDialogParent(), - ScGlobal::GetRscString(STR_PRINT_INVALID_AREA))); + ScopedVclPtrInstance<InfoBox> aInfoBox(GetActiveDialogParent(), + ScGlobal::GetRscString(STR_PRINT_INVALID_AREA)); aInfoBox->Execute(); } } diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index 647b27147dda..db1b60b32f82 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -487,8 +487,8 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, bool bRecord ) if (bErr) { - ScopedVclPtr<InfoBox> aBox(new InfoBox( GetActiveDialogParent(), - ScGlobal::GetRscString( STR_CONSOLIDATE_ERR1 ) ) ); + ScopedVclPtrInstance<InfoBox> aBox( GetActiveDialogParent(), + ScGlobal::GetRscString( STR_CONSOLIDATE_ERR1 ) ); aBox->Execute(); return; } @@ -697,15 +697,15 @@ void ScDocShell::UseScenario( SCTAB nTab, const OUString& rName, bool bRecord ) } else { - ScopedVclPtr<InfoBox> aBox(new InfoBox( GetActiveDialogParent(), - ScGlobal::GetRscString( STR_PROTECTIONERR ) ) ); + ScopedVclPtrInstance<InfoBox> aBox( GetActiveDialogParent(), + ScGlobal::GetRscString( STR_PROTECTIONERR ) ); aBox->Execute(); } } else { - ScopedVclPtr<InfoBox> aBox(new InfoBox(GetActiveDialogParent(), - ScGlobal::GetRscString( STR_SCENARIO_NOTFOUND ) ) ); + ScopedVclPtrInstance<InfoBox> aBox(GetActiveDialogParent(), + ScGlobal::GetRscString( STR_SCENARIO_NOTFOUND ) ); aBox->Execute(); } } diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 1999aae2e1b4..22d51d2cb297 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -3020,8 +3020,8 @@ void ScExternalRefManager::Notify( SfxBroadcaster&, const SfxHint& rHint ) { SfxObjectShell* pObjShell = static_cast<const SfxEventHint&>( rHint ).GetObjShell(); ScDocShell* pDocShell = static_cast< ScDocShell* >( pObjShell ); - ScopedVclPtr<WarningBox> aBox(new WarningBox( pDocShell->GetActiveDialogParent(), WinBits( WB_OK ), - ScGlobal::GetRscString( STR_CLOSE_WITH_UNSAVED_REFS ) ) ); + ScopedVclPtrInstance<WarningBox> aBox( pDocShell->GetActiveDialogParent(), WinBits( WB_OK ), + ScGlobal::GetRscString( STR_CLOSE_WITH_UNSAVED_REFS ) ); aBox->Execute(); } break; diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 8b9b7551431c..b68471cb76b1 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -210,8 +210,8 @@ bool ScImportExport::StartPaste() ScEditableTester aTester( pDoc, aRange ); if ( !aTester.IsEditable() ) { - ScopedVclPtr<InfoBox> aInfoBox(new InfoBox(Application::GetDefDialogParent(), - ScGlobal::GetRscString( aTester.GetMessageId() ) ) ); + ScopedVclPtrInstance<InfoBox> aInfoBox( Application::GetDefDialogParent(), + ScGlobal::GetRscString( aTester.GetMessageId() ) ); aInfoBox->Execute(); return false; } diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx index aefc18b57c66..6a115706e598 100644 --- a/sc/source/ui/miscdlgs/scuiautofmt.cxx +++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx @@ -224,11 +224,11 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl) while ( !bOk ) { - VclPtr<ScStringInputDlg> pDlg(new ScStringInputDlg( this, - aStrTitle, - aStrLabel, - aFormatName, - HID_SC_ADD_AUTOFMT, HID_SC_AUTOFMT_NAME )); + VclPtrInstance<ScStringInputDlg> pDlg( this, + aStrTitle, + aStrLabel, + aFormatName, + HID_SC_ADD_AUTOFMT, HID_SC_AUTOFMT_NAME ); if ( pDlg->Execute() == RET_OK ) { @@ -331,11 +331,11 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl) OUString aFormatName = m_pLbFormat->GetSelectEntry(); OUString aEntry; - VclPtr<ScStringInputDlg> pDlg(new ScStringInputDlg( this, - aStrRename, - aStrLabel, - aFormatName, - HID_SC_REN_AFMT_DLG, HID_SC_REN_AFMT_NAME )); + VclPtrInstance<ScStringInputDlg> pDlg( this, + aStrRename, + aStrLabel, + aFormatName, + HID_SC_REN_AFMT_DLG, HID_SC_REN_AFMT_NAME ); if( pDlg->Execute() == RET_OK ) { bool bFmtRenamed = false; diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index 722bc70f9048..257ff8c67e70 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -191,7 +191,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( { if (pPrinter->GetName() != sPrinterName) { - VclPtr<SfxPrinter> pNewPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), sPrinterName ); + VclPtrInstance<SfxPrinter> pNewPrinter( pPrinter->GetOptions().Clone(), sPrinterName ); if (pNewPrinter->IsKnown()) pDocShell->SetPrinter( pNewPrinter, SfxPrinterChangeFlags::PRINTER ); else diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 10aa4fe49e5e..bf81d0cb7a2d 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1960,8 +1960,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if(!pCondFormatDlg && bContainsExistingCondFormat) { - ScopedVclPtr<QueryBox> aBox(new QueryBox( pTabViewShell->GetDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), - ScGlobal::GetRscString(STR_EDIT_EXISTING_COND_FORMATS) ) ); + ScopedVclPtrInstance<QueryBox> aBox( pTabViewShell->GetDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ), + ScGlobal::GetRscString(STR_EDIT_EXISTING_COND_FORMATS) ); bool bEditExisting = aBox->Execute() == RET_YES; if(bEditExisting) { |