[Libreoffice-commits] core.git: Branch 'feature/vclref' - basic/source chart2/source cppcanvas/qa cppcanvas/source cui/source dbaccess/source desktop/source extensions/source framework/source reportdesign/source sc/source

Michael Meeks michael.meeks at collabora.com
Tue Mar 31 12:54:10 PDT 2015


 basic/source/runtime/inputbox.cxx                            |    4 -
 chart2/source/controller/main/ChartController_Insert.cxx     |   20 +++--
 chart2/source/controller/main/ChartController_Properties.cxx |    7 +
 cppcanvas/qa/unit/test.cxx                                   |    2 
 cppcanvas/source/mtfrenderer/transparencygroupaction.cxx     |    4 -
 cui/source/customize/cfg.cxx                                 |    2 
 cui/source/dialogs/passwdomdlg.cxx                           |    4 -
 cui/source/dialogs/scriptdlg.cxx                             |    3 
 cui/source/options/optchart.cxx                              |    4 -
 cui/source/options/optlingu.cxx                              |    4 -
 cui/source/tabpages/tpbitmap.cxx                             |   13 +--
 cui/source/tabpages/tpcolor.cxx                              |   20 ++---
 cui/source/tabpages/tpgradnt.cxx                             |   14 +--
 cui/source/tabpages/tphatch.cxx                              |   14 +--
 cui/source/tabpages/tplnedef.cxx                             |   27 +++----
 cui/source/tabpages/tplneend.cxx                             |   25 +++---
 dbaccess/source/ui/app/AppControllerDnD.cxx                  |    5 -
 dbaccess/source/ui/browser/brwctrlr.cxx                      |    6 -
 dbaccess/source/ui/dlg/indexdialog.cxx                       |    4 -
 dbaccess/source/ui/misc/DExport.cxx                          |    6 -
 dbaccess/source/ui/misc/UITools.cxx                          |    5 -
 dbaccess/source/ui/querydesign/querycontroller.cxx           |    8 +-
 dbaccess/source/ui/relationdesign/RelationController.cxx     |    4 -
 dbaccess/source/ui/tabledesign/TableController.cxx           |   14 +--
 desktop/source/app/lockfile2.cxx                             |    4 -
 desktop/source/deployment/gui/dp_gui_dialog2.cxx             |   17 ++--
 desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx   |    4 -
 extensions/source/propctrlr/formcomponenthandler.cxx         |    4 -
 extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx |    4 -
 framework/source/services/autorecovery.cxx                   |    4 -
 reportdesign/source/ui/misc/UITools.cxx                      |    5 -
 reportdesign/source/ui/report/ReportController.cxx           |    4 -
 sc/source/filter/oox/workbookhelper.cxx                      |    4 -
 sc/source/ui/condformat/condformatmgr.cxx                    |    8 +-
 sc/source/ui/docshell/arealink.cxx                           |    4 -
 sc/source/ui/docshell/dbdocfun.cxx                           |   16 ++--
 sc/source/ui/docshell/docsh.cxx                              |   16 ++--
 sc/source/ui/docshell/docsh3.cxx                             |    4 -
 sc/source/ui/docshell/docsh4.cxx                             |   40 +++++------
 sc/source/ui/docshell/docsh5.cxx                             |   12 +--
 sc/source/ui/docshell/externalrefmgr.cxx                     |    4 -
 sc/source/ui/docshell/impex.cxx                              |    4 -
 sc/source/ui/miscdlgs/scuiautofmt.cxx                        |   20 ++---
 sc/source/ui/unoobj/confuno.cxx                              |    2 
 sc/source/ui/view/cellsh1.cxx                                |    4 -
 45 files changed, 206 insertions(+), 197 deletions(-)

New commits:
commit d9e30d67348ae9496e96c649229084726f0f6d14
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Tue Mar 31 20:57:16 2015 +0100

    first half of non-scriptable, Instance constructor conversion.
    
    Change-Id: If73bb41bfa805e22609748f25971724b4778edb3

diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx
index eef9ae6..21f677e 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 ac8ba5e..62109ee 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 a1be8de..6ed346e 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 684980a..fa7b21e 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 74a9505..51a8c32b 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 aab4a97..92d8005 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 e59e581..eade758 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 1e456f2..fa89985 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -1503,11 +1503,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 9cd6ee8..1f41336 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 c3e94f5..00f747f 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1687,8 +1687,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 b0fd1be..36a7c6a 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 5176a08..e28adc7a 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 f4e164b..4692f06 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 146bbdd..a2d40ff 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 807f6e4..e5e32b3 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 8f933e3..02c922c 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 3e1550e..4c33f61 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 78ca4da..21f9dad 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 23e003b..68d2a1c 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 ba1352b..7f7f51a 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 4de5480..dcb6c25 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 a6d4c4e..61d23d9 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 8415437..f9a9dcf 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 26a2186..6b1225a 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:
@@ -947,7 +947,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 679258c..7636431 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 d7d72a2..c2c61ce 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 7f8fd56..338b5b9 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 0cc5992..a1c99b4 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 c52a9fc..5d01cc8 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 dbe4819..e9d48ce 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 ea6fbec..a55b9e1 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -1028,8 +1028,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 96452c5..04d4f42 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2496,9 +2496,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 1ffc85d..4df0a65 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 d75a39d..8725494 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -175,8 +175,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)
     {
@@ -221,8 +221,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 3100389..09af394 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 4a92981..d8e6381 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 e39de5c..2126a1b 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 444213a..4d7c965 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 3cef4c5..e6bfcb4 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -430,8 +430,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();
                 }
@@ -479,8 +479,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();
@@ -578,9 +578,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 647b271..db1b60b 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 0c8bd19..2e8940e 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -3015,8 +3015,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 8bc885d..89c5d66 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 a170233..50a2402 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 731d171..78c3609 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -178,7 +178,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, SFX_PRINTER_PRINTER );
                             else
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index dd17cc5..9b3e4b4 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)
                         {


More information about the Libreoffice-commits mailing list