summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--avmedia/source/viewer/mediawindow.cxx2
-rw-r--r--basctl/source/basicide/baside2.cxx4
-rw-r--r--basctl/source/basicide/baside2b.cxx4
-rw-r--r--basctl/source/basicide/baside3.cxx4
-rw-r--r--basctl/source/basicide/basides1.cxx4
-rw-r--r--basctl/source/basicide/basobj2.cxx4
-rw-r--r--basctl/source/basicide/basobj3.cxx4
-rw-r--r--basctl/source/basicide/bastypes.cxx6
-rw-r--r--basctl/source/basicide/macrodlg.cxx2
-rw-r--r--basctl/source/basicide/moduldl2.cxx6
-rw-r--r--basctl/source/basicide/moduldlg.cxx4
-rw-r--r--basctl/source/dlged/managelang.cxx4
-rw-r--r--basic/source/runtime/iosys.cxx2
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx2
-rw-r--r--canvas/source/opengl/ogl_canvashelper.cxx2
-rw-r--r--canvas/source/vcl/canvasfont.cxx2
-rw-r--r--canvas/source/vcl/canvashelper_texturefill.cxx2
-rw-r--r--canvas/source/vcl/textlayout.cxx6
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.cxx2
-rw-r--r--chart2/source/controller/drawinglayer/ViewElementListProvider.cxx2
-rw-r--r--chart2/source/controller/main/ChartController.cxx4
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx6
-rw-r--r--chart2/source/controller/main/ChartController_Properties.cxx2
-rw-r--r--chart2/source/view/main/3DChartObjects.cxx2
-rw-r--r--chart2/source/view/main/DummyXShape.cxx2
-rw-r--r--chart2/source/view/main/OpenGLRender.cxx2
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx2
-rw-r--r--cui/source/customize/cfg.cxx23
-rw-r--r--cui/source/customize/macropg.cxx4
-rw-r--r--cui/source/dialogs/SpellDialog.cxx2
-rw-r--r--cui/source/dialogs/about.cxx2
-rw-r--r--cui/source/dialogs/colorpicker.cxx2
-rw-r--r--cui/source/dialogs/cuigaldlg.cxx2
-rw-r--r--cui/source/dialogs/hangulhanjadlg.cxx6
-rw-r--r--cui/source/dialogs/hldocntp.cxx2
-rw-r--r--cui/source/dialogs/hltpbase.cxx2
-rw-r--r--cui/source/dialogs/linkdlg.cxx4
-rw-r--r--cui/source/dialogs/passwdomdlg.cxx2
-rw-r--r--cui/source/dialogs/scriptdlg.cxx10
-rw-r--r--cui/source/factory/init.cxx2
-rw-r--r--cui/source/options/dbregister.cxx4
-rw-r--r--cui/source/options/doclinkdialog.cxx6
-rw-r--r--cui/source/options/optcolor.cxx8
-rw-r--r--cui/source/options/optdict.cxx2
-rw-r--r--cui/source/options/optgdlg.cxx2
-rw-r--r--cui/source/options/optinet2.cxx6
-rw-r--r--cui/source/options/optjava.cxx10
-rw-r--r--cui/source/options/optlingu.cxx4
-rw-r--r--cui/source/options/optopencl.cxx2
-rw-r--r--cui/source/options/personalization.cxx2
-rw-r--r--cui/source/tabpages/autocdlg.cxx6
-rw-r--r--cui/source/tabpages/chardlg.cxx2
-rw-r--r--cui/source/tabpages/grfpage.cxx2
-rw-r--r--cui/source/tabpages/numpages.cxx4
-rw-r--r--cui/source/tabpages/tpbitmap.cxx2
-rw-r--r--cui/source/tabpages/tpcolor.cxx2
-rw-r--r--cui/source/tabpages/tpgradnt.cxx2
-rw-r--r--cui/source/tabpages/tphatch.cxx2
-rw-r--r--cui/source/tabpages/tpline.cxx4
-rw-r--r--dbaccess/source/ext/macromigration/macromigrationdialog.cxx2
-rw-r--r--dbaccess/source/ui/app/AppControllerDnD.cxx4
-rw-r--r--dbaccess/source/ui/app/AppControllerGen.cxx4
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx6
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx4
-rw-r--r--dbaccess/source/ui/dlg/CollectionView.cxx2
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx6
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPage.cxx2
-rw-r--r--dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx4
-rw-r--r--dbaccess/source/ui/dlg/UserAdmin.cxx8
-rw-r--r--dbaccess/source/ui/dlg/adminpages.cxx6
-rw-r--r--dbaccess/source/ui/dlg/detailpages.cxx4
-rw-r--r--dbaccess/source/ui/dlg/directsql.cxx2
-rw-r--r--dbaccess/source/ui/dlg/generalpage.cxx2
-rw-r--r--dbaccess/source/ui/dlg/indexdialog.cxx8
-rw-r--r--dbaccess/source/ui/dlg/sqlmessage.cxx2
-rw-r--r--dbaccess/source/ui/dlg/tablespage.cxx2
-rw-r--r--dbaccess/source/ui/misc/DExport.cxx2
-rw-r--r--dbaccess/source/ui/misc/RowSetDrop.cxx2
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx6
-rw-r--r--dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryTableView.cxx6
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx6
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx2
-rw-r--r--dbaccess/source/ui/relationdesign/RelationTableView.cxx10
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx16
-rw-r--r--dbaccess/source/ui/uno/dbinteraction.cxx6
-rw-r--r--desktop/source/app/app.cxx4
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx4
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx4
-rw-r--r--desktop/source/lib/init.cxx2
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx2
-rw-r--r--drawinglayer/source/primitive2d/controlprimitive2d.cxx2
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx4
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx4
-rw-r--r--drawinglayer/source/tools/converters.cxx2
-rw-r--r--editeng/source/editeng/editeng.cxx2
-rw-r--r--editeng/source/misc/splwrap.cxx2
-rw-r--r--extensions/source/abpilot/typeselectionpage.cxx2
-rw-r--r--extensions/source/bibliography/bibview.cxx2
-rw-r--r--extensions/source/bibliography/datman.cxx4
-rw-r--r--extensions/source/propctrlr/browserlistbox.cxx2
-rw-r--r--extensions/source/propctrlr/commoncontrol.cxx2
-rw-r--r--extensions/source/propctrlr/formcomponenthandler.cxx8
-rw-r--r--extensions/source/scanner/sanedlg.cxx10
-rw-r--r--extensions/source/scanner/scanunx.cxx2
-rw-r--r--filter/source/graphic/GraphicExportDialog.cxx2
-rw-r--r--filter/source/graphicfilter/eos2met/eos2met.cxx10
-rw-r--r--filter/source/graphicfilter/epict/epict.cxx10
-rw-r--r--filter/source/graphicfilter/eps/eps.cxx10
-rw-r--r--filter/source/graphicfilter/ieps/ieps.cxx4
-rw-r--r--filter/source/msfilter/escherex.cxx2
-rw-r--r--filter/source/msfilter/msdffimp.cxx2
-rw-r--r--filter/source/pdf/impdialog.cxx4
-rw-r--r--filter/source/pdf/pdfinteract.cxx2
-rw-r--r--filter/source/svg/svgfontexport.cxx4
-rw-r--r--filter/source/xsltdialog/xmlfiltersettingsdialog.cxx12
-rw-r--r--filter/source/xsltdialog/xmlfiltertabdialog.cxx2
-rw-r--r--forms/source/runtime/formoperations.cxx2
-rw-r--r--fpicker/source/office/PlacesListBox.cxx2
-rw-r--r--fpicker/source/office/iodlg.cxx10
-rw-r--r--lotuswordpro/source/filter/lwppagelayout.cxx2
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx2
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx6
-rw-r--r--sc/source/core/data/documen8.cxx2
-rw-r--r--sc/source/core/data/dpobject.cxx2
-rw-r--r--sc/source/core/data/global.cxx2
-rw-r--r--sc/source/core/data/validat.cxx6
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx2
-rw-r--r--sc/source/ui/app/transobj.cxx4
-rw-r--r--sc/source/ui/cctrl/tbzoomsliderctrl.cxx2
-rw-r--r--sc/source/ui/condformat/colorformat.cxx2
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx2
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx2
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx4
-rw-r--r--sc/source/ui/docshell/docsh.cxx4
-rw-r--r--sc/source/ui/docshell/docsh3.cxx6
-rw-r--r--sc/source/ui/docshell/docsh4.cxx6
-rw-r--r--sc/source/ui/docshell/docsh5.cxx2
-rw-r--r--sc/source/ui/docshell/docsh6.cxx2
-rw-r--r--sc/source/ui/docshell/documentlinkmgr.cxx2
-rw-r--r--sc/source/ui/docshell/impex.cxx2
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx2
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx2
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx6
-rw-r--r--sc/source/ui/miscdlgs/retypepassdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx4
-rw-r--r--sc/source/ui/optdlg/tpformula.cxx2
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx2
-rw-r--r--sc/source/ui/undo/undobase.cxx4
-rw-r--r--sc/source/ui/undo/undoblk.cxx2
-rw-r--r--sc/source/ui/undo/undoblk3.cxx2
-rw-r--r--sc/source/ui/undo/undostyl.cxx2
-rw-r--r--sc/source/ui/unoobj/styleuno.cxx8
-rw-r--r--sc/source/ui/view/cellsh1.cxx2
-rw-r--r--sc/source/ui/view/cellsh2.cxx2
-rw-r--r--sc/source/ui/view/tabview2.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx8
-rw-r--r--sc/source/ui/view/tabvwshh.cxx2
-rw-r--r--sc/source/ui/view/viewfun3.cxx2
-rw-r--r--sc/source/ui/view/viewfun4.cxx4
-rw-r--r--sc/source/ui/view/viewfunc.cxx4
-rw-r--r--sd/source/core/drawdoc3.cxx2
-rw-r--r--sd/source/filter/grf/sdgrffilter.cxx2
-rw-r--r--sd/source/filter/html/buttonset.cxx2
-rw-r--r--sd/source/filter/html/htmlex.cxx2
-rw-r--r--sd/source/filter/html/pubdlg.cxx2
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx2
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx4
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx2
-rw-r--r--sd/source/ui/annotations/annotationmanager.cxx2
-rw-r--r--sd/source/ui/annotations/annotationtag.cxx2
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.cxx4
-rw-r--r--sd/source/ui/dlg/animobjs.cxx4
-rw-r--r--sd/source/ui/dlg/brkdlg.cxx2
-rw-r--r--sd/source/ui/dlg/custsdlg.cxx4
-rw-r--r--sd/source/ui/dlg/docprev.cxx2
-rw-r--r--sd/source/ui/dlg/sdpreslt.cxx2
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx2
-rw-r--r--sd/source/ui/dlg/tpoption.cxx2
-rw-r--r--sd/source/ui/docshell/docshel2.cxx2
-rw-r--r--sd/source/ui/func/fuinsert.cxx2
-rw-r--r--sd/source/ui/func/fuinsfil.cxx6
-rw-r--r--sd/source/ui/slideshow/showwin.cxx2
-rw-r--r--sd/source/ui/slidesorter/controller/SlsClipboard.cxx2
-rw-r--r--sd/source/ui/view/Outliner.cxx4
-rw-r--r--sd/source/ui/view/drviews2.cxx2
-rw-r--r--sd/source/ui/view/drviews6.cxx2
-rw-r--r--sd/source/ui/view/drviews9.cxx2
-rw-r--r--sfx2/source/appl/appopen.cxx2
-rw-r--r--sfx2/source/appl/appserv.cxx6
-rw-r--r--sfx2/source/appl/impldde.cxx2
-rw-r--r--sfx2/source/appl/newhelp.cxx8
-rw-r--r--sfx2/source/appl/opengrf.cxx2
-rw-r--r--sfx2/source/appl/sfxhelp.cxx2
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx2
-rw-r--r--sfx2/source/dialog/backingwindow.cxx2
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx2
-rw-r--r--sfx2/source/dialog/mailmodel.cxx2
-rw-r--r--sfx2/source/dialog/mgetempl.cxx6
-rw-r--r--sfx2/source/dialog/passwd.cxx2
-rw-r--r--sfx2/source/dialog/recfloat.cxx2
-rw-r--r--sfx2/source/dialog/securitypage.cxx2
-rw-r--r--sfx2/source/dialog/templdlg.cxx2
-rw-r--r--sfx2/source/dialog/versdlg.cxx6
-rw-r--r--sfx2/source/doc/QuerySaveDocument.cxx2
-rw-r--r--sfx2/source/doc/docinsert.cxx2
-rw-r--r--sfx2/source/doc/doctemplates.cxx3
-rw-r--r--sfx2/source/doc/guisaveas.cxx2
-rw-r--r--sfx2/source/doc/objcont.cxx4
-rw-r--r--sfx2/source/doc/objserv.cxx14
-rw-r--r--sfx2/source/doc/objstor.cxx2
-rw-r--r--sfx2/source/doc/templatedlg.cxx20
-rw-r--r--sfx2/source/view/viewsh.cxx6
-rw-r--r--slideshow/source/engine/rehearsetimingsactivity.cxx4
-rw-r--r--slideshow/source/engine/shapes/gdimtftools.cxx4
-rw-r--r--starmath/qa/cppunit/test_nodetotextvisitors.cxx8
-rw-r--r--starmath/source/document.cxx8
-rw-r--r--svtools/source/contnr/fileview.cxx2
-rw-r--r--svtools/source/graphic/grfmgr2.cxx2
-rw-r--r--svtools/source/graphic/provider.cxx2
-rw-r--r--svtools/source/java/javainteractionhandler.cxx10
-rw-r--r--svtools/source/misc/sampletext.cxx2
-rw-r--r--svtools/source/table/gridtablerenderer.cxx2
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx4
-rw-r--r--svx/source/dialog/_bmpmask.cxx2
-rw-r--r--svx/source/dialog/_contdlg.cxx10
-rw-r--r--svx/source/dialog/dlgctrl.cxx8
-rw-r--r--svx/source/dialog/docrecovery.cxx8
-rw-r--r--svx/source/dialog/imapdlg.cxx4
-rw-r--r--svx/source/dialog/svxruler.cxx2
-rw-r--r--svx/source/form/databaselocationinput.cxx2
-rw-r--r--svx/source/form/datanavi.cxx42
-rw-r--r--svx/source/gallery2/galobj.cxx2
-rw-r--r--svx/source/gallery2/galtheme.cxx2
-rw-r--r--svx/source/svdraw/svdfmtf.cxx2
-rw-r--r--svx/source/svdraw/svdograf.cxx2
-rw-r--r--svx/source/svdraw/svdotext.cxx2
-rw-r--r--svx/source/svdraw/svdtrans.cxx4
-rw-r--r--svx/source/svdraw/svdxcgv.cxx4
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx2
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx2
-rw-r--r--svx/source/tbxctrls/linectrl.cxx2
-rw-r--r--svx/source/toolbars/extrusionbar.cxx2
-rw-r--r--svx/source/toolbars/fontworkbar.cxx4
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx4
-rw-r--r--svx/source/unodraw/unoshape.cxx2
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx4
-rw-r--r--svx/workben/pixelctl.cxx2
-rw-r--r--sw/qa/tiledrendering/tiledrendering.cxx2
-rw-r--r--sw/source/core/doc/DocumentRedlineManager.cxx2
-rw-r--r--sw/source/ui/config/mailconfigpage.cxx2
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx2
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx2
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx2
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.cxx2
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx10
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.cxx2
-rw-r--r--sw/source/ui/dbui/selectdbtabledialog.cxx2
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx8
-rw-r--r--sw/source/ui/envelp/envfmt.cxx2
-rw-r--r--sw/source/ui/envelp/envprt.cxx2
-rw-r--r--sw/source/ui/envelp/label1.cxx2
-rw-r--r--sw/source/ui/envelp/labfmt.cxx2
-rw-r--r--sw/source/ui/envelp/labprt.cxx2
-rw-r--r--sw/source/ui/fmtui/tmpdlg.cxx2
-rw-r--r--sw/source/ui/frmdlg/cption.cxx6
-rw-r--r--sw/source/ui/index/cnttab.cxx2
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx4
-rw-r--r--sw/source/ui/misc/glosbib.cxx2
-rw-r--r--sw/source/ui/misc/glossary.cxx6
-rw-r--r--sw/source/ui/misc/num.cxx2
-rw-r--r--sw/source/ui/misc/outline.cxx4
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx4
-rw-r--r--sw/source/uibase/lingu/olmenu.cxx2
-rw-r--r--sw/source/uibase/shells/grfsh.cxx2
-rw-r--r--sw/source/uibase/uiview/view2.cxx12
-rw-r--r--sw/source/uibase/uiview/viewdraw.cxx2
-rw-r--r--sw/source/uibase/uiview/viewling.cxx2
-rw-r--r--sw/source/uibase/uiview/viewprt.cxx2
-rw-r--r--sw/source/uibase/utlui/gloslst.cxx2
-rw-r--r--uui/source/iahndl.cxx2
-rw-r--r--uui/source/masterpasscrtdlg.cxx2
-rw-r--r--uui/source/masterpassworddlg.cxx2
-rw-r--r--uui/source/nameclashdlg.cxx2
-rw-r--r--uui/source/passworddlg.cxx4
-rw-r--r--writerperfect/source/writer/WordPerfectImportFilter.cxx4
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx8
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx2
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx5
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx6
-rw-r--r--xmlsecurity/source/dialogs/macrosecurity.cxx2
293 files changed, 554 insertions, 551 deletions
diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index be2f4cf9bdec..402344780a8c 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -327,7 +327,7 @@ bool MediaWindow::executeMediaURLDialog(vcl::Window* /* pParent */,
void MediaWindow::executeFormatErrorBox( vcl::Window* pParent )
{
- ScopedVclPtr<MessageDialog> aErrBox(new MessageDialog( pParent, AVMEDIA_RESID( AVMEDIA_STR_ERR_URL ) ) );
+ ScopedVclPtrInstance< MessageDialog > aErrBox( pParent, AVMEDIA_RESID( AVMEDIA_STR_ERR_URL ) );
aErrBox->Execute();
aErrBox.disposeAndClear();
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 25c3b5c80510..df27e30983a8 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -619,7 +619,7 @@ void ModulWindow::BasicToggleBreakPointEnabled()
void ModulWindow::ManageBreakPoints()
{
BreakPointWindow& rBrkWin = GetBreakPointWindow();
- ScopedVclPtr<BreakPointDialog> aBrkDlg(new BreakPointDialog( &rBrkWin, GetBreakPoints() ));
+ ScopedVclPtrInstance< BreakPointDialog > aBrkDlg( &rBrkWin, GetBreakPoints() );
aBrkDlg->Execute();
rBrkWin.Invalidate();
}
@@ -1043,7 +1043,7 @@ void ModulWindow::ExecuteCommand (SfxRequest& rReq)
break;
case SID_GOTOLINE:
{
- ScopedVclPtr<GotoLineDialog> aGotoDlg(new GotoLineDialog(this));
+ ScopedVclPtrInstance< GotoLineDialog > aGotoDlg(this);
if (aGotoDlg->Execute())
if (sal_Int32 const nLine = aGotoDlg->GetLineNumber())
{
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 3456cfd78c77..e7784af04dc2 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1520,7 +1520,7 @@ void BreakPointWindow::Command( const CommandEvent& rCEvt )
break;
case RID_BRKPROPS:
{
- ScopedVclPtr<BreakPointDialog> aBrkDlg(new BreakPointDialog( this, GetBreakPoints() ));
+ ScopedVclPtrInstance< BreakPointDialog > aBrkDlg( this, GetBreakPoints() );
aBrkDlg->SetCurrentBreakPoint( pBrk );
aBrkDlg->Execute();
Invalidate();
@@ -1535,7 +1535,7 @@ void BreakPointWindow::Command( const CommandEvent& rCEvt )
{
case RID_BRKDLG:
{
- ScopedVclPtr<BreakPointDialog> aBrkDlg(new BreakPointDialog( this, GetBreakPoints() ));
+ ScopedVclPtrInstance< BreakPointDialog > aBrkDlg( this, GetBreakPoints() );
aBrkDlg->Execute();
Invalidate();
}
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index 52d173bf87ef..fb497e153318 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -1024,7 +1024,7 @@ bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const Script
OUString aQueryBoxText(IDE_RESSTR(RID_STR_DLGIMP_CLASH_TEXT));
aQueryBoxText = aQueryBoxText.replaceAll("$(ARG1)", aXmlDlgName);
- ScopedVclPtr<NameClashQueryBox> aQueryBox(new NameClashQueryBox( pWin, aQueryBoxTitle, aQueryBoxText ));
+ ScopedVclPtrInstance< NameClashQueryBox > aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
sal_uInt16 nRet = aQueryBox->Execute();
if( RET_YES == nRet )
{
@@ -1086,7 +1086,7 @@ bool implImportDialog( vcl::Window* pWin, const OUString& rCurPath, const Script
{
OUString aQueryBoxTitle(IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_TITLE));
OUString aQueryBoxText(IDE_RESSTR(RID_STR_DLGIMP_MISMATCH_TEXT));
- ScopedVclPtr<LanguageMismatchQueryBox> aQueryBox(new LanguageMismatchQueryBox( pWin, aQueryBoxTitle, aQueryBoxText ));
+ ScopedVclPtrInstance< LanguageMismatchQueryBox > aQueryBox( pWin, aQueryBoxTitle, aQueryBoxText );
sal_uInt16 nRet = aQueryBox->Execute();
if( RET_YES == nRet )
{
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 139b1a369a5e..49d5a1c21fdb 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -136,7 +136,7 @@ void Shell::ExecuteCurrent( SfxRequest& rReq )
SfxViewFrame* pViewFrame = GetViewFrame();
SfxChildWindow* pChildWin = pViewFrame ? pViewFrame->GetChildWindow( SID_SEARCH_DLG ) : NULL;
vcl::Window* pParent = pChildWin ? pChildWin->GetWindow() : NULL;
- ScopedVclPtr<QueryBox> aQuery(new QueryBox(pParent, WB_YES_NO|WB_DEF_YES, IDE_RESSTR(RID_STR_SEARCHFROMSTART)));
+ ScopedVclPtrInstance< QueryBox > aQuery(pParent, WB_YES_NO|WB_DEF_YES, IDE_RESSTR(RID_STR_SEARCHFROMSTART));
if ( aQuery->Execute() == RET_YES )
{
it = aWindowTable.begin();
@@ -676,7 +676,7 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
case SID_BASICIDE_MANAGE_LANG:
{
- ScopedVclPtr<ManageLanguageDialog> aDlg(new ManageLanguageDialog(pCurWin, m_pCurLocalizationMgr));
+ ScopedVclPtrInstance< ManageLanguageDialog > aDlg(pCurWin, m_pCurLocalizationMgr);
aDlg->Execute();
rReq.Done();
}
diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx
index f8169374db5b..81b22ce0d4fa 100644
--- a/basctl/source/basicide/basobj2.cxx
+++ b/basctl/source/basicide/basobj2.cxx
@@ -149,7 +149,7 @@ bool RenameModule (
if ( rDocument.hasModule( rLibName, rNewName ) )
{
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2)));
+ ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2));
aError->Execute();
return false;
}
@@ -157,7 +157,7 @@ bool RenameModule (
// #i74440
if ( rNewName.isEmpty() )
{
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME)));
+ ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME));
aError->Execute();
return false;
}
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index e7a7f0513e16..0634b863c029 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -155,7 +155,7 @@ bool RenameDialog (
if ( rDocument.hasDialog( rLibName, rNewName ) )
{
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2)));
+ ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDE_RESSTR(RID_STR_SBXNAMEALLREADYUSED2));
aError->Execute();
return false;
}
@@ -163,7 +163,7 @@ bool RenameDialog (
// #i74440
if ( rNewName.isEmpty() )
{
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME)));
+ ScopedVclPtrInstance< MessageDialog > aError(pErrorParent, IDE_RESSTR(RID_STR_BADSBXNAME));
aError->Execute();
return false;
}
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 67d4c5482378..17363071ff24 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -803,7 +803,7 @@ bool QueryDel( const OUString& rName, const ResId& rId, vcl::Window* pParent )
aNameBuf.append('\'');
aNameBuf.insert(0, '\'');
aQuery = aQuery.replaceAll("XX", aNameBuf.makeStringAndClear());
- ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog(pParent, aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQueryBox(pParent, aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
return ( aQueryBox->Execute() == RET_YES );
}
@@ -840,7 +840,7 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
do
{
// password dialog
- ScopedVclPtr<SfxPasswordDialog> aDlg(new SfxPasswordDialog(Application::GetDefDialogParent()));
+ ScopedVclPtrInstance< SfxPasswordDialog > aDlg(Application::GetDefDialogParent());
aDlg->SetMinLen( 1 );
// set new title
@@ -868,7 +868,7 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
if ( !bOK )
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(Application::GetDefDialogParent(), IDE_RESSTR(RID_STR_WRONGPASSWORD)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(Application::GetDefDialogParent(), IDE_RESSTR(RID_STR_WRONGPASSWORD));
aErrorBox->Execute();
}
}
diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx
index ce39d72b1c05..eb5677afab09 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -777,7 +777,7 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton )
StoreMacroDescription();
EntryDescriptor aDesc = m_pBasicBox->GetEntryDescriptor(m_pBasicBox->FirstSelected());
- VclPtr<OrganizeDialog> pDlg(new OrganizeDialog( this, 0, aDesc ));
+ VclPtrInstance< OrganizeDialog > pDlg( this, 0, aDesc );
sal_uInt16 nRet = pDlg->Execute();
pDlg.reset();
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 57352492f1f3..a4abe70644af 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -688,7 +688,7 @@ IMPL_LINK( LibPage, ButtonHdl, Button *, pButton )
bool const bProtected = xPasswd->isLibraryPasswordProtected( aLibName );
// change password dialog
- VclPtr<SvxPasswordDialog> pDlg(new SvxPasswordDialog( this, true, !bProtected ));
+ VclPtrInstance< SvxPasswordDialog > pDlg( this, true, !bProtected );
pDlg->SetCheckPasswordHdl( LINK( this, LibPage, CheckPasswordHdl ) );
if ( pDlg->Execute() == RET_OK )
@@ -1128,7 +1128,7 @@ void LibPage::Export( void )
return;
}
- ScopedVclPtr<ExportDialog> aNewDlg(new ExportDialog(this));
+ ScopedVclPtrInstance< ExportDialog > aNewDlg(this);
if (aNewDlg->Execute() == RET_OK)
{
try
@@ -1504,7 +1504,7 @@ void createLibImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
i++;
}
- ScopedVclPtr<NewObjectDialog> aNewDlg(new NewObjectDialog(pWin, ObjectMode::Library));
+ ScopedVclPtrInstance< NewObjectDialog > aNewDlg(pWin, ObjectMode::Library);
aNewDlg->SetObjectName(aLibName);
if (aNewDlg->Execute())
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index 67e3915edcc8..2e633512832c 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -825,7 +825,7 @@ void ObjectPage::NewDialog()
{
aDocument.getOrCreateLibrary( E_DIALOGS, aLibName );
- ScopedVclPtr<NewObjectDialog> aNewDlg(new NewObjectDialog(this, ObjectMode::Dialog, true));
+ ScopedVclPtrInstance< NewObjectDialog > aNewDlg(this, ObjectMode::Dialog, true);
aNewDlg->SetObjectName( aDocument.createObjectName( E_DIALOGS, aLibName ) );
if (aNewDlg->Execute() != 0)
@@ -983,7 +983,7 @@ SbModule* createModImpl( vcl::Window* pWin, const ScriptDocument& rDocument,
if ( aModName.isEmpty() )
aModName = rDocument.createObjectName( E_SCRIPTS, aLibName );
- ScopedVclPtr<NewObjectDialog> aNewDlg(new NewObjectDialog(pWin, ObjectMode::Module, true));
+ ScopedVclPtrInstance< NewObjectDialog > aNewDlg(pWin, ObjectMode::Module, true);
aNewDlg->SetObjectName( aModName );
if (aNewDlg->Execute() != 0)
diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx
index a3ee64950c8d..eb4632366a23 100644
--- a/basctl/source/dlged/managelang.cxx
+++ b/basctl/source/dlged/managelang.cxx
@@ -146,7 +146,7 @@ void ManageLanguageDialog::ClearLanguageBox()
IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl)
{
- ScopedVclPtr<SetDefaultLanguageDialog> aDlg(new SetDefaultLanguageDialog( this, m_xLocalizationMgr ));
+ ScopedVclPtrInstance< SetDefaultLanguageDialog > aDlg( this, m_xLocalizationMgr );
if ( RET_OK == aDlg->Execute() )
{
// add new locales
@@ -164,7 +164,7 @@ IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl)
IMPL_LINK_NOARG(ManageLanguageDialog, DeleteHdl)
{
- ScopedVclPtr<MessageDialog> aQBox(new MessageDialog(this, "DeleteLangDialog", "modules/BasicIDE/ui/deletelang.ui"));
+ ScopedVclPtrInstance< MessageDialog > aQBox(this, "DeleteLangDialog", "modules/BasicIDE/ui/deletelang.ui");
if ( aQBox->Execute() == RET_OK )
{
sal_uInt16 i, nCount = m_pLanguageLB->GetSelectEntryCount();
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 5b4addae4657..45a273fb0e02 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -966,7 +966,7 @@ void SbiIoSystem::CloseAll(void)
void SbiIoSystem::ReadCon(OString& rIn)
{
OUString aPromptStr(OStringToOUString(aPrompt, osl_getThreadTextEncoding()));
- ScopedVclPtr<SbiInputDialog> aDlg(new SbiInputDialog(NULL, aPromptStr) );
+ ScopedVclPtrInstance< SbiInputDialog > aDlg(nullptr, aPromptStr);
if( aDlg->Execute() )
{
rIn = OUStringToOString(aDlg->GetInput(), osl_getThreadTextEncoding());
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index dd428a17af09..03d319473e7c 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -179,7 +179,7 @@ namespace cairocanvas
if( !pOutDev )
return geometry::RealRectangle2D();
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *pOutDev ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *pOutDev );
pVDev->SetFont( mpFont->getVCLFont() );
// need metrics for Y offset, the XCanvas always renders
diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx
index 6a75c8f9144c..501e7f83fe6b 100644
--- a/canvas/source/opengl/ogl_canvashelper.cxx
+++ b/canvas/source/opengl/ogl_canvashelper.cxx
@@ -725,7 +725,7 @@ namespace oglcanvas
if( mpDevice )
{
- ScopedVclPtr<VirtualDevice> pVDev(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
pVDev->EnableOutput(false);
CanvasFont* pFont=dynamic_cast<CanvasFont*>(xLayoutetText->getFont().get());
diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx
index 8930748af984..aa28e3bd4ab6 100644
--- a/canvas/source/vcl/canvasfont.cxx
+++ b/canvas/source/vcl/canvasfont.cxx
@@ -121,7 +121,7 @@ namespace vclcanvas
SolarMutexGuard aGuard;
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( rOutDev ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( rOutDev );
pVDev->SetFont(getVCLFont());
const ::FontMetric& aMetric( pVDev->GetFontMetric() );
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index ea7889042465..b46746e2cf8b 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -1026,7 +1026,7 @@ namespace vclcanvas
// cannot do direct XOR, but have to
// prepare the filled polygon within a
// VDev
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( rOutDev ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( rOutDev );
pVDev->SetOutputSizePixel( aPolygonDeviceRect.GetSize() );
// shift output to origin of VDev
diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx
index c3efe7745053..6cf534220e26 100644
--- a/canvas/source/vcl/textlayout.cxx
+++ b/canvas/source/vcl/textlayout.cxx
@@ -104,7 +104,7 @@ namespace vclcanvas
SolarMutexGuard aGuard;
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( rOutDev ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( rOutDev );
pVDev->SetFont( mpFont->getVCLFont() );
setupLayoutMode( *pVDev.get(), mnTextDirection );
@@ -157,7 +157,7 @@ namespace vclcanvas
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( rOutDev ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( rOutDev );
pVDev->SetFont( mpFont->getVCLFont() );
setupLayoutMode( *pVDev.get(), mnTextDirection );
@@ -237,7 +237,7 @@ namespace vclcanvas
OutputDevice& rOutDev = mpOutDevProvider->getOutDev();
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( rOutDev ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( rOutDev );
pVDev->SetFont( mpFont->getVCLFont() );
// need metrics for Y offset, the XCanvas always renders
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index d3294590cae6..6f0d2b8ec022 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -205,7 +205,7 @@ IMPL_LINK( DataLabelResources, NumberFormatDialogHdl, PushButton *, pButton )
aNumberSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, rnFormatKey ));
aNumberSet.Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, rUseSourceFormat ));
- ScopedVclPtr<NumberFormatDialog> aDlg(new NumberFormatDialog(m_pWindow, aNumberSet));
+ ScopedVclPtrInstance< NumberFormatDialog > aDlg(m_pWindow, aNumberSet);
if( bPercent )
aDlg->SetText( m_pFT_NumberFormatForPercent->GetText());
if( RET_OK == aDlg->Execute() )
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
index e8e7a38df7a9..9f60c63bb405 100644
--- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
+++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
@@ -143,7 +143,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
nStandardSymbol %= pSymbolList->GetObjCount();
SdrObject* pObj = pSymbolList->GetObj(nStandardSymbol);
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
pVDev->SetMapMode(MapMode(MAP_100TH_MM));
SdrModel* pModel = new SdrModel();
pModel->GetItemPool().FreezeIdRanges();
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 935c13bd1329..e185ecae6b30 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1271,7 +1271,7 @@ void ChartController::executeDispatch_ChartType()
SolarMutexGuard aSolarGuard;
//prepare and open dialog
- ScopedVclPtr<ChartTypeDialog> aDlg(new ChartTypeDialog( m_pChartWindow, getModel(), m_xCC ));
+ ScopedVclPtrInstance< ChartTypeDialog > aDlg( m_pChartWindow, getModel(), m_xCC );
if( aDlg->Execute() == RET_OK )
{
impl_adaptDataSeriesAutoResize();
@@ -1292,7 +1292,7 @@ void ChartController::executeDispatch_SourceData()
if( xChartDoc.is())
{
SolarMutexGuard aSolarGuard;
- ScopedVclPtr<::chart::DataSourceDialog> aDlg(new ::chart::DataSourceDialog( m_pChartWindow, xChartDoc, m_xCC ));
+ ScopedVclPtrInstance< ::chart::DataSourceDialog > aDlg( m_pChartWindow, xChartDoc, m_xCC );
if( aDlg->Execute() == RET_OK )
{
impl_adaptDataSeriesAutoResize();
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 62109eec0af7..a3a2b20a61e1 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -179,7 +179,7 @@ void ChartController::executeDispatch_InsertTitles()
aDialogInput.readFromModel( getModel() );
SolarMutexGuard aGuard;
- ScopedVclPtr<SchTitleDlg> aDlg(new SchTitleDlg( m_pChartWindow, aDialogInput ));
+ ScopedVclPtrInstance< SchTitleDlg > aDlg( m_pChartWindow, aDialogInput );
if( aDlg->Execute() == RET_OK )
{
// lock controllers till end of block
@@ -232,7 +232,7 @@ void ChartController::executeDispatch_OpenLegendDialog()
{
//prepare and open dialog
SolarMutexGuard aGuard;
- ScopedVclPtr<SchLegendDlg> aDlg(new SchLegendDlg( m_pChartWindow, m_xCC ));
+ ScopedVclPtrInstance< SchLegendDlg > aDlg( m_pChartWindow, m_xCC );
aDlg->init( getModel() );
if( aDlg->Execute() == RET_OK )
{
@@ -292,7 +292,7 @@ void ChartController::executeDispatch_InsertMenu_DataLabels()
NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
SvNumberFormatter* pNumberFormatter = aNumberFormatterWrapper.getSvNumberFormatter();
- ScopedVclPtr<DataLabelsDialog> aDlg(new DataLabelsDialog( m_pChartWindow, aItemSet, pNumberFormatter));
+ ScopedVclPtrInstance< DataLabelsDialog > aDlg( m_pChartWindow, aItemSet, pNumberFormatter);
if( aDlg->Execute() == RET_OK )
{
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index 6ed346ee199e..4cc7a171d031 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -825,7 +825,7 @@ void ChartController::executeDispatch_View3D()
//open dialog
SolarMutexGuard aSolarGuard;
- ScopedVclPtr<View3DDialog> aDlg(new View3DDialog( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() ));
+ ScopedVclPtrInstance< View3DDialog > aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() );
if( aDlg->Execute() == RET_OK )
aUndoGuard.commit();
}
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index 55d04cde114e..b1354c588eed 100644
--- a/chart2/source/view/main/3DChartObjects.cxx
+++ b/chart2/source/view/main/3DChartObjects.cxx
@@ -76,7 +76,7 @@ const TextCacheItem& TextCache::getText(OUString const & rText, bool bIs3dText)
if(itr != maTextCache.end())
return *itr->second;
- ScopedVclPtr<VirtualDevice> pDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0));
+ ScopedVclPtrInstance< VirtualDevice > pDevice(*Application::GetDefaultDevice(), 0, 0);
vcl::Font aFont;
if(bIs3dText)
aFont = vcl::Font("Brillante St",Size(0,0));
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 6701de177a8f..7d81b5581228 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -836,7 +836,7 @@ DummyText::DummyText(const OUString& rText, const tNameSequence& rNames,
{
vcl::Font aFont;
std::for_each(maProperties.begin(), maProperties.end(), FontAttribSetter(aFont));
- ScopedVclPtr<VirtualDevice> pDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0));
+ ScopedVclPtrInstance< VirtualDevice > pDevice(*Application::GetDefaultDevice(), 0, 0);
pDevice->Erase();
Rectangle aRect;
pDevice->SetFont(aFont);
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 0dbecc1af829..1b64ef1d193e 100644
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -625,7 +625,7 @@ int OpenGLRender::RenderRectangleShape(bool bBorder, bool bFill)
int OpenGLRender::CreateTextTexture(::rtl::OUString const &textValue, vcl::Font aFont, long , awt::Point aPos, awt::Size aSize, long rotation)
{
- ScopedVclPtr<VirtualDevice> pDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0));
+ ScopedVclPtrInstance< VirtualDevice > pDevice(*Application::GetDefaultDevice(), 0, 0);
pDevice->Erase();
Rectangle aRect;
pDevice->SetFont(aFont);
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 129f53977373..2e4ffce4c013 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -2908,7 +2908,7 @@ namespace cppcanvas
VectorOfOutDevStates aStateStack;
- ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > aVDev;
aVDev->EnableOutput( false );
// Setup VDev for state tracking and mapping
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 44228cbd1961..8de41a4531d5 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2443,7 +2443,7 @@ IMPL_LINK( SvxMenuConfigPage, MenuSelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pMenuData->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- VclPtr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_MENU ) );
@@ -2486,7 +2486,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
OUString aNewName;
OUString aDesc = CUI_RESSTR( RID_SVXSTR_SUBMENU_NAME );
- VclPtr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_NAME_SUBMENU );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_ADD_SUBMENU ) );
@@ -2523,7 +2523,7 @@ IMPL_LINK( SvxMenuConfigPage, EntrySelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pEntry->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- VclPtr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_MENU_ITEM );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_MENU ) );
@@ -2563,9 +2563,8 @@ IMPL_LINK( SvxMenuConfigPage, NewMenuHdl, Button *, pButton )
{
(void)pButton;
- VclPtr<SvxMainMenuOrganizerDialog> pDialog(
- new SvxMainMenuOrganizerDialog( 0,
- GetSaveInData()->GetEntries(), NULL, true ));
+ VclPtrInstance<SvxMainMenuOrganizerDialog> pDialog( nullptr,
+ GetSaveInData()->GetEntries(), NULL, true );
if ( pDialog->Execute() == RET_OK )
{
@@ -3103,7 +3102,7 @@ IMPL_LINK( SvxToolbarConfigPage, ToolbarSelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pToolbar->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- VclPtr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
@@ -3189,7 +3188,7 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton )
OUString aNewName( stripHotKey( pEntry->GetName() ) );
OUString aDesc = CUI_RESSTR( RID_SVXSTR_LABEL_NEW_NAME );
- VclPtr<SvxNameDialog> pNameDialog(new SvxNameDialog( this, aNewName, aDesc ));
+ VclPtrInstance< SvxNameDialog > pNameDialog( this, aNewName, aDesc );
pNameDialog->SetHelpId( HID_SVX_CONFIG_RENAME_TOOLBAR_ITEM );
pNameDialog->SetText( CUI_RESSTR( RID_SVXSTR_RENAME_TOOLBAR ) );
@@ -4356,7 +4355,7 @@ short SvxToolbarConfigPage::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();
}
@@ -4447,7 +4446,7 @@ IMPL_LINK( SvxToolbarConfigPage, NewToolbarHdl, Button *, pButton )
OUString aNewURL =
generateCustomURL( GetSaveInData()->GetEntries() );
- VclPtr<SvxNewToolbarDialog> pNameDialog(new SvxNewToolbarDialog( 0, aNewName ));
+ VclPtrInstance< SvxNewToolbarDialog > pNameDialog( nullptr, aNewName );
sal_uInt16 nInsertPos;
for ( sal_uInt16 i = 0 ; i < m_pSaveInListBox->GetEntryCount(); ++i )
@@ -4593,7 +4592,7 @@ void SvxToolbarEntriesListBox::BuildCheckBoxButtonImages( SvLBoxButtonData* pDat
// in all color modes, like high contrast.
const AllSettings& rSettings = Application::GetSettings();
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
Size aSize( 26, 20 );
pVDev->SetOutputSizePixel( aSize );
@@ -5298,7 +5297,7 @@ void SvxIconSelectorDialog::ImportGraphics(
message += newLine;
}
- ScopedVclPtr<SvxIconChangeDialog> aDialog(new SvxIconChangeDialog(this, message));
+ ScopedVclPtrInstance< SvxIconChangeDialog > aDialog(this, message);
aDialog->Execute();
}
}
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 0dc55dba81f2..a54a29b831be 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -658,7 +658,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton*
)
)
{
- VclPtr<AssignComponentDialog> pAssignDlg(new AssignComponentDialog( pThis, sEventURL ));
+ VclPtrInstance< AssignComponentDialog > pAssignDlg( pThis, sEventURL );
short ret = pAssignDlg->Execute();
if( ret )
@@ -672,7 +672,7 @@ long _SvxMacroTabPage::GenericHandler_Impl( _SvxMacroTabPage* pThis, PushButton*
else if( bAssEnabled )
{
// assign pressed
- VclPtr<SvxScriptSelectorDialog> pDlg(new SvxScriptSelectorDialog( pThis, false, pThis->GetFrame() ));
+ VclPtrInstance< SvxScriptSelectorDialog > pDlg( pThis, false, pThis->GetFrame() );
if( pDlg )
{
short ret = pDlg->Execute();
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 0cee25dad2db..45d1a9301dfd 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -2055,7 +2055,7 @@ IMPL_LINK( SpellDialog, HandleHyperlink, FixedHyperlink*, pHyperlink )
uno::Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg);
aErrorBox->SetText(sTitle);
aErrorBox->Execute();
}
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 40239ca9b15e..1250e098e6ad 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -143,7 +143,7 @@ IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton )
Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg);
aErrorBox->SetText( GetText() );
aErrorBox->Execute();
}
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 593db194ce85..539c1e5f777b 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -1541,7 +1541,7 @@ void SAL_CALL ColorPicker::setTitle( const OUString& sTitle ) throw (RuntimeExce
sal_Int16 SAL_CALL ColorPicker::execute( ) throw (RuntimeException, std::exception)
{
- ScopedVclPtr<ColorPickerDialog> aDlg(new ColorPickerDialog( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode ));
+ ScopedVclPtrInstance< ColorPickerDialog > aDlg( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode );
sal_Int16 ret = aDlg->Execute();
if( ret )
mnColor = aDlg->GetColor();
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx
index 9811a85b6b07..efa51d3a5a90 100644
--- a/cui/source/dialogs/cuigaldlg.cxx
+++ b/cui/source/dialogs/cuigaldlg.cxx
@@ -611,7 +611,7 @@ IMPL_LINK_NOARG(GalleryIdDialog, ClickOkHdl)
aStr += pInfo->GetThemeName();
aStr += ")";
- ScopedVclPtr<InfoBox> aBox(new InfoBox( this, aStr ));
+ ScopedVclPtrInstance< InfoBox > aBox( this, aStr );
aBox->Execute();
m_pLbResName->GrabFocus();
bDifferentThemeExists = true;
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 6d1a69a8b076..9a923816921c 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -761,7 +761,7 @@ namespace svx
IMPL_LINK_NOARG( HangulHanjaConversionDialog, OnOption )
{
- ScopedVclPtr<HangulHanjaOptionsDialog> aOptDlg( new HangulHanjaOptionsDialog(this) );
+ ScopedVclPtrInstance< HangulHanjaOptionsDialog > aOptDlg(this);
aOptDlg->Execute();
m_aOptionsChangedLink.Call( this );
return 0L;
@@ -1041,7 +1041,7 @@ namespace svx
IMPL_LINK_NOARG(HangulHanjaOptionsDialog, NewDictHdl)
{
OUString aName;
- ScopedVclPtr<HangulHanjaNewDictDialog> aNewDlg( new HangulHanjaNewDictDialog(this) );
+ ScopedVclPtrInstance< HangulHanjaNewDictDialog > aNewDlg(this);
aNewDlg->Execute();
if( aNewDlg->GetName( aName ) )
{
@@ -1077,7 +1077,7 @@ namespace svx
DBG_ASSERT( pEntry, "+HangulHanjaEditDictDialog::EditDictHdl(): call of edit should not be possible with no selection!" );
if( pEntry )
{
- ScopedVclPtr<HangulHanjaEditDictDialog> aEdDlg( new HangulHanjaEditDictDialog(this, m_aDictList, m_pDictsLB->GetSelectEntryPos()) );
+ ScopedVclPtrInstance< HangulHanjaEditDictDialog > aEdDlg(this, m_aDictList, m_pDictsLB->GetSelectEntryPos());
aEdDlg->Execute();
}
return 0L;
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 85e7f27fd7ce..6a623476f6e4 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -271,7 +271,7 @@ bool SvxHyperlinkNewDocTp::AskApply()
bool bRet = ImplGetURLObject( m_pCbbPath->GetText(), m_pCbbPath->GetBaseURL(), aINetURLObject );
if ( !bRet )
{
- ScopedVclPtr<WarningBox> aWarning(new WarningBox( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) ) );
+ ScopedVclPtrInstance< WarningBox > aWarning( this, WB_OK, CUI_RESSTR(RID_SVXSTR_HYPDLG_NOVALIDFILENAME) );
aWarning->Execute();
}
return bRet;
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index d341bc6e142b..9260c684cfac 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -333,7 +333,7 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl)
bool bIsInputEnabled = GetParent()->IsInputEnabled();
if ( bIsInputEnabled )
GetParent()->EnableInput( false );
- ScopedVclPtr<SfxMacroAssignDlg> aDlg(new SfxMacroAssignDlg( this, mxDocumentFrame, *pItemSet ));
+ ScopedVclPtrInstance< SfxMacroAssignDlg > aDlg( this, mxDocumentFrame, *pItemSet );
// add events
SfxMacroTabPage *pMacroPage = static_cast<SfxMacroTabPage*>( aDlg->GetTabPage() );
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 5a83bbe4192f..123f04c41989 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -444,7 +444,7 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
if( !xLink.Is() )
return 0;
- ScopedVclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() ));
+ ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO | WB_DEF_YES, Closelinkmsg() );
if( RET_YES == aBox->Execute() )
{
@@ -475,7 +475,7 @@ IMPL_LINK( SvBaseLinksDlg, BreakLinkClickHdl, PushButton *, pPushButton )
}
else
{
- ScopedVclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() ));
+ ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO | WB_DEF_YES, CloselinkmsgMulti() );
if( RET_YES == aBox->Execute() )
{
diff --git a/cui/source/dialogs/passwdomdlg.cxx b/cui/source/dialogs/passwdomdlg.cxx
index eade758348a5..1b47dda9aa79 100644
--- a/cui/source/dialogs/passwdomdlg.cxx
+++ b/cui/source/dialogs/passwdomdlg.cxx
@@ -112,7 +112,7 @@ IMPL_LINK( PasswordToOpenModifyDialog_Impl, OkBtnClickHdl, OKButton *, EMPTYARG
const int nMismatch = (bToOpenMatch? 0 : 1) + (bToModifyMatch? 0 : 1);
if (nMismatch > 0)
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(m_pParent, nMismatch == 1 ? m_aOneMismatch : m_aTwoMismatch);
aErrorBox->Execute();
Edit* pEdit = !bToOpenMatch ? m_pPasswdToOpenED : m_pPasswdToModifyED;
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 0727f440c121..28c97b211848 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -922,7 +922,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
bValid = false;
OUString aError( m_createErrStr );
aError += m_createDupStr;
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
aErrorBox->SetText( m_createErrTitleStr );
aErrorBox->Execute();
xNewDlg->SetObjectName( aNewName );
@@ -1004,7 +1004,7 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry )
{
//ISSUE L10N & message from exception?
OUString aError( m_createErrStr );
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
aErrorBox->SetText( m_createErrTitleStr );
aErrorBox->Execute();
}
@@ -1080,7 +1080,7 @@ void SvxScriptOrgDialog::renameEntry( SvTreeListEntry* pEntry )
{
//ISSUE L10N & message from exception?
OUString aError( m_renameErrStr );
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), aError));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), aError);
aErrorBox->SetText( m_renameErrTitleStr );
aErrorBox->Execute();
}
@@ -1091,7 +1091,7 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
Reference< browse::XBrowseNode > node = getBrowseNode( pEntry );
// ISSUE L10N string & can we centre list?
OUString aQuery = m_delQueryStr + getListOfChildren( node, 0 );
- VclPtr<MessageDialog> aQueryBox(new MessageDialog(static_cast<vcl::Window*>(this), aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ VclPtrInstance< MessageDialog > aQueryBox(static_cast<vcl::Window*>(this), aQuery, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
aQueryBox->SetText( m_delQueryTitleStr );
if ( aQueryBox->Execute() == RET_NO )
{
@@ -1126,7 +1126,7 @@ void SvxScriptOrgDialog::deleteEntry( SvTreeListEntry* pEntry )
else
{
//ISSUE L10N & message from exception?
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(static_cast<vcl::Window*>(this), m_delErrStr));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(static_cast<vcl::Window*>(this), m_delErrStr);
aErrorBox->SetText( m_delErrTitleStr );
aErrorBox->Execute();
}
diff --git a/cui/source/factory/init.cxx b/cui/source/factory/init.cxx
index 2d179a307794..cdf2ed91d22b 100644
--- a/cui/source/factory/init.cxx
+++ b/cui/source/factory/init.cxx
@@ -28,7 +28,7 @@ extern "C"
SAL_DLLPUBLIC_EXPORT bool GetSpecialCharsForEdit(vcl::Window* i_pParent, const vcl::Font& i_rFont, OUString& o_rResult)
{
bool bRet = false;
- VclPtr<SvxCharacterMap> aDlg(new SvxCharacterMap( i_pParent ));
+ VclPtrInstance< SvxCharacterMap > aDlg( i_pParent );
aDlg->DisableFontSelection();
aDlg->SetCharFont(i_rFont);
if ( aDlg->Execute() == RET_OK )
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index 2170afbac74b..aa90f37c9ae6 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -278,7 +278,7 @@ IMPL_LINK_NOARG(DbRegistrationOptionsPage, DeleteHdl)
SvTreeListEntry* pEntry = pPathBox->FirstSelected();
if ( pEntry )
{
- ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(this, CUI_RES(RID_SVXSTR_QUERY_DELETE_CONFIRM), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQuery(this, CUI_RES(RID_SVXSTR_QUERY_DELETE_CONFIRM), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if ( aQuery->Execute() == RET_YES )
pPathBox->GetModel()->Remove(pEntry);
}
@@ -414,7 +414,7 @@ void DbRegistrationOptionsPage::insertNewEntry( const OUString& _sName,const OUS
void DbRegistrationOptionsPage::openLinkDialog(const OUString& _sOldName,const OUString& _sOldLocation,SvTreeListEntry* _pEntry)
{
- ScopedVclPtr<ODocumentLinkDialog> aDlg(new ODocumentLinkDialog(this,_pEntry == NULL));
+ ScopedVclPtrInstance< ODocumentLinkDialog > aDlg(this,_pEntry == nullptr);
aDlg->setLink(_sOldName,_sOldLocation);
aDlg->setNameValidator(LINK( this, DbRegistrationOptionsPage, NameValidator ) );
diff --git a/cui/source/options/doclinkdialog.cxx b/cui/source/options/doclinkdialog.cxx
index 3a5aa6758bf1..52e03509b068 100644
--- a/cui/source/options/doclinkdialog.cxx
+++ b/cui/source/options/doclinkdialog.cxx
@@ -130,7 +130,7 @@ namespace svx
{
OUString sMsg = CUI_RES(STR_LINKEDDOC_DOESNOTEXIST);
sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sMsg));
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMsg);
aError->Execute();
return 0L;
} // if (!bFileExists)
@@ -139,7 +139,7 @@ namespace svx
{
OUString sMsg = CUI_RES(STR_LINKEDDOC_NO_SYSTEM_FILE);
sMsg = sMsg.replaceFirst("$file$", m_pURL->GetText());
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sMsg));
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMsg);
aError->Execute();
return 0L;
}
@@ -151,7 +151,7 @@ namespace svx
{
OUString sMsg = CUI_RES(STR_NAME_CONFLICT);
sMsg = sMsg.replaceFirst("$file$", sCurrentText);
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sMsg, VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMsg, VCL_MESSAGE_INFO);
aError->Execute();
m_pName->SetSelection(Selection(0,sCurrentText.getLength()));
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 852d0272ca6d..59ba76fd614a 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -553,8 +553,8 @@ void ColorConfigWindow_Impl::CreateEntries()
long nCheckBoxLabelOffset = 0;
{
OUString sSampleText("X");
- ScopedVclPtr<CheckBox> aCheckBox(new CheckBox(this));
- ScopedVclPtr<FixedText> aFixedText(new FixedText(this));
+ ScopedVclPtrInstance< CheckBox > aCheckBox(this);
+ ScopedVclPtrInstance< FixedText > aFixedText(this);
aCheckBox->SetText(sSampleText);
aFixedText->SetText(sSampleText);
Size aCheckSize(aCheckBox->CalcMinimumSize(0x7fffffff));
@@ -628,7 +628,7 @@ void ColorConfigWindow_Impl::SetAppearance ()
OSL_ENSURE( vEntries.size() >= sizeof vEntryInfo / sizeof vEntryInfo[0], "wrong number of helpIDs for color listboxes" );
// creating a sample color listbox with the color entries
- ScopedVclPtr<ColorListBox> aSampleColorList(new ColorListBox(this));
+ ScopedVclPtrInstance< ColorListBox > aSampleColorList(this);
{
XColorListRef const xColorTable = XColorList::CreateStdColorList();
for (sal_Int32 i = 0; i != xColorTable->Count(); ++i)
@@ -1205,7 +1205,7 @@ IMPL_LINK(SvxColorOptionsTabPage, SaveDeleteHdl_Impl, PushButton*, pButton )
else
{
DBG_ASSERT(m_pColorSchemeLB->GetEntryCount() > 1, "don't delete the last scheme");
- ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(pButton, CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQuery(pButton, CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
aQuery->SetText(CUI_RES(RID_SVXSTR_COLOR_CONFIG_DELETE_TITLE));
if(RET_YES == aQuery->Execute())
{
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 10620f302705..5c25b4de3615 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -477,7 +477,7 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl)
if ( nLang != nOldLang )
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, CUI_RES( RID_SVXSTR_CONFIRM_SET_LANGUAGE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aBox(this, CUI_RES( RID_SVXSTR_CONFIRM_SET_LANGUAGE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
OUString sTxt(aBox->get_primary_text());
sTxt = sTxt.replaceFirst( "%1", pAllDictsLB->GetSelectEntry() );
aBox->set_primary_text(sTxt);
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 24bfe053914a..e33ee969dee3 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1356,7 +1356,7 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
xProp->setPropertyValue(sUserLocaleKey, makeAny(aLangString));
Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
// display info
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aBox(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO);
aBox->Execute();
// tell quickstarter to stop being a veto listener
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index f7758fae2abe..ee3e99a04b43 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -706,7 +706,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, SavePasswordHdl)
}
else
{
- ScopedVclPtr<QueryBox> aQuery(new QueryBox( this, WB_YES_NO|WB_DEF_NO, m_sPasswordStoringDeactivateStr ));
+ ScopedVclPtrInstance< QueryBox > aQuery( this, WB_YES_NO|WB_DEF_NO, m_sPasswordStoringDeactivateStr );
sal_uInt16 nRet = aQuery->Execute();
if( RET_YES == nRet )
@@ -803,7 +803,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, ShowPasswordsHdl)
if ( xMasterPasswd->isPersistentStoringAllowed() && xMasterPasswd->authorizateWithMasterPassword( Reference< task::XInteractionHandler>() ) )
{
- ScopedVclPtr<svx::WebConnectionInfoDialog> aDlg( new svx::WebConnectionInfoDialog(this) );
+ ScopedVclPtrInstance< svx::WebConnectionInfoDialog > aDlg(this);
aDlg->Execute();
}
}
@@ -822,7 +822,7 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, CertPathPBHdl)
if (nRet == RET_OK && sOrig != mpCertPathDlg->getDirectory())
{
- ScopedVclPtr<MessageDialog> aWarnBox(new MessageDialog(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aWarnBox(this, CUI_RES(RID_SVXSTR_OPTIONS_RESTART), VCL_MESSAGE_INFO);
aWarnBox->Execute();
}
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index c088d48df621..3e050b12873d 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -336,7 +336,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ParameterHdl_Impl)
(void)eErr;
if ( bRunning )
{
- ScopedVclPtr<MessageDialog> aWarnBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO ));
+ ScopedVclPtrInstance< MessageDialog > aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
aWarnBox->Execute();
}
}
@@ -381,7 +381,7 @@ IMPL_LINK_NOARG(SvxJavaOptionsPage, ClassPathHdl_Impl)
(void)eErr;
if ( bRunning )
{
- ScopedVclPtr<MessageDialog> aWarnBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO ));
+ ScopedVclPtrInstance< MessageDialog > aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
aWarnBox->Execute();
}
}
@@ -437,7 +437,7 @@ IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt )
IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl )
{
- ScopedVclPtr<CuiAboutConfigTabPage> m_pExpertConfigDlg( new CuiAboutConfigTabPage(this) );
+ ScopedVclPtrInstance< CuiAboutConfigTabPage > m_pExpertConfigDlg(this);
m_pExpertConfigDlg->Reset();//initialize and reset function
if( RET_OK == m_pExpertConfigDlg->Execute() )
@@ -630,12 +630,12 @@ void SvxJavaOptionsPage::AddFolder( const OUString& _rFolder )
}
else if ( JFW_E_NOT_RECOGNIZED == eErr )
{
- ScopedVclPtr<MessageDialog> aErrBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_JRE_NOT_RECOGNIZED ) ));
+ ScopedVclPtrInstance< MessageDialog > aErrBox( this, CUI_RES( RID_SVXSTR_JRE_NOT_RECOGNIZED ) );
aErrBox->Execute();
}
else if ( JFW_E_FAILED_VERSION == eErr )
{
- ScopedVclPtr<MessageDialog> aErrBox(new MessageDialog( this, CUI_RES( RID_SVXSTR_JRE_FAILED_VERSION ) ));
+ ScopedVclPtrInstance< MessageDialog > aErrBox( this, CUI_RES( RID_SVXSTR_JRE_FAILED_VERSION ) );
aErrBox->Execute();
}
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 4ad9c3879284..48a326be2a5e 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1596,7 +1596,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
pLinguData = new SvxLinguData_Impl;
SvxLinguData_Impl aOldLinguData( *pLinguData );
- ScopedVclPtr<SvxEditModulesDlg> aDlg(new SvxEditModulesDlg( this, *pLinguData ));
+ ScopedVclPtrInstance< SvxEditModulesDlg > aDlg( this, *pLinguData );
if (aDlg->Execute() != RET_OK)
*pLinguData = aOldLinguData;
@@ -1745,7 +1745,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
if(aData.HasNumericValue())
{
sal_uInt16 nRID = aData.GetEntryId();
- ScopedVclPtr<OptionsBreakSet> aDlg( new OptionsBreakSet(this, nRID) );
+ ScopedVclPtrInstance< OptionsBreakSet > aDlg(this, nRID);
aDlg->GetNumericFld().SetValue( aData.GetNumericValue() );
if (RET_OK == aDlg->Execute() )
{
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx
index fd029b6ed287..9304c364e38f 100644
--- a/cui/source/options/optopencl.cxx
+++ b/cui/source/options/optopencl.cxx
@@ -312,7 +312,7 @@ IMPL_LINK(ListEntryDialog, EditModifiedHdl, Edit*, pEdit)
void openListDialog(SvxOpenCLTabPage* pTabPage, OpenCLConfig::ImplMatcher& rEntry, const OString& rTag)
{
- ScopedVclPtr<ListEntryDialog> aDlg(new ListEntryDialog(pTabPage, rEntry, rTag));
+ ScopedVclPtrInstance< ListEntryDialog > aDlg(pTabPage, rEntry, rTag);
if (aDlg->Execute() == RET_OK)
rEntry = aDlg->maEntry;
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 6b61f7890e8e..eeabbcdeb84e 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -476,7 +476,7 @@ void SvxPersonalizationTabPage::LoadExtensionThemes()
IMPL_LINK( SvxPersonalizationTabPage, SelectPersona, PushButton*, /*pButton*/ )
{
- ScopedVclPtr<SelectPersonaDialog> aDialog( new SelectPersonaDialog(NULL) );
+ ScopedVclPtrInstance< SelectPersonaDialog > aDialog(nullptr);
if ( aDialog->Execute() == RET_OK )
{
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 5e592b7ae942..0d8b428c0261 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -731,7 +731,7 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl)
if( nSelEntryPos == REPLACE_BULLETS ||
nSelEntryPos == APPLY_NUMBERING)
{
- ScopedVclPtr<SvxCharacterMap> pMapDlg(new SvxCharacterMap(this));
+ ScopedVclPtrInstance< SvxCharacterMap > pMapDlg(this);
ImpUserData* pUserData = (ImpUserData*)m_pCheckLB->FirstSelected()->GetUserData();
pMapDlg->SetCharFont(*pUserData->pFont);
pMapDlg->SetChar( (*pUserData->pString)[0] );
@@ -748,7 +748,7 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl)
else if( MERGE_SINGLE_LINE_PARA == nSelEntryPos )
{
// dialog for per cent settings
- ScopedVclPtr<OfaAutoFmtPrcntSet> aDlg(new OfaAutoFmtPrcntSet(this));
+ ScopedVclPtrInstance< OfaAutoFmtPrcntSet > aDlg(this);
aDlg->GetPrcntFld().SetValue(nPercent);
if(RET_OK == aDlg->Execute())
{
@@ -2061,7 +2061,7 @@ IMPL_LINK( OfaQuoteTabPage, QuoteHdl, PushButton*, pBtn )
else if (pBtn == m_pDblEndQuotePB)
nMode = DBL_END;
// start character selection dialog
- ScopedVclPtr<SvxCharacterMap> pMap(new SvxCharacterMap( this, true ));
+ ScopedVclPtrInstance< SvxCharacterMap > pMap( this, true );
pMap->SetCharFont( OutputDevice::GetDefaultFont(DEFAULTFONT_LATIN_TEXT,
LANGUAGE_ENGLISH_US, DEFAULTFONT_FLAGS_ONLYONE, 0 ));
pMap->SetText(nMode < SGL_END ? m_sStartQuoteDlg : m_sEndQuoteDlg );
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 16f0038986dc..fd8e5dd0904c 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -3446,7 +3446,7 @@ void SvxCharTwoLinesPage::Initialize()
void SvxCharTwoLinesPage::SelectCharacter( ListBox* pBox )
{
bool bStart = pBox == m_pStartBracketLB;
- VclPtr<SvxCharacterMap> aDlg(new SvxCharacterMap( this ));
+ VclPtrInstance< SvxCharacterMap > aDlg( this );
aDlg->DisableFontSelection();
if ( aDlg->Execute() == RET_OK )
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 7fefce57d8a5..9d1a6626b0ac 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -699,7 +699,7 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
// display original size
const FieldUnit eMetric = GetModuleFieldUnit( GetItemSet() );
- ScopedVclPtr<MetricField> aFld(new MetricField(this, WB_HIDE));
+ ScopedVclPtrInstance< MetricField > aFld(this, WB_HIDE);
SetFieldUnit( *aFld.get(), eMetric );
aFld->SetDecimalDigits( m_pWidthMF->GetDecimalDigits() );
aFld->SetMax( LONG_MAX - 1 );
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 267083656c52..5e7ee8706f84 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -2095,7 +2095,7 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, PopupActivateHdl_Impl)
IMPL_LINK_NOARG(SvxNumOptionsTabPage, BulletHdl_Impl)
{
- VclPtr<SvxCharacterMap> pMap(new SvxCharacterMap( this, true ));
+ VclPtrInstance< SvxCharacterMap > pMap( this, true );
sal_uInt16 nMask = 1;
const vcl::Font* pFmtFont = 0;
@@ -2379,7 +2379,7 @@ void SvxNumberingPreview::Paint( const Rectangle& /*rRect*/ )
const Color aBackColor = rStyleSettings.GetFieldColor();
const Color aTextColor = rStyleSettings.GetFieldTextColor();
- ScopedVclPtr<VirtualDevice> pVDev(new VirtualDevice(*this));
+ ScopedVclPtrInstance< VirtualDevice > pVDev(*this);
pVDev->EnableRTL( IsRTLEnabled() );
pVDev->SetMapMode(GetMapMode());
pVDev->SetOutputSize( aSize );
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index fb789dcf02f9..315ad1bdfdf2 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -747,7 +747,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui" ));
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelBitmapDialog","cui/ui/querydeletebitmapdialog.ui" );
if( aQueryBox->Execute() == RET_YES )
{
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index ff323782ec3d..ff8d23a850af 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -872,7 +872,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelColorDialog","cui/ui/querydeletecolordialog.ui"));
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelColorDialog","cui/ui/querydeletecolordialog.ui");
if( aQueryBox->Execute() == RET_YES )
{
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index daec497a531b..36a33184c3cc 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -608,7 +608,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelGradientDialog","cui/ui/querydeletegradientdialog.ui"));
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelGradientDialog","cui/ui/querydeletegradientdialog.ui");
if ( aQueryBox->Execute() == RET_YES )
{
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 800c18bd77ac..cf939b82b004 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -645,7 +645,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickDeleteHdl_Impl)
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui"));
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetParentDialog(),"AskDelHatchDialog","cui/ui/querydeletehatchdialog.ui");
if( aQueryBox->Execute() == RET_YES )
{
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 94a616c8eb17..79ec9d3ad198 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -360,7 +360,7 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && pSymbolList)
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
pVDev->SetMapMode(MapMode(MAP_100TH_MM));
boost::scoped_ptr<SdrModel> pModel(new SdrModel);
pModel->GetItemPool().FreezeIdRanges();
@@ -1155,7 +1155,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
}
else if(nSymType >= 0)
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
pVDev->SetMapMode(MapMode(MAP_100TH_MM));
boost::scoped_ptr<SdrModel> pModel(new SdrModel);
diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
index c6041a033a70..b778fd68587e 100644
--- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
+++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
@@ -406,7 +406,7 @@ namespace dbmm
// check that the backup location isn't the same as the document itself
if ( lcl_equalURLs_nothrow( m_pData->aContext, sBackupLocation, m_pData->xDocumentModel->getURL() ) )
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( STR_INVALID_BACKUP_LOCATION ) ));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( STR_INVALID_BACKUP_LOCATION ) );
aErrorBox->Execute();
rBackupPage.grabLocationFocus();
return false;
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index 8b9d89cec649..104cf4bffc61 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -175,7 +175,7 @@ void OApplicationController::deleteTables(const ::std::vector< OUString>& _rList
else
{
OUString sMessage(ModuleRes(STR_MISSING_TABLES_XDROP));
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(getView(), sMessage));
+ ScopedVclPtrInstance< MessageDialog > aError(getView(), sMessage);
aError->Execute();
}
}
@@ -210,7 +210,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec
if ( eResult != svtools::QUERYDELETE_ALL )
{
- ScopedVclPtr<svtools::QueryDeleteDlg_Impl> aDlg( new svtools::QueryDeleteDlg_Impl(getView(), *aThisRound) );
+ ScopedVclPtrInstance< svtools::QueryDeleteDlg_Impl > aDlg(getView(), *aThisRound);
if ( !sDialogPosition.isEmpty() )
aDlg->SetWindowState( sDialogPosition );
diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx
index 237a31f1033d..e9424506727a 100644
--- a/dbaccess/source/ui/app/AppControllerGen.cxx
+++ b/dbaccess/source/ui/app/AppControllerGen.cxx
@@ -111,7 +111,7 @@ void OApplicationController::convertToView(const OUString& _sName)
OUString aDefaultName = ::dbaui::createDefaultName(xMeta,xTables,aName);
DynamicTableOrQueryNameCheck aNameChecker( xConnection, CommandType::TABLE );
- ScopedVclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), xConnection, aDefaultName, aNameChecker ) );
+ ScopedVclPtrInstance< OSaveAsDlg > aDlg( getView(), CommandType::TABLE, getORB(), xConnection, aDefaultName, aNameChecker );
if ( aDlg->Execute() == RET_OK )
{
OUString sName = aDlg->getName();
@@ -534,7 +534,7 @@ void OApplicationController::askToReconnect()
bool bClear = true;
if ( !m_pSubComponentManager->empty() )
{
- ScopedVclPtr<MessageDialog> aQry(new MessageDialog(getView(), ModuleRes(STR_QUERY_CLOSEDOCUMENTS), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQry(getView(), ModuleRes(STR_QUERY_CLOSEDOCUMENTS), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
switch (aQry->Execute())
{
case RET_YES:
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 8ade09ffccee..5b174bf64123 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1271,7 +1271,7 @@ IMPL_LINK( SbaXDataBrowserController, OnAsyncDisplayError, void*, /* _pNotIntere
{
if ( m_aCurrentError.isValid() )
{
- ScopedVclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( getBrowserView(), m_aCurrentError ));
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg( getBrowserView(), m_aCurrentError );
aDlg->Execute();
}
return 0L;
@@ -1764,14 +1764,14 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(bool bFilter)
Reference< XConnection> xCon(xFormSet->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY);
if(bFilter)
{
- ScopedVclPtr<DlgFilterCrit> aDlg(new DlgFilterCrit( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() ) );
+ ScopedVclPtrInstance< DlgFilterCrit > aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() );
if ( !aDlg->Execute() )
return; // if so we don't need to update the grid
aDlg->BuildWherePart();
}
else
{
- ScopedVclPtr<DlgOrderCrit> aDlg(new DlgOrderCrit( getBrowserView(),xCon,xParser,xSup->getColumns() ) );
+ ScopedVclPtrInstance< DlgOrderCrit > aDlg( getBrowserView(),xCon,xParser,xSup->getColumns() );
if(!aDlg->Execute())
{
return; // if so we don't need to actualize the grid
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index c581844cfa8d..74e6691c3164 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -792,7 +792,7 @@ void SbaGridControl::SetColWidth(sal_uInt16 nColId)
Any aWidth = xAffectedCol->getPropertyValue(PROPERTY_WIDTH);
sal_Int32 nCurWidth = aWidth.hasValue() ? ::comphelper::getINT32(aWidth) : -1;
- ScopedVclPtr<DlgSize> aDlgColWidth(new DlgSize(this, nCurWidth, false));
+ ScopedVclPtrInstance< DlgSize > aDlgColWidth(this, nCurWidth, false);
if (aDlgColWidth->Execute())
{
sal_Int32 nValue = aDlgColWidth->GetValue();
@@ -821,7 +821,7 @@ void SbaGridControl::SetRowHeight()
Any aHeight = xCols->getPropertyValue(PROPERTY_ROW_HEIGHT);
sal_Int32 nCurHeight = aHeight.hasValue() ? ::comphelper::getINT32(aHeight) : -1;
- ScopedVclPtr<DlgSize> aDlgRowHeight(new DlgSize(this, nCurHeight, true));
+ ScopedVclPtrInstance< DlgSize > aDlgRowHeight(this, nCurHeight, true);
if (aDlgRowHeight->Execute())
{
sal_Int32 nValue = aDlgRowHeight->GetValue();
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx
index a7e9e8b5ca07..c39dd5b2f95b 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -180,7 +180,7 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click)
Reference< XContent> xContent;
if ( xNameContainer->hasByName(sName) )
{
- ScopedVclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) ) );
+ ScopedVclPtrInstance< QueryBox > aBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) );
if ( aBox->Execute() != RET_YES )
return 0;
}
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index d07c04e8e0f7..8bf6989c9ab9 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -309,7 +309,7 @@ namespace dbaui
aProfiles.insert(pArray[index]);
// execute the select dialog
- ScopedVclPtr<ODatasourceSelectDialog> aSelector(new ODatasourceSelectDialog(GetParent(), aProfiles));
+ ScopedVclPtrInstance< ODatasourceSelectDialog > aSelector(GetParent(), aProfiles);
OUString sOldProfile=getURLNoPrefix();
if (!sOldProfile.isEmpty())
@@ -479,7 +479,7 @@ namespace dbaui
sQuery = sQuery.replaceFirst("$path$", aTransformer.get(OFileNotation::N_SYSTEM));
m_bUserGrabFocus = false;
- ScopedVclPtr<QueryBox> aQuery(new QueryBox(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery));
+ ScopedVclPtrInstance< QueryBox > aQuery(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery);
sal_Int32 nQueryResult = aQuery->Execute();
m_bUserGrabFocus = true;
@@ -496,7 +496,7 @@ namespace dbaui
sQuery = sQuery.replaceFirst("$name$", aTransformer.get(OFileNotation::N_SYSTEM));
m_bUserGrabFocus = false;
- ScopedVclPtr<QueryBox> aWhatToDo(new QueryBox(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery));
+ ScopedVclPtrInstance< QueryBox > aWhatToDo(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery);
nQueryResult = aWhatToDo->Execute();
m_bUserGrabFocus = true;
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index dde891761a3b..eca76597c827 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -308,7 +308,7 @@ namespace dbaui
const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error;
- ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) );
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
aMsg->Execute();
return 0L;
}
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
index f202e90f708a..fef583fb7495 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx
@@ -563,7 +563,7 @@ using namespace ::com::sun::star;
#endif
const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error;
- ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) );
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
aMsg->Execute();
return 0L;
}
@@ -685,7 +685,7 @@ using namespace ::com::sun::star;
}
#endif
sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
- ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString() ) );
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, OUString( ModuleRes( nMessage ) ), OUString() );
aMsg->Execute();
return 0L;
}
diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx
index 032d337c3c79..a98dafd995c6 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.cxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.cxx
@@ -102,7 +102,7 @@ IMPL_LINK_NOARG(OPasswordDialog, OKHdl_Impl)
else
{
OUString aErrorMsg( ModuleRes( STR_ERROR_PASSWORDS_NOT_IDENTICAL));
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(this, aErrorMsg));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(this, aErrorMsg);
aErrorBox->Execute();
m_pEDPassword->SetText( OUString() );
m_pEDPasswordRepeat->SetText( OUString() );
@@ -213,7 +213,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
{
if(pButton == m_pNEWUSER)
{
- ScopedVclPtr<SfxPasswordDialog> aPwdDlg(new SfxPasswordDialog(this));
+ ScopedVclPtrInstance< SfxPasswordDialog > aPwdDlg(this);
aPwdDlg->ShowExtras(SHOWEXTRAS_ALL);
if(aPwdDlg->Execute())
{
@@ -240,7 +240,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
if(xUser.is())
{
OUString sNewPassword,sOldPassword;
- ScopedVclPtr<OPasswordDialog> aDlg(new OPasswordDialog(this,sName));
+ ScopedVclPtrInstance< OPasswordDialog > aDlg(this,sName);
if(aDlg->Execute() == RET_OK)
{
sNewPassword = aDlg->GetNewPassword();
@@ -259,7 +259,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
Reference<XDrop> xDrop(m_xUsers,UNO_QUERY);
if(xDrop.is())
{
- ScopedVclPtr<MessageDialog> aQry(new MessageDialog(this, ModuleRes(STR_QUERY_USERADMIN_DELETE_USER), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQry(this, ModuleRes(STR_QUERY_USERADMIN_DELETE_USER), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if(aQry->Execute() == RET_YES)
xDrop->dropByName(GetUser());
}
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx
index b83788833c74..fbeedcf7b96a 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -117,7 +117,7 @@ namespace dbaui
// show an error message
OUString sError( ModuleRes( STR_COULD_NOT_LOAD_ODBC_LIB ) );
sError = sError.replaceFirst("#lib#", aEnumeration.getLibraryName());
- ScopedVclPtr<MessageDialog> aDialog(new MessageDialog(this, sError));
+ ScopedVclPtrInstance< MessageDialog > aDialog(this, sError);
aDialog->Execute();
return false;
}
@@ -125,7 +125,7 @@ namespace dbaui
{
aEnumeration.getDatasourceNames(aOdbcDatasources);
// execute the select dialog
- ScopedVclPtr<ODatasourceSelectDialog> aSelector(new ODatasourceSelectDialog(GetParent(), aOdbcDatasources));
+ ScopedVclPtrInstance< ODatasourceSelectDialog > aSelector(GetParent(), aOdbcDatasources);
if (!_sCurr.isEmpty())
aSelector->Select(_sCurr);
if ( RET_OK == aSelector->Execute() )
@@ -242,7 +242,7 @@ namespace dbaui
eImage = OSQLMessageBox::Error;
aMessage = ModuleRes(STR_CONNECTION_NO_SUCCESS);
}
- ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, sTitle, aMessage, WB_OK, eImage ) );
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, sTitle, aMessage, WB_OK, eImage );
aMsg->Execute();
}
if ( !bSuccess )
diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx
index ecf9537a6dfc..47a0c20847aa 100644
--- a/dbaccess/source/ui/dlg/detailpages.cxx
+++ b/dbaccess/source/ui/dlg/detailpages.cxx
@@ -248,7 +248,7 @@ namespace dbaui
{
if (m_pIndexes == pButton)
{
- ScopedVclPtr<ODbaseIndexDialog> aIndexDialog(new ODbaseIndexDialog(this, m_sDsn));
+ ScopedVclPtrInstance< ODbaseIndexDialog > aIndexDialog(this, m_sDsn);
aIndexDialog->Execute();
}
else
@@ -541,7 +541,7 @@ namespace dbaui
#endif
const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS;
const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error;
- ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) );
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt );
aMsg->Execute();
return 0L;
}
diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx
index c7d1634a2087..c5ceccbae91b 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -106,7 +106,7 @@ namespace dbaui
{
OUString sMessage(ModuleRes(STR_DIRECTSQL_CONNECTIONLOST));
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sMessage));
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMessage);
aError->Execute();
}
diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx
index 5e58d86d8f7b..4ece5045c04d 100644
--- a/dbaccess/source/ui/dlg/generalpage.cxx
+++ b/dbaccess/source/ui/dlg/generalpage.cxx
@@ -738,7 +738,7 @@ namespace dbaui
if ( aFileDlg.GetCurrentFilter() != pFilter->GetUIName() || !pFilter->GetWildcard().Matches(sPath) )
{
OUString sMessage(ModuleRes(STR_ERR_USE_CONNECT_TO));
- ScopedVclPtr<InfoBox> aError(new InfoBox(this, sMessage));
+ ScopedVclPtrInstance< InfoBox > aError(this, sMessage);
aError->Execute();
m_pRB_ConnectDatabase->Check();
OnSetupModeSelected( m_pRB_ConnectDatabase );
diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx
index d1a4981da386..a033fab3b3bf 100644
--- a/dbaccess/source/ui/dlg/indexdialog.cxx
+++ b/dbaccess/source/ui/dlg/indexdialog.cxx
@@ -422,7 +422,7 @@ namespace dbaui
{
OUString sConfirm(ModuleRes(STR_CONFIRM_DROP_INDEX));
sConfirm = sConfirm.replaceFirst("$name$", m_pIndexList->GetEntryText(pSelected));
- ScopedVclPtr<MessageDialog> aConfirm(new MessageDialog(this, sConfirm, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aConfirm(this, sConfirm, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if (RET_YES != aConfirm->Execute())
return;
}
@@ -630,7 +630,7 @@ namespace dbaui
{
OUString sError(ModuleRes(STR_INDEX_NAME_ALREADY_USED));
sError = sError.replaceFirst("$name$", sNewName);
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sError));
+ ScopedVclPtrInstance< MessageDialog > aError(this, sError);
aError->Execute();
updateToolbox();
@@ -691,7 +691,7 @@ namespace dbaui
// need at least one field
if (0 == _rPos->aFields.size())
{
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, ModuleRes(STR_NEED_INDEX_FIELDS)));
+ ScopedVclPtrInstance< MessageDialog > aError(this, ModuleRes(STR_NEED_INDEX_FIELDS));
aError->Execute();
m_pFields->GrabFocus();
return false;
@@ -709,7 +709,7 @@ namespace dbaui
// a column is specified twice ... won't work anyway, so prevent this here and now
OUString sMessage(ModuleRes(STR_INDEXDESIGN_DOUBLE_COLUMN_NAME));
sMessage = sMessage.replaceFirst("$name$", aFieldCheck->sFieldName);
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sMessage));
+ ScopedVclPtrInstance< MessageDialog > aError(this, sMessage);
aError->Execute();
m_pFields->GrabFocus();
return false;
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index 1c63cb0fdf22..d86fbda9e634 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -712,7 +712,7 @@ void OSQLMessageBox::dispose()
IMPL_LINK( OSQLMessageBox, ButtonClickHdl, Button *, /*pButton*/ )
{
- ScopedVclPtr<OExceptionChainDialog> aDlg(new OExceptionChainDialog( this, m_pImpl->aDisplayInfo ) );
+ ScopedVclPtrInstance< OExceptionChainDialog > aDlg( this, m_pImpl->aDisplayInfo );
aDlg->Execute();
return 0;
}
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index eb14533397ff..051144d4fe72 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -327,7 +327,7 @@ namespace dbaui
if (aErrorInfo.isValid())
{
// establishing the connection failed. Show an error window and exit.
- ScopedVclPtr<OSQLMessageBox> aMessageBox(new OSQLMessageBox( GetParentDialog(), aErrorInfo ));
+ ScopedVclPtrInstance< OSQLMessageBox > aMessageBox( GetParentDialog(), aErrorInfo );
aMessageBox->Execute();
m_pTables->Enable(false);
m_pTablesList->Clear();
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index 7f7f51a5f9e2..67d464ada188 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -754,7 +754,7 @@ void ODatabaseExport::showErrorDialog(const ::com::sun::star::sdbc::SQLException
OUString aMsg(e.Message);
aMsg += "\n";
aMsg += ModuleRes( STR_QRY_CONTINUE );
- ScopedVclPtr<OSQLWarningBox> aBox(new OSQLWarningBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO ) );
+ ScopedVclPtrInstance< OSQLWarningBox > aBox( nullptr, aMsg, WB_YES_NO | WB_DEF_NO );
if (aBox->Execute() == RET_YES)
m_bDontAskAgain = true;
diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx
index a107c94e8a5a..1d2316ad3d02 100644
--- a/dbaccess/source/ui/misc/RowSetDrop.cxx
+++ b/dbaccess/source/ui/misc/RowSetDrop.cxx
@@ -241,7 +241,7 @@ bool ORowSetImportExport::insertNewRow()
if(!m_bAlreadyAsked)
{
OUString sAskIfContinue = ModuleRes(STR_ERROR_OCCURRED_WHILE_COPYING);
- ScopedVclPtr<OSQLWarningBox> aDlg(new OSQLWarningBox( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES ) );
+ ScopedVclPtrInstance< OSQLWarningBox > aDlg( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES );
if(aDlg->Execute() == RET_YES)
m_bAlreadyAsked = true;
else
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index e03f8084bd95..cfb5df6adafb 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -852,7 +852,7 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
}
{ // want the dialog to be destroyed before our set
- ScopedVclPtr<SbaSbAttrDlg> aDlg(new SbaSbAttrDlg(_pParent, pFormatDescriptor, _pFormatter, _bHasFormat));
+ ScopedVclPtrInstance< SbaSbAttrDlg > aDlg(_pParent, pFormatDescriptor, _pFormatter, _bHasFormat);
if (RET_OK == aDlg->Execute())
{
// ItemSet->UNO
@@ -997,7 +997,7 @@ void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 _nColId
Size aDefaultMM = _pBox->PixelToLogic( Size( nDefaultWidth, 0 ), MapMode( MAP_MM ) );
- ScopedVclPtr<DlgSize> aColumnSizeDlg(new DlgSize( _pBox, nColSize, false, aDefaultMM.Width() * 10 ) );
+ ScopedVclPtrInstance< DlgSize > aColumnSizeDlg( _pBox, nColSize, false, aDefaultMM.Width() * 10 );
if ( aColumnSizeDlg->Execute() )
{
sal_Int32 nValue = aColumnSizeDlg->GetValue();
@@ -1286,7 +1286,7 @@ sal_Int32 askForUserAction(vcl::Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _
SolarMutexGuard aGuard;
OUString aMsg = ModuleRes(_nText);
aMsg = aMsg.replaceFirst("%1", _sName);
- ScopedVclPtr<OSQLMessageBox> aAsk(new OSQLMessageBox(_pParent, ModuleRes(_nTitle ), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query));
+ ScopedVclPtrInstance< OSQLMessageBox > aAsk(_pParent, ModuleRes(_nTitle ), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query);
if ( _bAll )
{
aAsk->AddButton(ModuleRes(STR_BUTTON_TEXT_ALL), RET_ALL, 0);
diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
index e9fed42eee82..0540c4ab9133 100644
--- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
+++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
@@ -308,7 +308,7 @@ namespace dbaui
bool bReConnect = true;
if ( _bUI )
{
- ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(getView(), ModuleRes(STR_QUERY_CONNECTION_LOST), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQuery(getView(), ModuleRes(STR_QUERY_CONNECTION_LOST), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
bReConnect = ( RET_YES == aQuery->Execute() );
}
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 68cf1a76aba7..3a3c4de0db15 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -158,7 +158,7 @@ namespace
}
}
- ScopedVclPtr<OQueryTableConnection> aInfo(new OQueryTableConnection(pTableView, aInfoData));
+ ScopedVclPtrInstance< OQueryTableConnection > aInfo(pTableView, aInfoData);
// Because OQueryTableConnection never takes ownership of the data passed to it, but only remembers the pointer,
// this pointer to a local variable is not critical, as aInfoData and aInfo have the same lifetime
pTableView->NotifyTabConnection( *aInfo.get() );
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 23563fd70980..e60cebf6b7ac 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -118,7 +118,7 @@ namespace
{
OQueryTableConnectionData* pData = static_cast< OQueryTableConnectionData*>(_pConnectionData.get());
- ScopedVclPtr<DlgQryJoin> aDlg(new DlgQryJoin(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables));
+ ScopedVclPtrInstance< DlgQryJoin > aDlg(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables);
bool bOk = aDlg->Execute() == RET_OK;
if( bOk )
{
@@ -208,7 +208,7 @@ namespace
pNewConnData->AppendConnLine(*pIter,sRelatedColumn);
// now add the Conn itself
- ScopedVclPtr<OQueryTableConnection> aNewConn(new OQueryTableConnection(_pView, aNewConnData));
+ ScopedVclPtrInstance< OQueryTableConnection > aNewConn(_pView, aNewConnData);
// referring to the local variable is not important, as NotifyQueryTabConn creates a new copy
// to add me (if not existent)
_pView->NotifyTabConnection(*aNewConn.get(), false);
@@ -621,7 +621,7 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ
pNewConnectionData->AppendConnLine( aSourceFieldName,aDestFieldName );
- ScopedVclPtr<OQueryTableConnection> aNewConnection(new OQueryTableConnection(this, aNewConnectionData));
+ ScopedVclPtrInstance< OQueryTableConnection > aNewConnection(this, aNewConnectionData);
NotifyTabConnection(*aNewConnection.get());
// As usual with NotifyTabConnection, using a local variable is fine because a copy is made
}
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 0506a3e1cb34..0360492c2d7d 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -987,7 +987,7 @@ void OQueryController::impl_initialize()
OUString aTitle( ModuleRes( STR_QUERYDESIGN_NO_VIEW_SUPPORT ) );
OUString aMessage( ModuleRes( STR_QUERYDESIGN_NO_VIEW_ASK ) );
ODataView* pWindow = getView();
- ScopedVclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query ));
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query );
bClose = aDlg->Execute() == RET_NO;
}
if ( bClose )
@@ -1802,7 +1802,7 @@ short OQueryController::saveModified()
)
{
OUString sMessageText( lcl_getObjectResourceString( STR_QUERY_SAVEMODIFIED, m_nCommandType ) );
- ScopedVclPtr<QueryBox> aQry(new QueryBox( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText ) );
+ ScopedVclPtrInstance< QueryBox > aQry( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText );
nRet = aQry->Execute();
if ( ( nRet == RET_YES )
@@ -1914,7 +1914,7 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings
if ( !i_bForceCurrentControllerSettings && !editingView() )
{
OUString aTitle(ModuleRes(STR_SVT_SQL_SYNTAX_ERROR));
- ScopedVclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(getView(),aTitle,aErrorMsg));
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg(getView(),aTitle,aErrorMsg);
aDlg->Execute();
}
bError = true;
diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx
index f9a9dcf6cf6b..c1aa00d46bb2 100644
--- a/dbaccess/source/ui/relationdesign/RelationController.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -205,7 +205,7 @@ void ORelationController::impl_initialize()
{
OUString sTitle(ModuleRes(STR_RELATIONDESIGN));
sTitle = sTitle.copy(3);
- ScopedVclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(NULL,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE)));
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg(nullptr,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE));
aDlg->Execute();
}
disconnect();
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index 051f03fbf2e9..a74fbcf0395a 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -223,7 +223,7 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const
void ORelationTableView::ConnDoubleClicked( OTableConnection* pConnection )
{
- ScopedVclPtr<ORelationDialog> aRelDlg(new ORelationDialog( this, pConnection->GetData() ));
+ ScopedVclPtrInstance< ORelationDialog > aRelDlg( this, pConnection->GetData() );
switch (aRelDlg->Execute())
{
case RET_OK:
@@ -251,7 +251,7 @@ void ORelationTableView::AddNewRelation()
{
TTableConnectionData::value_type pNewConnData( new ORelationTableConnectionData() );
- ScopedVclPtr<ORelationDialog> aRelDlg(new ORelationDialog(this, pNewConnData, true));
+ ScopedVclPtrInstance< ORelationDialog > aRelDlg(this, pNewConnData, true);
bool bSuccess = (aRelDlg->Execute() == RET_OK);
if (bSuccess)
@@ -326,7 +326,7 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin
void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin )
{
- ScopedVclPtr<OSQLWarningBox> aDlg(new OSQLWarningBox( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES ));
+ ScopedVclPtrInstance< OSQLWarningBox > aDlg( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES );
if ( m_bInRemove || aDlg->Execute() == RET_YES )
{
m_pView->getController().ClearUndoManager();
@@ -344,7 +344,7 @@ void ORelationTableView::lookForUiActivities()
{
OUString sTitle(ModuleRes(STR_RELATIONDESIGN));
sTitle = sTitle.copy(3);
- ScopedVclPtrInstance<OSQLMessageBox> aDlg(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),OUString(),0);
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),OUString(),0);
aDlg->SetText(sTitle);
aDlg->RemoveButton(aDlg->GetButtonId(0));
aDlg->AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON);
@@ -364,7 +364,7 @@ void ORelationTableView::lookForUiActivities()
}
if(m_pCurrentlyTabConnData)
{
- ScopedVclPtr<ORelationDialog> aRelDlg(new ORelationDialog( this, m_pCurrentlyTabConnData ) );
+ ScopedVclPtrInstance< ORelationDialog > aRelDlg( this, m_pCurrentlyTabConnData );
if (aRelDlg->Execute() == RET_OK)
{
// already updated by the dialog
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 81c8e5970ab2..59e0e8a51395 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -318,7 +318,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs)
}
DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::TABLE );
- ScopedVclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker ) );
+ ScopedVclPtrInstance< OSaveAsDlg > aDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker );
if ( aDlg->Execute() != RET_OK )
return false;
@@ -415,7 +415,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs)
{
OUString sText( ModuleRes( STR_NAME_ALREADY_EXISTS ) );
sText = sText.replaceFirst( "#" , m_sName);
- ScopedVclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error ) );
+ ScopedVclPtrInstance< OSQLMessageBox > aDlg( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error );
aDlg->Execute();
bError = true;
@@ -447,7 +447,7 @@ void OTableController::doEditIndexes()
// table needs to be saved before editing indexes
if (m_bNew || isModified())
{
- ScopedVclPtr<MessageDialog> aAsk(new MessageDialog(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aAsk(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if (RET_YES != aAsk->Execute())
return;
@@ -490,7 +490,7 @@ void OTableController::doEditIndexes()
if (!xIndexes.is())
return;
- ScopedVclPtr<DbaIndexDialog> aDialog(new DbaIndexDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0));
+ ScopedVclPtrInstance< DbaIndexDialog > aDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0);
if (RET_OK != aDialog->Execute())
return;
@@ -946,7 +946,7 @@ bool OTableController::checkColumns(bool _bNew)
{
OUString sTitle(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD));
OUString sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY));
- ScopedVclPtr<OSQLMessageBox> aBox(new OSQLMessageBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES));
+ ScopedVclPtrInstance< OSQLMessageBox > aBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES);
switch ( aBox->Execute() )
{
@@ -1075,7 +1075,7 @@ void OTableController::alterColumns()
aMessage = aMessage.replaceFirst( "$column$", pField->GetName() );
SQLExceptionInfo aError( ::cppu::getCaughtException() );
- ScopedVclPtr<OSQLWarningBox> aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError ) );
+ ScopedVclPtrInstance< OSQLWarningBox > aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError );
bNotOk = aMsg->Execute() == RET_YES;
}
else
@@ -1131,7 +1131,7 @@ void OTableController::alterColumns()
{
OUString aMessage(ModuleRes(STR_TABLEDESIGN_ALTER_ERROR));
aMessage = aMessage.replaceFirst("$column$",pField->GetName());
- ScopedVclPtr<OSQLWarningBox> aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES ) );
+ ScopedVclPtrInstance< OSQLWarningBox > aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES );
if ( aMsg->Execute() != RET_YES )
{
Reference<XPropertySet> xNewColumn(xIdxColumns->getByIndex(nPos),UNO_QUERY_THROW);
@@ -1198,7 +1198,7 @@ void OTableController::alterColumns()
OUString aMsgT(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN));
aMsgT = aMsgT.replaceFirst("$column$",*pIter);
OUString aTitle(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN_TITLE));
- ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES));
+ ScopedVclPtrInstance< OSQLMessageBox > aMsg(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES);
if(aMsg->Execute() == RET_YES)
{
xKeyColumns = NULL;
diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx
index db0a40e7c970..dd2d477dfa84 100644
--- a/dbaccess/source/ui/uno/dbinteraction.cxx
+++ b/dbaccess/source/ui/uno/dbinteraction.cxx
@@ -127,7 +127,7 @@ namespace dbaui
xParamCallback = Reference< XInteractionSupplyParameters >(_rContinuations[nParamPos], UNO_QUERY);
OSL_ENSURE(xParamCallback.is(), "BasicInteractionHandler::implHandle(ParametersRequest): can't set the parameters without an appropriate interaction handler!s");
- ScopedVclPtr<OParameterDialog> aDlg(new OParameterDialog(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext));
+ ScopedVclPtrInstance< OParameterDialog > aDlg(nullptr, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext);
sal_Int16 nResult = aDlg->Execute();
try
{
@@ -182,7 +182,7 @@ namespace dbaui
}
// execute the dialog
- ScopedVclPtr<OSQLMessageBox> aDialog(new OSQLMessageBox(NULL, _rSqlInfo, nDialogStyle));
+ ScopedVclPtrInstance< OSQLMessageBox > aDialog(nullptr, _rSqlInfo, nDialogStyle);
// TODO: need a way to specify the parent window
sal_Int16 nResult = aDialog->Execute();
try
@@ -256,7 +256,7 @@ namespace dbaui
Reference< XInteractionDocumentSave > xCallback(_rContinuations[nDocuPos], UNO_QUERY);
OSL_ENSURE(xCallback.is(), "BasicInteractionHandler::implHandle(DocumentSaveRequest): can't save document without an appropriate interaction handler!s");
- ScopedVclPtr<OCollectionView> aDlg(new OCollectionView(NULL, _rDocuRequest.Content, _rDocuRequest.Name, m_xContext));
+ ScopedVclPtrInstance< OCollectionView > aDlg(nullptr, _rDocuRequest.Content, _rDocuRequest.Name, m_xContext);
sal_Int16 nResult = aDlg->Execute();
try
{
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index db6dbd6b497b..669d0dd4ec3b 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -708,7 +708,7 @@ void Desktop::HandleBootstrapPathErrors( ::utl::Bootstrap::Status aBootstrapStat
OUString const aMessage(aDiagnosticMessage + "\n");
- ScopedVclPtr<MessageDialog> aBootstrapFailedBox(new MessageDialog(NULL, aMessage));
+ ScopedVclPtrInstance< MessageDialog > aBootstrapFailedBox(nullptr, aMessage);
aBootstrapFailedBox->SetText( aProductKey );
aBootstrapFailedBox->Execute();
}
@@ -2354,7 +2354,7 @@ void Desktop::OpenClients()
ResMgr* pDtResMgr = GetDesktopResManager();
if( pDtResMgr )
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(NULL, ResId(STR_ERR_PRINTDISABLED, *pDtResMgr)));
+ ScopedVclPtrInstance< MessageDialog > aBox(nullptr, ResId(STR_ERR_PRINTDISABLED, *pDtResMgr));
aBox->Execute();
}
}
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index b41fb3a56c8b..1313475dc638 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -408,7 +408,7 @@ void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt )
break;
case CMD_SHOW_LICENSE:
{
- ScopedVclPtr<ShowLicenseDialog> aLicenseDlg(new ShowLicenseDialog( m_pParent, GetEntryData( nPos )->m_xPackage ));
+ ScopedVclPtrInstance< ShowLicenseDialog > aLicenseDlg( m_pParent, GetEntryData( nPos )->m_xPackage );
aLicenseDlg->Execute();
break;
}
@@ -626,7 +626,7 @@ void DialogHelper::openWebBrowser( const OUString & sURL, const OUString &sTitle
uno::Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg);
aErrorBox->SetText( sTitle );
aErrorBox->Execute();
}
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 57005409442f..1b2136d3ec01 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -506,7 +506,7 @@ void ProgressCmdEnv::handle( uno::Reference< task::XInteractionRequest > const &
SolarMutexGuard guard;
OUString sMsg(ResId(RID_STR_UNSUPPORTED_PLATFORM, *DeploymentGuiResMgr::get()).toString());
sMsg = sMsg.replaceAll("%Name", platExc.package->getDisplayName());
- ScopedVclPtr<MessageDialog> box(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, sMsg));
+ ScopedVclPtrInstance< MessageDialog > box(m_pDialogHelper? m_pDialogHelper->getWindow() : nullptr, sMsg);
box->Execute();
approve = true;
}
@@ -571,7 +571,7 @@ void ProgressCmdEnv::update_( uno::Any const & rStatus )
text = ::comphelper::anyToString( rStatus ); // fallback
const SolarMutexGuard aGuard;
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(m_pDialogHelper? m_pDialogHelper->getWindow() : NULL, text));
+ ScopedVclPtrInstance< MessageDialog > aBox(m_pDialogHelper? m_pDialogHelper->getWindow() : nullptr, text);
aBox->Execute();
}
++m_nCurrentProgress;
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index b7587d178209..e5dd36af5983 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -606,7 +606,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
#ifndef IOS
InitSvpForLibreOfficeKit();
- ScopedVclPtr<VirtualDevice> pDevice( new VirtualDevice(0, Size(1, 1), (sal_uInt16)32)) ;
+ ScopedVclPtrInstance< VirtualDevice > pDevice(0, Size(1, 1), (sal_uInt16)32) ;
boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() );
pDevice->SetOutputSizePixelScaleOffsetAndBuffer(
Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index a7e4789929ac..d86a455238cf 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -472,7 +472,7 @@ Reference<XComponentContext> getUNO(
if ( ! InitVCL() )
throw RuntimeException( "Cannot initialize VCL!" );
{
- ScopedVclPtr<WarningBox> warn(new WarningBox(NULL, WB_OK | WB_DEF_OK, sMsg));
+ ScopedVclPtrInstance< WarningBox > warn(nullptr, WB_OK | WB_DEF_OK, sMsg);
warn->SetText(utl::ConfigManager::getProductName());
warn->SetIcon(0);
warn->Execute();
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index bb84b292ab26..d782962fa11d 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -116,7 +116,7 @@ namespace drawinglayer
if(nSizeX > 0 && nSizeY > 0)
{
// prepare VirtualDevice
- ScopedVclPtr<VirtualDevice> aVirtualDevice(new VirtualDevice(*Application::GetDefaultDevice()));
+ ScopedVclPtrInstance< VirtualDevice > aVirtualDevice(*Application::GetDefaultDevice());
const Size aSizePixel(nSizeX, nSizeY);
aVirtualDevice->SetOutputSizePixel(aSizePixel);
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index 1f6ee8d82f9a..7ed0045f778a 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -96,8 +96,8 @@ namespace
// with a step count of zero
if(maAnimation.Count())
{
- ScopedVclPtr<VirtualDevice> aVirtualDevice(new VirtualDevice(*Application::GetDefaultDevice()));
- ScopedVclPtr<VirtualDevice> aVirtualDeviceMask(new VirtualDevice(*Application::GetDefaultDevice(), 1L));
+ ScopedVclPtrInstance< VirtualDevice > aVirtualDevice(*Application::GetDefaultDevice());
+ ScopedVclPtrInstance< VirtualDevice > aVirtualDeviceMask(*Application::GetDefaultDevice(), 1L);
// Prepare VirtualDevices and their states
aVirtualDevice->EnableMapMode(false);
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 8b26870142ec..4c8df82cf393 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -252,7 +252,7 @@ namespace drawinglayer
const Rectangle aPrimitiveRectangle(
basegfx::fround(aPrimitiveRange.getMinX()), basegfx::fround(aPrimitiveRange.getMinY()),
basegfx::fround(aPrimitiveRange.getMaxX()), basegfx::fround(aPrimitiveRange.getMaxY()));
- ScopedVclPtr<VirtualDevice> aContentVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > aContentVDev;
MapMode aNewMapMode(pLastOutputDevice->GetMapMode());
mpOutputDevice = aContentVDev.get();
@@ -2016,7 +2016,7 @@ namespace drawinglayer
const Rectangle aRectPixel(mpOutputDevice->LogicToPixel(aRectLogic));
Size aSizePixel(aRectPixel.GetSize());
const Point aEmptyPoint;
- ScopedVclPtr<VirtualDevice> aBufferDevice( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > aBufferDevice;
const sal_uInt32 nMaxQuadratPixels(500000);
const sal_uInt32 nViewVisibleArea(aSizePixel.getWidth() * aSizePixel.getHeight());
double fReduceFactor(1.0);
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx
index e64f7d3d84e0..2dd3d9d8d2ee 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -73,7 +73,7 @@ namespace drawinglayer
const Point aEmptyPoint;
const Size aSizePixel(nDiscreteWidth, nDiscreteHeight);
geometry::ViewInformation2D aViewInformation2D(rViewInformation2D);
- ScopedVclPtr<VirtualDevice> maContent(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > maContent;
// prepare vdev
maContent->SetOutputSizePixel(aSizePixel, false);
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index d775fb12f57c..827a9afb88e8 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1755,7 +1755,7 @@ SvxFont EditEngine::GetStandardSvxFont( sal_Int32 nPara )
void EditEngine::StripPortions()
{
- ScopedVclPtr<VirtualDevice> aTmpDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > aTmpDev;
Rectangle aBigRect( Point( 0, 0 ), Size( 0x7FFFFFFF, 0x7FFFFFFF ) );
if ( IsVertical() )
{
diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx
index f882e8cc7751..34d2a5a5d36b 100644
--- a/editeng/source/misc/splwrap.cxx
+++ b/editeng/source/misc/splwrap.cxx
@@ -411,7 +411,7 @@ bool SvxSpellWrapper::SpellNext( )
WAIT_OFF();
sal_uInt16 nResId = bReverse ? RID_SVXSTR_QUERY_BW_CONTINUE : RID_SVXSTR_QUERY_CONTINUE;
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(pWin, EditResId(nResId), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aBox(pWin, EditResId(nResId), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if ( aBox->Execute() != RET_YES )
{
// sacrifice the other area if necessary ask for special area
diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx
index 542e88221b2b..f732eff901b4 100644
--- a/extensions/source/abpilot/typeselectionpage.cxx
+++ b/extensions/source/abpilot/typeselectionpage.cxx
@@ -243,7 +243,7 @@ namespace abp
if (AST_INVALID == getSelectedType( ))
{
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, ModuleRes(RID_STR_NEEDTYPESELECTION)));
+ ScopedVclPtrInstance< MessageDialog > aError(this, ModuleRes(RID_STR_NEEDTYPESELECTION));
aError->Execute();
return false;
}
diff --git a/extensions/source/bibliography/bibview.cxx b/extensions/source/bibliography/bibview.cxx
index f91b60e6ba89..668e691d5a97 100644
--- a/extensions/source/bibliography/bibview.cxx
+++ b/extensions/source/bibliography/bibview.cxx
@@ -141,7 +141,7 @@ namespace bib
{
sErrorString += "\n";
sErrorString += BIB_RESSTR(RID_MAP_QUESTION);
- ScopedVclPtr<QueryBox> aQuery(new QueryBox(this, WB_YES_NO, sErrorString) );
+ ScopedVclPtrInstance< QueryBox > aQuery(this, WB_YES_NO, sErrorString);
aQuery->SetDefaultCheckBoxText();
short nResult = aQuery->Execute();
BibModul::GetConfig()->SetShowColumnAssignmentWarning(
diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx
index 285d20ed6732..889a61032980 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -1484,7 +1484,7 @@ void BibDataManager::RemoveMeAsUidListener()
void BibDataManager::CreateMappingDialog(vcl::Window* pParent)
{
- VclPtr<MappingDialog_Impl> pDlg(new MappingDialog_Impl(pParent, this));
+ VclPtrInstance< MappingDialog_Impl > pDlg(pParent, this);
if(RET_OK == pDlg->Execute() && pBibView)
{
reload();
@@ -1494,7 +1494,7 @@ void BibDataManager::CreateMappingDialog(vcl::Window* pParent)
OUString BibDataManager::CreateDBChangeDialog(vcl::Window* pParent)
{
OUString uRet;
- VclPtr<DBChangeDialog_Impl> pDlg(new DBChangeDialog_Impl(pParent, this ));
+ VclPtrInstance< DBChangeDialog_Impl > pDlg(pParent, this );
if(RET_OK == pDlg->Execute())
{
OUString sNewURL = pDlg->GetCurrentURL();
diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
index 6c84e4601f77..f343e7503293 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -357,7 +357,7 @@ namespace pcr
,m_bUpdate(true)
,m_pControlContextImpl( new PropertyControlContext_Impl( *this ) )
{
- ScopedVclPtr<ListBox> aListBox(new ListBox(this,WB_DROPDOWN));
+ ScopedVclPtrInstance< ListBox > aListBox(this,WB_DROPDOWN);
aListBox->SetPosSizePixel(Point(0,0),Size(100,100));
m_nRowHeight = aListBox->GetSizePixel().Height()+2;
SetBackground( pParent->GetBackground() );
diff --git a/extensions/source/propctrlr/commoncontrol.cxx b/extensions/source/propctrlr/commoncontrol.cxx
index 96fd15c12e9b..fa223eefff64 100644
--- a/extensions/source/propctrlr/commoncontrol.cxx
+++ b/extensions/source/propctrlr/commoncontrol.cxx
@@ -98,7 +98,7 @@ namespace pcr
if ( !m_pControlWindow )
return;
- ScopedVclPtr<ComboBox> aComboBox(new ComboBox(m_pControlWindow, WB_DROPDOWN));
+ ScopedVclPtrInstance< ComboBox > aComboBox(m_pControlWindow, WB_DROPDOWN);
aComboBox->SetPosSizePixel(Point(0,0), Size(100,100));
m_pControlWindow->SetSizePixel(aComboBox->GetSizePixel());
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 5fb6c116df7b..d8c7185bceb3 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2608,7 +2608,7 @@ namespace pcr
OSL_PRECOND( m_pInfoService.get(), "FormComponentPropertyHandler::impl_dialogListSelection_nothrow: no property meta data!" );
OUString sPropertyUIName( m_pInfoService->getPropertyTranslation( m_pInfoService->getPropertyId( _rProperty ) ) );
- ScopedVclPtr<ListSelectionDialog> aDialog(new ListSelectionDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, _rProperty, sPropertyUIName ) );
+ ScopedVclPtrInstance< ListSelectionDialog > aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, _rProperty, sPropertyUIName );
_rClearBeforeDialog.clear();
return ( RET_OK == aDialog->Execute() );
}
@@ -2685,7 +2685,7 @@ namespace pcr
return false;
- ScopedVclPtr<FormLinkDialog> aDialog(new FormLinkDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, xMasterProp, m_xContext ) );
+ ScopedVclPtrInstance< FormLinkDialog > aDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent, xMasterProp, m_xContext );
_rClearBeforeDialog.clear();
return ( RET_OK == aDialog->Execute() );
}
@@ -2871,7 +2871,7 @@ namespace pcr
{ // do this in an own block. The dialog needs to be destroyed before we call
// destroyItemSet
- ScopedVclPtr<ControlCharacterDialog> aDlg(new ControlCharacterDialog( impl_getDefaultDialogParent_nothrow(), *pSet ) );
+ ScopedVclPtrInstance< ControlCharacterDialog > aDlg( impl_getDefaultDialogParent_nothrow(), *pSet );
_rClearBeforeDialog.clear();
if ( RET_OK == aDlg->Execute() )
{
@@ -2942,7 +2942,7 @@ namespace pcr
bool FormComponentPropertyHandler::impl_dialogChooseLabelControl_nothrow( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const
{
- ScopedVclPtr<OSelectLabelDialog> dlgSelectLabel(new OSelectLabelDialog( impl_getDefaultDialogParent_nothrow(), m_xComponent ) );
+ ScopedVclPtrInstance< OSelectLabelDialog > dlgSelectLabel( impl_getDefaultDialogParent_nothrow(), m_xComponent );
_rClearBeforeDialog.clear();
bool bSuccess = ( RET_OK == dlgSelectLabel->Execute() );
if ( bSuccess )
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index a212c56c4028..b6edcb05face 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -292,7 +292,7 @@ short SaneDlg::Execute()
{
if( ! Sane::IsSane() )
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, SaneResId(STR_COULD_NOT_BE_INIT)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, SaneResId(STR_COULD_NOT_BE_INIT));
aErrorBox->Execute();
return sal_False;
}
@@ -575,7 +575,7 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton )
aString = aString.replaceFirst( "%s", Sane::GetVendor( mrSane.GetDeviceNumber() ) );
aString = aString.replaceFirst( "%s", Sane::GetModel( mrSane.GetDeviceNumber() ) );
aString = aString.replaceFirst( "%s", Sane::GetType( mrSane.GetDeviceNumber() ) );
- ScopedVclPtr<MessageDialog> aInfoBox(new MessageDialog(this, aString, VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aInfoBox(this, aString, VCL_MESSAGE_INFO);
aInfoBox->Execute();
}
else if( pButton == mpPreviewButton )
@@ -604,7 +604,7 @@ IMPL_LINK( SaneDlg, ClickBtnHdl, Button*, pButton )
x[ i ] = (double)i;
mrSane.GetOptionValue( mnCurrentOption, y.get() );
- ScopedVclPtr<GridDialog> aGrid(new GridDialog( x.get(), y.get(), nElements, this ) );
+ ScopedVclPtrInstance< GridDialog > aGrid( x.get(), y.get(), nElements, this );
aGrid->SetText( mrSane.GetOptionName( mnCurrentOption ) );
aGrid->setBoundings( 0, mfMin, nElements, mfMax );
if( aGrid->Execute() && aGrid->getNewYValues() )
@@ -856,7 +856,7 @@ void SaneDlg::AcquirePreview()
if( nOption == -1 )
{
OUString aString(SaneResId(STR_SLOW_PREVIEW));
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, aString, VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL));
+ ScopedVclPtrInstance< MessageDialog > aBox(this, aString, VCL_MESSAGE_WARNING, VCL_BUTTONS_OK_CANCEL);
if (aBox->Execute() == RET_CANCEL)
return;
}
@@ -866,7 +866,7 @@ void SaneDlg::AcquirePreview()
BitmapTransporter aTransporter;
if( ! mrSane.Start( aTransporter ) )
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(this, SaneResId(STR_ERROR_SCAN)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(this, SaneResId(STR_ERROR_SCAN));
aErrorBox->Execute();
}
else
diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx
index 7a1895608d3a..7d4da1f523fe 100644
--- a/extensions/source/scanner/scanunx.cxx
+++ b/extensions/source/scanner/scanunx.cxx
@@ -299,7 +299,7 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex
);
pHolder->m_bBusy = true;
- ScopedVclPtr<SaneDlg> aDlg(new SaneDlg(NULL, pHolder->m_aSane, listener.is()) );
+ ScopedVclPtrInstance< SaneDlg > aDlg(nullptr, pHolder->m_aSane, listener.is());
bRet = aDlg->Execute();
bScan = aDlg->getDoScan();
pHolder->m_bBusy = false;
diff --git a/filter/source/graphic/GraphicExportDialog.cxx b/filter/source/graphic/GraphicExportDialog.cxx
index 4f425d8b3273..94f02c58e62d 100644
--- a/filter/source/graphic/GraphicExportDialog.cxx
+++ b/filter/source/graphic/GraphicExportDialog.cxx
@@ -107,7 +107,7 @@ void GraphicExportDialog::setTitle( const OUString& aTitle )
sal_Int16 GraphicExportDialog::execute() throw ( RuntimeException, std::exception )
{
sal_Int16 nReturn = ui::dialogs::ExecutableDialogResults::CANCEL;
- ScopedVclPtr<GraphicExportOptionsDialog> graphicExportOptionsDialog(new GraphicExportOptionsDialog( Application::GetDefDialogParent(), mxSourceDocument ) );
+ ScopedVclPtrInstance< GraphicExportOptionsDialog > graphicExportOptionsDialog( Application::GetDefDialogParent(), mxSourceDocument );
if (graphicExportOptionsDialog->Execute() == RET_OK )
{
maFilterDataSequence = graphicExportOptionsDialog->getFilterData();
diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx
index c6404e503cc5..fe8a90af8614 100644
--- a/filter/source/graphicfilter/eos2met/eos2met.cxx
+++ b/filter/source/graphicfilter/eos2met/eos2met.cxx
@@ -1851,7 +1851,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
if( aGDIFont.GetAlign() != ALIGN_BASELINE)
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
if( aGDIFont.GetAlign()==ALIGN_TOP )
aPt.Y()+=(long)pVDev->GetFontMetric( aGDIFont ).GetAscent();
@@ -1880,7 +1880,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
if( aGDIFont.GetAlign() != ALIGN_BASELINE )
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
if( aGDIFont.GetAlign() == ALIGN_TOP )
aPt.Y()+=(long)pVDev->GetFontMetric(aGDIFont).GetAscent();
else
@@ -1923,7 +1923,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
case META_STRETCHTEXT_ACTION:
{
const MetaStretchTextAction* pA = static_cast<const MetaStretchTextAction*>(pMA);
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
sal_uInt16 i;
sal_Int32 nNormSize;
OUString aStr;
@@ -2068,7 +2068,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
case META_GRADIENT_ACTION:
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
GDIMetaFile aTmpMtf;
const MetaGradientAction* pA = static_cast<const MetaGradientAction*>(pMA);
@@ -2080,7 +2080,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
case META_HATCH_ACTION:
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
GDIMetaFile aTmpMtf;
const MetaHatchAction* pA = static_cast<const MetaHatchAction*>(pMA);
diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx
index d978c45a5d50..10736f5b78f0 100644
--- a/filter/source/graphicfilter/epict/epict.cxx
+++ b/filter/source/graphicfilter/epict/epict.cxx
@@ -1699,7 +1699,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
if ( aSrcFont.GetAlign() != ALIGN_BASELINE )
{
- ScopedVclPtrInstance<VirtualDevice> pVirDev;
+ ScopedVclPtrInstance< VirtualDevice > pVirDev;
if (aSrcFont.GetAlign()==ALIGN_TOP)
aPt.Y()+=(long)pVirDev->GetFontMetric(aSrcFont).GetAscent();
else
@@ -1719,7 +1719,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
if (aSrcFont.GetAlign()!=ALIGN_BASELINE)
{
- ScopedVclPtr<VirtualDevice> pVirDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev;
if (aSrcFont.GetAlign()==ALIGN_TOP)
aPt.Y()+=(long)pVirDev->GetFontMetric(aSrcFont).GetAscent();
@@ -1737,7 +1737,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
const MetaStretchTextAction* pA = static_cast<const MetaStretchTextAction*>(pMA);
Point aPt( pA->GetPoint() );
OUString aStr = pA->GetText().copy( pA->GetIndex(),pA->GetLen() );
- ScopedVclPtr<VirtualDevice> pVirDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev;
boost::scoped_array<long> pDXAry(new long[ aStr.getLength() ]);
sal_Int32 nNormSize( pVirDev->GetTextArray( aStr,pDXAry.get() ) );
@@ -1773,7 +1773,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
{
const MetaBmpAction* pA = static_cast<const MetaBmpAction*>(pMA);
const Bitmap aBmp( pA->GetBitmap() );
- ScopedVclPtr<VirtualDevice> pVirDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev;
WriteOpcode_BitsRect( pA->GetPoint(), pVirDev->PixelToLogic( aBmp.GetSizePixel(), aSrcMapMode ), aBmp );
}
@@ -1800,7 +1800,7 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
{
const MetaBmpExAction* pA = static_cast<const MetaBmpExAction*>(pMA);
const Bitmap aBmp( Graphic( pA->GetBitmapEx() ).GetBitmap() );
- ScopedVclPtr<VirtualDevice> pVirDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev;
WriteOpcode_BitsRect( pA->GetPoint(), pVirDev->PixelToLogic( aBmp.GetSizePixel(), aSrcMapMode ), aBmp );
}
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 47071f7be51a..3be7cb400c7f 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -418,7 +418,7 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
{
Bitmap aBmp( rGraphic.GetBitmap() );
pAMTF = new GDIMetaFile();
- ScopedVclPtr<VirtualDevice> pTmpVDev(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pTmpVDev;
pAMTF->Record( pTmpVDev );
pTmpVDev->DrawBitmap( Point(), aBmp );
pAMTF->Stop();
@@ -486,7 +486,7 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter
pResMgr = ResMgr::CreateResMgr( "eps", Application::GetSettings().GetUILanguageTag() );
if( pResMgr )
{
- ScopedVclPtr<InfoBox> aInfoBox(new InfoBox( NULL, ResId(KEY_VERSION_CHECK, *pResMgr).toString() ) );
+ ScopedVclPtrInstance< InfoBox > aInfoBox( nullptr, ResId(KEY_VERSION_CHECK, *pResMgr).toString() );
aInfoBox->Execute();
delete pResMgr;
}
@@ -940,7 +940,7 @@ void PSWriter::ImplWriteActions( const GDIMetaFile& rMtf, VirtualDevice& rVDev )
case META_HATCH_ACTION :
{
- ScopedVclPtr<VirtualDevice> l_pVirDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > l_pVirDev;
GDIMetaFile aTmpMtf;
l_pVirDev->SetMapMode( rVDev.GetMapMode() );
@@ -1608,7 +1608,7 @@ void PSWriter::ImplIntersect( const tools::PolyPolygon& rPolyPoly )
void PSWriter::ImplWriteGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient, VirtualDevice& rVDev )
{
- ScopedVclPtr<VirtualDevice> l_pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > l_pVDev;
GDIMetaFile aTmpMtf;
l_pVDev->SetMapMode( rVDev.GetMapMode() );
l_pVDev->AddGradientActions( rPolyPoly.GetBoundRect(), rGradient, aTmpMtf );
@@ -2141,7 +2141,7 @@ void PSWriter::ImplText( const OUString& rUniString, const Point& rPos, const lo
vcl::Font aNotRotatedFont( maFont );
aNotRotatedFont.SetOrientation( 0 );
- ScopedVclPtr<VirtualDevice> pVirDev( new VirtualDevice( 1 ) );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev( 1 );
pVirDev->SetMapMode( rVDev.GetMapMode() );
pVirDev->SetFont( aNotRotatedFont );
pVirDev->SetTextAlign( eTextAlign );
diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx
index 41b699405363..503606dd4977 100644
--- a/filter/source/graphicfilter/ieps/ieps.cxx
+++ b/filter/source/graphicfilter/ieps/ieps.cxx
@@ -125,7 +125,7 @@ static int ImplGetLen( sal_uInt8* pBuf, int nMax )
static void MakeAsMeta(Graphic &rGraphic)
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
GDIMetaFile aMtf;
Bitmap aBmp( rGraphic.GetBitmap() );
Size aSize = aBmp.GetPrefSize();
@@ -442,7 +442,7 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
long nWidth, long nHeight, Graphic &rGraphic)
{
GDIMetaFile aMtf;
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
vcl::Font aFont;
pVDev->EnableOutput( false );
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 4d51af094b97..57bc11ae283f 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -1387,7 +1387,7 @@ GraphicObject lclDrawHatch( const ::com::sun::star::drawing::Hatch& rHatch, cons
// do not create a bitmap in page size, that would explode file sizes (and have no good quality).
// Better use a MetaFile graphic in page size; thus we have good quality due to vector format and
// no bit file sizes.
- ScopedVclPtr<VirtualDevice> pVDev(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
GDIMetaFile aMtf;
pVDev->SetOutputSizePixel(Size(2, 2));
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 6ed9b4ca872c..f5cccd94da1e 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4397,7 +4397,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
rOutliner.SetStyleSheetPool( static_cast<SfxStyleSheetPool*>(pModel->GetStyleSheetPool()) );
rOutliner.SetUpdateMode( false );
rOutliner.SetText( *pParaObj );
- ScopedVclPtr<VirtualDevice> pVirDev( new VirtualDevice( 1 ) );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev( 1 );
pVirDev->SetMapMode( MAP_100TH_MM );
sal_Int32 i, nParagraphs = rOutliner.GetParagraphCount();
if ( nParagraphs )
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 5a672f44b157..7f3a6cebedef 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -844,7 +844,7 @@ IMPL_LINK_NOARG(ImpPDFTabGeneralPage, ToggleExportPDFAHdl)
// if a password was set, inform the user that this will not be used in PDF/A case
if( mpCbPDFA1b->IsChecked() && pSecPage && pSecPage->hasPassword() )
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, PDFFilterResId(STR_WARN_PASSWORD_PDFA), VCL_MESSAGE_WARNING));
+ ScopedVclPtrInstance< MessageDialog > aBox(this, PDFFilterResId(STR_WARN_PASSWORD_PDFA), VCL_MESSAGE_WARNING);
aBox->Execute();
}
@@ -1291,7 +1291,7 @@ void ImpPDFTabSecurityPage::SetFilterConfigItem( const ImpPDFTabDialog* paParen
IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl)
{
- ScopedVclPtr<SfxPasswordDialog> aPwdDialog(new SfxPasswordDialog( this, &msUserPwdTitle ) );
+ ScopedVclPtrInstance< SfxPasswordDialog > aPwdDialog( this, &msUserPwdTitle );
aPwdDialog->SetMinLen( 0 );
aPwdDialog->ShowMinLengthText(false);
aPwdDialog->ShowExtras( SHOWEXTRAS_CONFIRM | SHOWEXTRAS_PASSWORD2 | SHOWEXTRAS_CONFIRM2 );
diff --git a/filter/source/pdf/pdfinteract.cxx b/filter/source/pdf/pdfinteract.cxx
index 0c2750547110..d01281211ebf 100644
--- a/filter/source/pdf/pdfinteract.cxx
+++ b/filter/source/pdf/pdfinteract.cxx
@@ -53,7 +53,7 @@ sal_Bool SAL_CALL PDFInteractionHandler::handleInteractionRequest( const Referen
sal_Int32 nCodes = aExc.ErrorCodes.getLength();
for( sal_Int32 i = 0; i < nCodes; i++ )
aCodes.insert( (vcl::PDFWriter::ErrorCode)aExc.ErrorCodes.getConstArray()[i] );
- ScopedVclPtr<ImplErrorDialog> aDlg(new ImplErrorDialog( aCodes ) );
+ ScopedVclPtrInstance< ImplErrorDialog > aDlg( aCodes );
aDlg->Execute();
bHandled = true;
}
diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx
index bd97906c37f3..4d565088f280 100644
--- a/filter/source/svg/svgfontexport.cxx
+++ b/filter/source/svg/svgfontexport.cxx
@@ -78,7 +78,7 @@ SVGFontExport::GlyphSet& SVGFontExport::implGetGlyphSet( const vcl::Font& rFont
void SVGFontExport::implCollectGlyphs()
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
ObjectVector::const_iterator aIter( maObjects.begin() );
pVDev->EnableOutput( false );
@@ -189,7 +189,7 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont )
SvXMLElementExport aExp( mrExport, XML_NAMESPACE_NONE, "defs", true, true );
OUString aCurIdStr( aEmbeddedFontStr );
OUString aUnitsPerEM( OUString::number( nFontEM ) );
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
vcl::Font aFont( rFont );
aFont.SetSize( Size( 0, nFontEM ) );
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index d889b1473c69..a5597e50f54b 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -242,7 +242,7 @@ void XMLFilterSettingsDialog::onNew()
aTempInfo.maDocumentService = "com.sun.star.text.TextDocument";
// execute XML Filter Dialog
- ScopedVclPtr<XMLFilterTabDialog> aDlg(new XMLFilterTabDialog( this, *getXSLTDialogResMgr(), mxContext, &aTempInfo ) );
+ ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResMgr(), mxContext, &aTempInfo );
if ( aDlg->Execute() == RET_OK )
{
// insert the new filter
@@ -263,7 +263,7 @@ void XMLFilterSettingsDialog::onEdit()
filter_info_impl* pOldInfo = static_cast<filter_info_impl*>(pEntry->GetUserData());
// execute XML Filter Dialog
- ScopedVclPtr<XMLFilterTabDialog> aDlg(new XMLFilterTabDialog( this, *getXSLTDialogResMgr(), mxContext, pOldInfo ) );
+ ScopedVclPtrInstance< XMLFilterTabDialog > aDlg( this, *getXSLTDialogResMgr(), mxContext, pOldInfo );
if ( aDlg->Execute() == RET_OK )
{
filter_info_impl* pNewInfo = aDlg->getNewFilterInfo();
@@ -788,7 +788,7 @@ void XMLFilterSettingsDialog::onTest()
{
filter_info_impl* pInfo = static_cast<filter_info_impl*>(pEntry->GetUserData());
- ScopedVclPtr<XMLFilterTestDialog> aDlg(new XMLFilterTestDialog(this, mxContext));
+ ScopedVclPtrInstance< XMLFilterTestDialog > aDlg(this, mxContext);
aDlg->test( *pInfo );
}
}
@@ -806,7 +806,7 @@ void XMLFilterSettingsDialog::onDelete()
OUString aMessage(RESIDSTR(STR_WARN_DELETE));
aMessage = aMessage.replaceFirst( aPlaceHolder, pInfo->maFilterName );
- ScopedVclPtr<WarningBox> aWarnBox(new WarningBox(this, (WinBits)(WB_YES_NO | WB_DEF_YES), aMessage ));
+ ScopedVclPtrInstance< WarningBox > aWarnBox(this, (WinBits)(WB_YES_NO | WB_DEF_YES), aMessage );
if( aWarnBox->Execute() == RET_YES )
{
try
@@ -936,7 +936,7 @@ void XMLFilterSettingsDialog::onSave()
aMsg = aMsg.replaceFirst( sPlaceholder, aURL.GetName() );
}
- ScopedVclPtr<InfoBox> aBox(new InfoBox(this, aMsg ));
+ ScopedVclPtrInstance< InfoBox > aBox(this, aMsg );
aBox->Execute();
}
}
@@ -1002,7 +1002,7 @@ void XMLFilterSettingsDialog::onOpen()
aMsg = aMsg.replaceFirst( sPlaceholder, OUString::number( nFilters ) );
}
- ScopedVclPtr<InfoBox> aBox(new InfoBox(this, aMsg ));
+ ScopedVclPtrInstance< InfoBox > aBox(this, aMsg );
aBox->Execute();
}
}
diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
index 73caf6c297ac..eb1eae879e06 100644
--- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx
@@ -265,7 +265,7 @@ bool XMLFilterTabDialog::onOk()
aMessage = aMessage.replaceAll( "%s", aReplace1 );
}
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, aMessage));
+ ScopedVclPtrInstance< MessageDialog > aBox(this, aMessage);
aBox->Execute();
if( pFocusWindow )
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index f57854163f64..880fa0f405ba 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -445,7 +445,7 @@ namespace frm
if(needConfirmation)
{
// TODO: shouldn't this be done with an interaction handler?
- ScopedVclPtr<QueryBox> aQuery(new QueryBox( NULL, WB_YES_NO_CANCEL | WB_DEF_YES, FRM_RES_STRING( RID_STR_QUERY_SAVE_MODIFIED_ROW ) ) );
+ ScopedVclPtrInstance< QueryBox > aQuery( nullptr, WB_YES_NO_CANCEL | WB_DEF_YES, FRM_RES_STRING( RID_STR_QUERY_SAVE_MODIFIED_ROW ) );
switch ( aQuery->Execute() )
{
case RET_NO:
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index 2d9f04e3c929..537a773f7ebd 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -194,7 +194,7 @@ IMPL_LINK ( PlacesListBox, DoubleClick, void*, EMPTYARG )
PlacePtr pPlace = maPlaces[nSelected];
if ( pPlace->IsEditable() == true && !pPlace->IsLocal( ) )
{
- ScopedVclPtr<PlaceEditDialog> aDlg(new PlaceEditDialog(mpDlg, pPlace));
+ ScopedVclPtrInstance< PlaceEditDialog > aDlg(mpDlg, pPlace);
short aRetCode = aDlg->Execute();
switch(aRetCode) {
case RET_OK :
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 55bfcdd7c2c4..8b0e552e4168 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -681,7 +681,7 @@ IMPL_STATIC_LINK( SvtFileDialog, NewFolderHdl_Impl, PushButton*, EMPTYARG )
SmartContent aContent( pThis->_pFileView->GetViewURL( ) );
OUString aTitle;
aContent.getTitle( aTitle );
- ScopedVclPtr<QueryFolderNameDialog> aDlg(new QueryFolderNameDialog(pThis, aTitle, SVT_RESSTR(STR_SVT_NEW_FOLDER)) );
+ ScopedVclPtrInstance< QueryFolderNameDialog > aDlg(pThis, aTitle, SVT_RESSTR(STR_SVT_NEW_FOLDER));
bool bHandled = false;
while ( !bHandled )
@@ -1065,7 +1065,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid )
"$filename$",
aFileObj.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET)
);
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(pThis, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aBox(pThis, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if ( aBox->Execute() != RET_YES )
return 0;
}
@@ -1110,7 +1110,7 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid )
}
sError = sError.replaceFirst( "$name$", sInvalidFile );
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(pThis, sError));
+ ScopedVclPtrInstance< MessageDialog > aError(pThis, sError);
aError->Execute();
return 0;
}
@@ -1263,7 +1263,7 @@ IMPL_STATIC_LINK ( SvtFileDialog, ConnectToServerPressed_Hdl, void*, EMPTYARG )
{
pThis->_pFileView->EndInplaceEditing( false );
- ScopedVclPtr<PlaceEditDialog> aDlg(new PlaceEditDialog(pThis));
+ ScopedVclPtrInstance< PlaceEditDialog > aDlg(pThis);
short aRetCode = aDlg->Execute();
switch (aRetCode) {
@@ -1899,7 +1899,7 @@ short SvtFileDialog::PrepareExecute()
if ( bEmpty )
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, SVT_RESSTR(STR_SVT_NOREMOVABLEDEVICE)));
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SVT_RESSTR(STR_SVT_NOREMOVABLEDEVICE));
aBox->Execute();
return 0;
}
diff --git a/lotuswordpro/source/filter/lwppagelayout.cxx b/lotuswordpro/source/filter/lwppagelayout.cxx
index 4464af3b25a9..08b76150a4ff 100644
--- a/lotuswordpro/source/filter/lwppagelayout.cxx
+++ b/lotuswordpro/source/filter/lwppagelayout.cxx
@@ -640,7 +640,7 @@ void LwpPageLayout::GetWidthAndHeight(double& fWidth, double& fHeight)
if(GetUsePrinterSettings())
{
//replaced by printer paper size
- ScopedVclPtr<Printer> pPrinter( new Printer() );
+ ScopedVclPtrInstance< Printer > pPrinter;
bool bScreen = pPrinter->IsDisplayPrinter();
if (!bScreen)//Printer available
{
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index e22a968d0db9..ff9600100ac2 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -712,7 +712,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
lcl_CharPropertiesToItems( _rxReportControlFormat, *pDescriptor );
{ // want the dialog to be destroyed before our set
- ScopedVclPtr<ORptPageDialog> aDlg(new ORptPageDialog(pParent, pDescriptor.get(), "CharDialog"));
+ ScopedVclPtrInstance< ORptPageDialog > aDlg(pParent, pDescriptor.get(), "CharDialog");
uno::Reference< report::XShape > xShape( _rxReportControlFormat, uno::UNO_QUERY );
if ( xShape.is() )
aDlg->RemoveTabPage("background");
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index de0fa71c11b1..7ba2540ff9d4 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -1567,7 +1567,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
uno::Reference< report::XFormattedField> xFormattedField(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY);
if ( xFormattedField.is() )
{
- ScopedVclPtr<ConditionalFormattingDialog> aDlg(new ConditionalFormattingDialog( getView(), xFormattedField.get(), *this ));
+ ScopedVclPtrInstance< ConditionalFormattingDialog > aDlg( getView(), xFormattedField.get(), *this );
aDlg->Execute();
}
}
@@ -1577,7 +1577,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
{
if ( !aArgs.getLength() )
{
- ScopedVclPtr<ODateTimeDialog> aDlg(new ODateTimeDialog(getView(),getDesignView()->getCurrentSection(),this));
+ ScopedVclPtrInstance< ODateTimeDialog > aDlg(getView(),getDesignView()->getCurrentSection(),this);
aDlg->Execute();
}
else
@@ -1589,7 +1589,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
{
if ( !aArgs.getLength() )
{
- ScopedVclPtr<OPageNumberDialog> aDlg(new OPageNumberDialog(getView(),m_xReportDefinition,this));
+ ScopedVclPtrInstance< OPageNumberDialog > aDlg(getView(),m_xReportDefinition,this);
aDlg->Execute();
}
else
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 6b65c7023e02..50cc31d177a5 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -843,7 +843,7 @@ void ScDocument::UpdateExternalRefLinks(vcl::Window* pWin)
aBuf.append(OUString(ScResId(SCSTR_EXTDOC_NOT_LOADED)));
aBuf.appendAscii("\n\n");
aBuf.append(aFile);
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(pWin, aBuf.makeStringAndClear()));
+ ScopedVclPtrInstance< MessageDialog > aBox(pWin, aBuf.makeStringAndClear());
aBox->Execute();
}
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 01ffeaa9c422..30884cc17bc5 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -3205,7 +3205,7 @@ uno::Reference<sdbc::XRowSet> ScDPCollection::DBCaches::createRowSet(
catch ( const sdbc::SQLException& rError )
{
//! store error message
- ScopedVclPtr<InfoBox> aInfoBox(new InfoBox( 0, OUString(rError.Message) ) );
+ ScopedVclPtrInstance< InfoBox > aInfoBox( nullptr, OUString(rError.Message) );
aInfoBox->Execute();
}
catch ( uno::Exception& )
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index d8980fce3301..c0ac54e814ff 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -577,7 +577,7 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool)
}
OutputDevice* pDefaultDev = Application::GetDefaultDevice();
- ScopedVclPtr<VirtualDevice> pVirtWindow( new VirtualDevice( *pDefaultDev ) );
+ ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *pDefaultDev );
pVirtWindow->SetMapMode(MAP_PIXEL);
vcl::Font aDefFont;
pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // Font color doesn't matter here
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 65cef7fac920..4b47cf4525a2 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -253,7 +253,7 @@ bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput,
{
//TODO: different error message, if found, but not bAllowed ??
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog( pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND)));
+ ScopedVclPtrInstance< MessageDialog > aBox( pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
aBox->Execute();
}
@@ -359,7 +359,7 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput,
{
//TODO: different error message, if found, but not bAllowed ??
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND)));
+ ScopedVclPtrInstance< MessageDialog > aBox(pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
aBox->Execute();
}
@@ -410,7 +410,7 @@ bool ScValidationData::DoError( vcl::Window* pParent, const OUString& rInput,
}
}
- ScopedVclPtr<MessBox> aBox(new MessBox( pParent, WinBits(nStyle), aTitle, aMessage ) );
+ ScopedVclPtrInstance< MessBox > aBox( pParent, WinBits(nStyle), aTitle, aMessage );
sal_uInt16 nRet = aBox->Execute();
return ( eErrorStyle == SC_VALERR_STOP || nRet == RET_CANCEL );
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index 6f8971b81147..f9c971a63d2c 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -433,7 +433,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu
// Factor is printer to display ratio
double nPPTX = ScGlobal::nScreenPPTX * (double) aZoom / nOutputFactor;
double nPPTY = ScGlobal::nScreenPPTY * (double) aZoom;
- ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoom, aZoom, pVirtDev);
aCxt.setExtraHeight(ScGlobal::nLastRowHeightExtra);
mpDoc->SetOptimalHeight(aCxt, 0, nEndRow, 0);
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 5990bb1b7d42..b31ce187f479 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -337,7 +337,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
Rectangle aMMRect = pDoc->GetMMRect( aBlock.aStart.Col(), aBlock.aStart.Row(),
aBlock.aEnd.Col(), aBlock.aEnd.Row(),
aBlock.aStart.Tab() );
- ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
pVirtDev->SetOutputSizePixel( pVirtDev->LogicToPixel( aMMRect.GetSize(), MAP_100TH_MM ) );
PaintToDev( pVirtDev, pDoc, 1.0, aBlock, false );
@@ -358,7 +358,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt
// like SvEmbeddedTransfer::GetData:
GDIMetaFile aMtf;
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
MapMode aMapMode( pEmbObj->GetMapUnit() );
Rectangle aVisArea( pEmbObj->GetVisArea( ASPECT_CONTENT ) );
diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 9a6282a1af82..618a5af268a9 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -401,7 +401,7 @@ void ScZoomSliderWnd::DoPaint( const Rectangle& /*rRect*/ )
Size aSliderWindowSize = GetOutputSizePixel();
Rectangle aRect( Point( 0, 0 ), aSliderWindowSize );
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *this ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *this );
pVDev->SetOutputSizePixel( aSliderWindowSize );
Rectangle aSlider = aRect;
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index cfcae9e2d015..5c08ecb1fc96 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -287,7 +287,7 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl )
if(bWarn)
{
//show warning message and don't close
- ScopedVclPtr<WarningBox> aWarn(new WarningBox(this, WB_OK, maStrWarnSameValue ));
+ ScopedVclPtrInstance< WarningBox > aWarn(this, WB_OK, maStrWarnSameValue );
aWarn->Execute();
}
else
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index e58d36f449b0..7df39d8335b2 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -519,7 +519,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl)
aBuf.append(aStrDelMsg.getToken(0, '#'));
aBuf.append(aStrEntry);
aBuf.append(aStrDelMsg.getToken(1, '#'));
- ScopedVclPtr<QueryBox> aBox(new QueryBox(this, WinBits(WB_YES_NO|WB_DEF_YES), aBuf.makeStringAndClear()));
+ ScopedVclPtrInstance< QueryBox > aBox(this, WinBits(WB_YES_NO|WB_DEF_YES), aBuf.makeStringAndClear());
if (RET_YES == aBox->Execute())
{
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index a73629c3ba65..4cc9de6ed1b0 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -539,7 +539,7 @@ IMPL_LINK( ScDPSubtotalDlg, ClickHdl, PushButton*, pBtn )
{
if (pBtn == mpBtnOptions)
{
- VclPtr<ScDPSubtotalOptDlg> pDlg(new ScDPSubtotalOptDlg( this, mrDPObj, maLabelData, mrDataFields, mbEnableLayout ));
+ VclPtrInstance< ScDPSubtotalOptDlg > pDlg( this, mrDPObj, maLabelData, mrDataFields, mbEnableLayout );
if( pDlg->Execute() == RET_OK )
pDlg->FillLabelData( maLabelData );
}
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index a236448b5cbc..df197e37db44 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -635,7 +635,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
nErrStringId = STR_MSSG_IMPORTDATA_0;
aErrorMessage = ScGlobal::GetRscString( nErrStringId );
}
- ScopedVclPtr<InfoBox> aInfoBox(new InfoBox( rDocShell.GetActiveDialogParent(), aErrorMessage ) );
+ ScopedVclPtrInstance< InfoBox > aInfoBox( rDocShell.GetActiveDialogParent(), aErrorMessage );
aInfoBox->Execute();
}
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 22c7986b6114..305ab149d229 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3756,7 +3756,7 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
{
if (!bApi)
{
- ScopedVclPtr<InfoBox> aBox(new InfoBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ) );
+ ScopedVclPtrInstance< InfoBox > aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
aBox->Execute();
}
return false;
@@ -3786,7 +3786,7 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
{
if (!bApi)
{
- ScopedVclPtr<InfoBox> aBox(new InfoBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ) );
+ ScopedVclPtrInstance< InfoBox > aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
aBox->Execute();
}
return false;
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index b8fd016fb433..191a284b0e16 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -821,7 +821,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_SAVE_LATER ) );
aMessage = aMessage.replaceFirst( "%1", aUserName );
- ScopedVclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage ) );
+ ScopedVclPtrInstance< WarningBox > aBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage );
if ( aBox->Execute() == RET_RETRY )
{
bRetry = true;
@@ -1457,7 +1457,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
Fraction aZoom( 1, 1 );
double nPPTX = ScGlobal::nScreenPPTX * (double) aZoom / GetOutputFactor(); // Factor is printer display ratio
double nPPTY = ScGlobal::nScreenPPTY * (double) aZoom;
- ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
// all sheets (for Excel import)
SCTAB nTabCount = aDocument.GetTableCount();
for (SCTAB nTab=0; nTab<nTabCount; nTab++)
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 66269ec2ebbb..b97bf8675e89 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -368,7 +368,7 @@ void ScDocShell::CalcOutputFactor()
pRefDev->SetFont(aOldFont);
pRefDev->SetMapMode(aOldMode);
- ScopedVclPtr<VirtualDevice> pVirtWindow( new VirtualDevice( *Application::GetDefaultDevice() ) );
+ ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *Application::GetDefaultDevice() );
pVirtWindow->SetMapMode(MAP_PIXEL);
pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // font color doesn't matter here
pVirtWindow->SetFont(aDefFont);
@@ -1202,7 +1202,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
while ( bLoop )
{
bLoop = false;
- ScopedVclPtr<ScConflictsDlg> aDlg(new ScConflictsDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList ) );
+ ScopedVclPtrInstance< ScConflictsDlg > aDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList );
if ( aDlg->Execute() == RET_CANCEL )
{
ScopedVclPtrInstance<QueryBox> aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
@@ -1320,7 +1320,7 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
PostPaintExtras();
PostPaintGridAll();
- ScopedVclPtr<InfoBox> aInfoBox(new InfoBox( GetActiveDialogParent(), ScGlobal::GetRscString( STR_DOC_UPDATED ) ) );
+ ScopedVclPtrInstance< InfoBox > aInfoBox( GetActiveDialogParent(), ScGlobal::GetRscString( STR_DOC_UPDATED ) );
aInfoBox->Execute();
}
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 9fd3dee3ef76..714919b71c97 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -222,7 +222,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
aMessage += sTarget;
aMessage += aTemplate.getToken( 1, '#' );
- ScopedVclPtr<QueryBox> aBox(new QueryBox( 0, WinBits(WB_YES_NO | WB_DEF_YES), aMessage ));
+ ScopedVclPtrInstance< QueryBox > aBox( nullptr, WinBits(WB_YES_NO | WB_DEF_YES), aMessage );
bDo = ( aBox->Execute() == RET_YES );
}
@@ -913,7 +913,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
break;
}
- ScopedVclPtr<ScShareDocumentDlg> aDlg(new ScShareDocumentDlg( GetActiveDialogParent(), pViewData ) );
+ ScopedVclPtrInstance< ScShareDocumentDlg > aDlg( GetActiveDialogParent(), pViewData );
if ( aDlg->Execute() == RET_OK )
{
bool bSetShared = aDlg->IsShareDocumentChecked();
@@ -1016,7 +1016,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_TRY_LATER ) );
aMessage = aMessage.replaceFirst( "%1", aUserName );
- ScopedVclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage ) );
+ ScopedVclPtrInstance< WarningBox > aBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage );
aBox->Execute();
}
else
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index db1b60b32f82..f95815389e66 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -81,7 +81,7 @@ void ScDocShell::ErrorMessage( sal_uInt16 nGlobStrId )
}
}
- ScopedVclPtr<InfoBox> aBox(new InfoBox( pParent, ScGlobal::GetRscString( nGlobStrId ) ) );
+ ScopedVclPtrInstance< InfoBox > aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) );
aBox->Execute();
if (bFocus)
pParent->GrabFocus();
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 039f1dc9d289..4cd55805c1e0 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -531,7 +531,7 @@ void ScDocShell::CheckConfigOptions()
if (pViewShell)
{
vcl::Window* pParent = pViewShell->GetFrameWin();
- ScopedVclPtr<InfoBox> aBox(new InfoBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS)));
+ ScopedVclPtrInstance< InfoBox > aBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS));
aBox->Execute();
}
diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx
index 3fb31fc3bbc4..42745eb3f344 100644
--- a/sc/source/ui/docshell/documentlinkmgr.cxx
+++ b/sc/source/ui/docshell/documentlinkmgr.cxx
@@ -165,7 +165,7 @@ bool DocumentLinkManager::updateDdeLinks( vcl::Window* pWin )
aBuf.append(aElem);
aBuf.appendAscii("\nType : ");
aBuf.append(aType);
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(pWin, aBuf.makeStringAndClear()));
+ ScopedVclPtrInstance< MessageDialog > aBox(pWin, aBuf.makeStringAndClear());
aBox->Execute();
}
}
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index b68471cb76b1..e11b6be89f79 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1452,7 +1452,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
if ( !mbApi && nStartCol != nEndCol &&
!pDoc->IsBlockEmpty( nTab, nStartCol + 1, nStartRow, nEndCol, nRow ) )
{
- ScopedVclPtr<ScReplaceWarnBox> aBox(new ScReplaceWarnBox( pDocSh->GetActiveDialogParent() ));
+ ScopedVclPtrInstance< ScReplaceWarnBox > aBox( pDocSh->GetActiveDialogParent() );
if ( aBox->Execute() != RET_YES )
{
return false;
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 160f083e562d..43b8f0616b54 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -271,7 +271,7 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh,
// really store as link only?
if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
{
- ScopedVclPtr<SvxLinkWarningDialog> aWarnDlg(new SvxLinkWarningDialog(pWin,aFileName));
+ ScopedVclPtrInstance< SvxLinkWarningDialog > aWarnDlg(pWin,aFileName);
if( aWarnDlg->Execute() != RET_OK )
bAsLink = false; // don't store as link
}
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index cfe48e0a0047..f8c2be9ca17b 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -200,7 +200,7 @@ void ScGraphicShell::ExecuteCompressGraphic( SfxRequest& )
if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
- ScopedVclPtr<CompressGraphicsDialog> dialog(new CompressGraphicsDialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() ) );
+ ScopedVclPtrInstance< CompressGraphicsDialog > dialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() );
if ( dialog->Execute() == RET_OK )
{
SdrGrafObj* pNewObject = dialog->GetCompressedSdrGrafObj();
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index f31138d32643..013b89e5b661 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -861,7 +861,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
{
// show progress dialog
- ScopedVclPtr<ScSolverProgressDialog> aProgress(new ScSolverProgressDialog( this ) );
+ ScopedVclPtrInstance< ScSolverProgressDialog > aProgress( this );
sal_Int32 nTimeout = 0;
if ( FindTimeout( nTimeout ) )
aProgress->SetTimeLimit( nTimeout );
@@ -1086,7 +1086,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
static_cast<SCCOL>(aObjective.Column), static_cast<SCROW>(aObjective.Row),
static_cast<SCTAB>(aObjective.Sheet));
- ScopedVclPtr<ScSolverSuccessDialog> aDialog(new ScSolverSuccessDialog( this, aResultStr ) );
+ ScopedVclPtrInstance< ScSolverSuccessDialog > aDialog( this, aResultStr );
if ( aDialog->Execute() == RET_OK )
{
// keep results and close dialog
@@ -1100,7 +1100,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
uno::Reference<sheet::XSolverDescription> xDesc( xSolver, uno::UNO_QUERY );
if ( xDesc.is() )
aError = xDesc->getStatusDescription(); // error description from component
- ScopedVclPtr<ScSolverNoSolutionDialog> aDialog(new ScSolverNoSolutionDialog( this, aError ) );
+ ScopedVclPtrInstance< ScSolverNoSolutionDialog > aDialog( this, aError );
aDialog->Execute();
}
diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx
index 5865738948fd..68f1d7ff58cd 100644
--- a/sc/source/ui/miscdlgs/retypepassdlg.cxx
+++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx
@@ -293,7 +293,7 @@ IMPL_LINK( ScRetypePassDlg, RetypeBtnHdl, PushButton*, pBtn )
// What the ... !?
return 0;
- ScopedVclPtr<ScRetypePassInputDlg> aDlg(new ScRetypePassInputDlg(this, pProtected));
+ ScopedVclPtrInstance< ScRetypePassInputDlg > aDlg(this, pProtected);
if (aDlg->Execute() == RET_OK)
{
// OK is pressed. Update the protected item.
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 7b29f03666d5..447c6a0bd887 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -317,7 +317,7 @@ void ScSolverOptionsDialog::EditOption()
{
if ( pStringItem->IsDouble() )
{
- ScopedVclPtr<ScSolverValueDialog> aValDialog(new ScSolverValueDialog( this ));
+ ScopedVclPtrInstance< ScSolverValueDialog > aValDialog( this );
aValDialog->SetOptionName( pStringItem->GetText() );
aValDialog->SetValue( pStringItem->GetDoubleValue() );
if ( aValDialog->Execute() == RET_OK )
@@ -328,7 +328,7 @@ void ScSolverOptionsDialog::EditOption()
}
else
{
- ScopedVclPtr<ScSolverIntegerDialog> aIntDialog(new ScSolverIntegerDialog( this ));
+ ScopedVclPtrInstance< ScSolverIntegerDialog > aIntDialog( this );
aIntDialog->SetOptionName( pStringItem->GetText() );
aIntDialog->SetValue( pStringItem->GetIntValue() );
if ( aIntDialog->Execute() == RET_OK )
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 5ae0899ccd63..d3717aa8cd6a 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -139,7 +139,7 @@ void ScTpFormulaOptions::UpdateCustomCalcRadioButtons(bool bDefault)
void ScTpFormulaOptions::LaunchCustomCalcSettings()
{
- ScopedVclPtr<ScCalcOptionsDialog> aDlg(new ScCalcOptionsDialog(this, maCurrentConfig));
+ ScopedVclPtrInstance< ScCalcOptionsDialog > aDlg(this, maCurrentConfig);
if (aDlg->Execute() == RET_OK)
{
maCurrentConfig = aDlg->GetConfig();
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index 6f39b90a33eb..1f3b9bed4b30 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -201,7 +201,7 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl)
else
{
OUString aText;
- VclPtr<SfxSingleTabDialog> pDlg(new SfxSingleTabDialog(this, aDataSet));
+ VclPtrInstance< SfxSingleTabDialog > pDlg(this, aDataSet);
const int nSettingsId = 42;
bool bRightPage = m_pCntSharedBox->IsChecked()
|| ( SVX_PAGE_LEFT != SvxPageUsage(nPageUsage) );
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index 39e221a0af81..a383eed17f2f 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -257,7 +257,7 @@ bool ScBlockUndo::AdjustHeight()
{
ScDocument& rDoc = pDocShell->GetDocument();
- ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
Fraction aZoomX( 1, 1 );
Fraction aZoomY = aZoomX;
double nPPTX, nPPTY;
@@ -355,7 +355,7 @@ void ScMultiBlockUndo::AdjustHeight()
{
ScDocument& rDoc = pDocShell->GetDocument();
- ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
Fraction aZoomX( 1, 1 );
Fraction aZoomY = aZoomX;
double nPPTX, nPPTY;
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index d6817c7753c0..fbf3d5a251a5 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1182,7 +1182,7 @@ void ScUndoDragDrop::PaintArea( ScRange aRange, sal_uInt16 nExtFlags ) const
if (pViewShell)
{
- ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
ScViewData& rViewData = pViewShell->GetViewData();
sc::RowHeightContext aCxt(
rViewData.GetPPTX(), rViewData.GetPPTY(), rViewData.GetZoomX(), rViewData.GetZoomY(),
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 85ae2b85c012..8187858f64a9 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -841,7 +841,7 @@ void ScUndoAutoFormat::Redo()
if (bSize)
{
- ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
Fraction aZoomX(1,1);
Fraction aZoomY = aZoomX;
double nPPTX,nPPTY;
diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx
index 96fbf37cf94b..6e9c5f61b902 100644
--- a/sc/source/ui/undo/undostyl.cxx
+++ b/sc/source/ui/undo/undostyl.cxx
@@ -106,7 +106,7 @@ static void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, bo
{
//! move to document or docshell
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index 3a6cdaa873c8..7bbce7a4b1cb 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -755,7 +755,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName )
if ( eFamily == SFX_STYLE_FAMILY_PARA )
{
// wie ScViewFunc::RemoveStyleSheetInUse
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
@@ -1096,7 +1096,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle )
{
// Zeilenhoehen anpassen...
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
@@ -1463,7 +1463,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault()
{
// row heights
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
@@ -1845,7 +1845,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt
{
// Zeilenhoehen anpassen...
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MAP_TWIP );
double nPPTX = aLogic.X() / 1000.0;
double nPPTY = aLogic.Y() / 1000.0;
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index cc5206614a33..0f2624572b22 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2682,7 +2682,7 @@ void ScCellShell::ExecuteDataPilotDialog()
if (nSrcErrorId)
{
// Error occurred during data creation. Launch an error and bail out.
- ScopedVclPtr<InfoBox> aBox(new InfoBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(nSrcErrorId)));
+ ScopedVclPtrInstance< InfoBox > aBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(nSrcErrorId));
aBox->Execute();
return;
}
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 43704b5793b8..fb6b9f81c01b 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -740,7 +740,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
break;
case SID_DATA_STREAMS:
{
- ScopedVclPtr<sc::DataStreamDlg> aDialog(new sc::DataStreamDlg( GetViewData()->GetDocShell(), pTabViewShell->GetDialogParent() ) );
+ ScopedVclPtrInstance< sc::DataStreamDlg > aDialog( GetViewData()->GetDocShell(), pTabViewShell->GetDialogParent() );
ScDocument *pDoc = GetViewData()->GetDocument();
sc::DocumentLinkManager& rMgr = pDoc->GetDocLinkManager();
sc::DataStream* pStrm = rMgr.getDataStream();
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 3fac550a1b84..efe371abb2dc 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1422,7 +1422,7 @@ void ScTabView::ErrorMessage( sal_uInt16 nGlobStrId )
}
}
- ScopedVclPtr<InfoBox> aBox(new InfoBox( pParent, ScGlobal::GetRscString( nGlobStrId ) ) );
+ ScopedVclPtrInstance< InfoBox > aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) );
aBox->Execute();
if (bFocus)
pParent->GrabFocus();
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 6b6927384b6c..b37fbcaa9ca9 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -975,7 +975,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
{
OUString aText(ScResId(SCSTR_PASSWORD));
- VclPtr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(GetDialogParent(), &aText));
+ VclPtrInstance< SfxPasswordDialog > pDlg(GetDialogParent(), &aText);
pDlg->SetText( ScResId(SCSTR_UNPROTECTDOC) );
pDlg->SetMinLen( 0 );
pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand() );
@@ -997,7 +997,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
{
OUString aText(ScResId(SCSTR_PASSWORDOPT));
- VclPtr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(GetDialogParent(), &aText));
+ VclPtrInstance< SfxPasswordDialog > pDlg(GetDialogParent(), &aText);
pDlg->SetText( ScResId(SCSTR_PROTECTDOC) );
pDlg->SetMinLen( 0 );
pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand() );
@@ -1043,7 +1043,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if (pProtect && pProtect->isProtectedWithPass())
{
OUString aText( ScResId(SCSTR_PASSWORDOPT) );
- VclPtr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(GetDialogParent(), &aText));
+ VclPtrInstance< SfxPasswordDialog > pDlg(GetDialogParent(), &aText);
pDlg->SetText( ScResId(SCSTR_UNPROTECTTAB) );
pDlg->SetMinLen( 0 );
pDlg->SetHelpId( GetStaticInterface()->GetSlot(FID_PROTECT_TABLE)->GetCommand() );
@@ -1069,7 +1069,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
{
// Protect a current sheet.
- VclPtr<ScTableProtectionDlg> pDlg(new ScTableProtectionDlg(GetDialogParent()));
+ VclPtrInstance< ScTableProtectionDlg > pDlg(GetDialogParent());
ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
if (pProtect)
diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
index 0a5ed833d235..17dbaa8d2831 100644
--- a/sc/source/ui/view/tabvwshh.cxx
+++ b/sc/source/ui/view/tabvwshh.cxx
@@ -263,7 +263,7 @@ bool ScTabViewShell::ExecuteRetypePassDlg(ScPasswordHash eDesiredHash)
{
ScDocument* pDoc = GetViewData().GetDocument();
- VclPtr<ScRetypePassDlg> pDlg(new ScRetypePassDlg(GetDialogParent()));
+ VclPtrInstance< ScRetypePassDlg > pDlg(GetDialogParent());
pDlg->SetDataFromDocument(*pDoc);
pDlg->SetDesiredHash(eDesiredHash);
if (pDlg->Execute() != RET_OK)
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 9f1549a4412d..f1dd83099799 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -832,7 +832,7 @@ bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument
if (!bIsEmpty)
{
- ScopedVclPtr<ScReplaceWarnBox> aBox(new ScReplaceWarnBox(pParentWnd));
+ ScopedVclPtrInstance< ScReplaceWarnBox > aBox(pParentWnd);
if (aBox->Execute() != RET_YES)
{
// changing the configuration is within the ScReplaceWarnBox
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 2b8ef53a601d..0ccf18bd5b2b 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -99,7 +99,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
if (pActWin)
{
pEngine->SetPaperSize(Size(100000,100000));
- VclPtr<vcl::Window> aWin(new vcl::Window( pActWin ));
+ VclPtrInstance< vcl::Window > aWin( pActWin );
EditView aEditView( pEngine.get(), aWin.get() );
aEditView.SetOutputArea(Rectangle(0,0,100000,100000));
@@ -387,7 +387,7 @@ void ScViewFunc::DoThesaurus( bool bRecord )
LanguageType eLnge = ScViewUtil::GetEffLanguage( &rDoc, ScAddress( nCol, nRow, nTab ) );
OUString aErr = SvtLanguageTable::GetLanguageString(eLnge);
aErr += ScGlobal::GetRscString( STR_SPELLING_NO_LANG );
- ScopedVclPtr<InfoBox> aBox(new InfoBox( GetViewData().GetDialogParent(), aErr ) );
+ ScopedVclPtrInstance< InfoBox > aBox( GetViewData().GetDialogParent(), aErr );
aBox->Execute();
}
if (pThesaurusEngine->IsModified())
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index c3942f0006f9..403cf230156f 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1403,7 +1403,7 @@ void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
ScDocShellModificator aModificator( *pDocSh );
- ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
pVirtDev->SetMapMode(MAP_PIXEL);
pDoc->StyleSheetChanged( pStyleSheet, true, pVirtDev,
rViewData.GetPPTX(),
@@ -1429,7 +1429,7 @@ void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet )
ScDocShellModificator aModificator( *pDocSh );
- ScopedVclPtr<VirtualDevice> pVirtDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirtDev;
pVirtDev->SetMapMode(MAP_PIXEL);
pDoc->StyleSheetChanged( pStyleSheet, false, pVirtDev,
rViewData.GetPPTX(),
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index b52803b439ad..bd34dee7caa8 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -242,7 +242,7 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
if (!bOK)
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, SD_RESSTR(STR_READ_DATA_ERROR)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, SD_RESSTR(STR_READ_DATA_ERROR));
aErrorBox->Execute();
CloseBookmarkDoc();
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index 94eea155e53c..c8ec3ee85e24 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -169,7 +169,7 @@ void SdGRFFilter::HandleGraphicFilterError( sal_uInt16 nFilterError, sal_uLong n
ErrorHandler::HandleError( ERRCODE_IO_GENERAL );
else
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, SD_RESSTR(nId)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, SD_RESSTR(nId));
aErrorBox->Execute();
}
}
diff --git a/sd/source/filter/html/buttonset.cxx b/sd/source/filter/html/buttonset.cxx
index 40464ca2cc51..ab7590f09bee 100644
--- a/sd/source/filter/html/buttonset.cxx
+++ b/sd/source/filter/html/buttonset.cxx
@@ -197,7 +197,7 @@ bool ButtonSetImpl::getPreview( int nSet, const std::vector< OUString >& rButton
std::vector< Graphic > aGraphics;
- ScopedVclPtr<VirtualDevice> pDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pDev;
pDev->SetMapMode(MapMode(MAP_PIXEL));
Size aSize;
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index 985841e0ec7b..f195797cc040 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -3113,7 +3113,7 @@ bool HtmlExport::checkForExistingFiles()
OUString aSystemPath;
osl::FileBase::getSystemPathFromFileURL( maExportPath, aSystemPath );
aMsg = aMsg.replaceFirst( "%FILENAME", aSystemPath );
- ScopedVclPtr<WarningBox> aWarning(new WarningBox( 0, WB_YES_NO | WB_DEF_YES, aMsg ));
+ ScopedVclPtrInstance< WarningBox > aWarning( nullptr, WB_YES_NO | WB_DEF_YES, aMsg );
aWarning->SetImage( WarningBox::GetStandardImage() );
bFound = ( RET_NO == aWarning->Execute() );
diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx
index 415d65ac47d9..0653353d9224 100644
--- a/sd/source/filter/html/pubdlg.cxx
+++ b/sd/source/filter/html/pubdlg.cxx
@@ -1162,7 +1162,7 @@ IMPL_LINK_NOARG(SdPublishingDlg, FinishHdl)
{
bRetry = false;
- ScopedVclPtr<SdDesignNameDlg> aDlg(new SdDesignNameDlg(this, aName ));
+ ScopedVclPtrInstance< SdDesignNameDlg > aDlg(this, aName );
if ( aDlg->Execute() == RET_OK )
{
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index f0aba1483ff3..9f0bad85b88f 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -1548,7 +1548,7 @@ void CustomAnimationEffectTabPage::openSoundFileDialog()
{
OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE));
aStrWarning = aStrWarning.replaceFirst("%", aFile);
- ScopedVclPtr<WarningBox> aWarningBox(new WarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ));
+ ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
aWarningBox->SetModalInputMode (true);
bQuitLoop = aWarningBox->Execute() != RET_RETRY;
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 047507f5693c..3532be1cdf6c 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -1573,7 +1573,7 @@ void CustomAnimationPane::showOptions(const OString& sPage)
{
STLPropertySet* pSet = createSelectionSet();
- VclPtr<CustomAnimationDialog> pDlg(new CustomAnimationDialog(this, pSet, sPage));
+ VclPtrInstance< CustomAnimationDialog > pDlg(this, pSet, sPage);
if( pDlg->Execute() )
{
addUndo();
@@ -1752,7 +1752,7 @@ void CustomAnimationPane::onChange( bool bCreate )
}
}
- VclPtr<CustomAnimationCreateDialog> pDlg(new CustomAnimationCreateDialog( this, this, aTargets, bHasText, sPresetId, fDuration ));
+ VclPtrInstance< CustomAnimationCreateDialog > pDlg( this, this, aTargets, bHasText, sPresetId, fDuration );
if( pDlg->Execute() )
{
addUndo();
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index 9a5a28549b0b..9f83e71aaf2f 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -743,7 +743,7 @@ void SlideTransitionPane::openSoundFileDialog()
{
OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE));
aStrWarning = aStrWarning.replaceFirst("%", aFile);
- ScopedVclPtr<WarningBox> aWarningBox(new WarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning ));
+ ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
aWarningBox->SetModalInputMode (true);
bQuitLoop = (aWarningBox->Execute() != RET_RETRY);
diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx
index 9ac354940fb1..112b55922445 100644
--- a/sd/source/ui/annotations/annotationmanager.cxx
+++ b/sd/source/ui/annotations/annotationmanager.cxx
@@ -694,7 +694,7 @@ void AnnotationManagerImpl::SelectNextAnnotation(bool bForeward)
// Pop up question box that asks the user whether to wrap around.
// The dialog is made modal with respect to the whole application.
- ScopedVclPtr<QueryBox> aQuestionBox (new QueryBox( NULL, (WB_YES_NO | WB_DEF_YES), SD_RESSTR(nStringId)));
+ ScopedVclPtrInstance< QueryBox > aQuestionBox( nullptr, (WB_YES_NO | WB_DEF_YES), SD_RESSTR(nStringId));
aQuestionBox->SetImage( QueryBox::GetStandardImage() );
if (aQuestionBox->Execute() != RET_YES)
break;
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 62ee8dace947..5b94e7c9910b 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -515,7 +515,7 @@ void AnnotationTag::deselect()
BitmapEx AnnotationTag::CreateAnnotationBitmap( bool bSelected )
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
OUString sAuthor( getInitials( mxAnnotation->getAuthor() ) );
sAuthor += OUString( ' ' );
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index ddc8b9b9fb90..ecf89cf9054f 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -105,7 +105,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl)
{
if (pImagesLst->GetEntryCount() == 0)
{
- ScopedVclPtr<WarningBox> aWarning(new WarningBox(this, WB_OK, SD_RESSTR(STR_PHOTO_ALBUM_EMPTY_WARNING)));
+ ScopedVclPtrInstance< WarningBox > aWarning(this, WB_OK, SD_RESSTR(STR_PHOTO_ALBUM_EMPTY_WARNING));
aWarning->Execute();
}
else
@@ -462,7 +462,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl)
}
else
{
- ScopedVclPtr<InfoBox> aInfo(new InfoBox(this, OUString("Function is not implemented!")));
+ ScopedVclPtrInstance< InfoBox > aInfo(this, OUString("Function is not implemented!"));
aInfo->Execute();
}
EndDialog();
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 3fcebfbff8e9..47f785e5e038 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -455,7 +455,7 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, void *, pBtn )
}
else // delete everything
{
- ScopedVclPtr<WarningBox> aWarnBox(new WarningBox( this, WB_YES_NO, SD_RESSTR( STR_ASK_DELETE_ALL_PICTURES ) ));
+ ScopedVclPtrInstance< WarningBox > aWarnBox( this, WB_YES_NO, SD_RESSTR( STR_ASK_DELETE_ALL_PICTURES ) );
short nReturn = aWarnBox->Execute();
if( nReturn == RET_YES )
@@ -548,7 +548,7 @@ void AnimationWindow::UpdateControl(bool const bDisableCtrls)
static_cast<SdrObject*>(pPage->GetObj(m_nCurrentFrame));
if( pObject )
{
- ScopedVclPtr<VirtualDevice> pVD(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pVD;
Rectangle aObjRect( pObject->GetCurrentBoundRect() );
Size aObjSize( aObjRect.GetSize() );
Point aOrigin( Point( -aObjRect.Left(), -aObjRect.Top() ) );
diff --git a/sd/source/ui/dlg/brkdlg.cxx b/sd/source/ui/dlg/brkdlg.cxx
index 4cd524707300..7a961dbe1379 100644
--- a/sd/source/ui/dlg/brkdlg.cxx
+++ b/sd/source/ui/dlg/brkdlg.cxx
@@ -103,7 +103,7 @@ IMPL_LINK( BreakDlg, UpDate, void*, nInit )
// update status bar or show a error message?
if(nInit == reinterpret_cast<void*>(1L))
{
- ScopedVclPtr<MessageDialog> aErrBox(new MessageDialog(this, SD_RESSTR(STR_BREAK_FAIL)));
+ ScopedVclPtrInstance< MessageDialog > aErrBox(this, SD_RESSTR(STR_BREAK_FAIL));
aErrBox->Execute();
}
else
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index 00cec79e80a2..d8a98f413f39 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -126,7 +126,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
if( p == m_pBtnNew )
{
pCustomShow = NULL;
- ScopedVclPtr<SdDefineCustomShowDlg> aDlg(new SdDefineCustomShowDlg( this, rDoc, pCustomShow ));
+ ScopedVclPtrInstance< SdDefineCustomShowDlg > aDlg( this, rDoc, pCustomShow );
if( aDlg->Execute() == RET_OK )
{
if( pCustomShow )
@@ -154,7 +154,7 @@ IMPL_LINK( SdCustomShowDlg, ClickButtonHdl, void *, p )
{
DBG_ASSERT( pCustomShowList, "pCustomShowList does not exist" );
pCustomShow = (*pCustomShowList)[ nPos ];
- ScopedVclPtr<SdDefineCustomShowDlg> aDlg(new SdDefineCustomShowDlg( this, rDoc, pCustomShow ));
+ ScopedVclPtrInstance< SdDefineCustomShowDlg > aDlg( this, rDoc, pCustomShow );
if( aDlg->Execute() == RET_OK )
{
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx
index f772bb97c22e..e0895092d7fb 100644
--- a/sd/source/ui/dlg/docprev.cxx
+++ b/sd/source/ui/dlg/docprev.cxx
@@ -241,7 +241,7 @@ void SdDocPreviewWin::updateViewSettings()
pMtf = new GDIMetaFile;
- ScopedVclPtr<VirtualDevice> pVDev(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
const Fraction aFrac( pDoc->GetScaleFraction() );
const MapMode aMap( pDoc->GetScaleUnit(), Point(), aFrac, aFrac );
diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx
index 9237de3f9cfe..51206936dd07 100644
--- a/sd/source/ui/dlg/sdpreslt.cxx
+++ b/sd/source/ui/dlg/sdpreslt.cxx
@@ -179,7 +179,7 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLayoutHdl)
*/
IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl)
{
- VclPtr<SfxNewFileDialog> pDlg(new SfxNewFileDialog(this, SFXWB_PREVIEW));
+ VclPtrInstance< SfxNewFileDialog > pDlg(this, SFXWB_PREVIEW);
pDlg->SetText(SD_RESSTR(STR_LOAD_PRESENTATION_LAYOUT));
if(!IsReallyVisible())
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 9afcdcfc7176..2bea6ebf5cda 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1012,7 +1012,7 @@ SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
if ( !mpBookmarkDoc )
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(this, SD_RESSTR(STR_READ_DATA_ERROR)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(this, SD_RESSTR(STR_READ_DATA_ERROR));
aErrorBox->Execute();
mpMedium = 0; //On failure the SfxMedium is invalid
}
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 4f4e783515e6..a6bcae748d0b 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -373,7 +373,7 @@ int SdTpOptionsMisc::DeactivatePage( SfxItemSet* pActiveSet )
FillItemSet( pActiveSet );
return LEAVE_PAGE;
}
- ScopedVclPtr<WarningBox> aWarnBox(new WarningBox( GetParent(), WB_YES_NO, SD_RESSTR( STR_WARN_SCALE_FAIL ) ));
+ ScopedVclPtrInstance< WarningBox > aWarnBox( GetParent(), WB_YES_NO, SD_RESSTR( STR_WARN_SCALE_FAIL ) );
if( aWarnBox->Execute() == RET_YES )
return KEEP_PAGE;
diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx
index 769d015b5de3..b4e66d5caf4c 100644
--- a/sd/source/ui/docshell/docshel2.cxx
+++ b/sd/source/ui/docshell/docshel2.cxx
@@ -193,7 +193,7 @@ Bitmap DrawDocShell::GetPagePreviewBitmap(SdPage* pPage, sal_uInt16 nMaxEdgePixe
MapMode aMapMode( MAP_100TH_MM );
const Size aSize( pPage->GetSize() );
const Point aNullPt;
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *Application::GetDefaultDevice() ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *Application::GetDefaultDevice() );
pVDev->SetMapMode( aMapMode );
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 72a5bc118e0a..a12d8b2ed52a 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -151,7 +151,7 @@ void FuInsertGraphic::DoExecute( SfxRequest& )
// really store as link only?
if( SvtMiscOptions().ShowLinkWarningDialog() )
{
- ScopedVclPtr<SvxLinkWarningDialog> aWarnDlg(new SvxLinkWarningDialog(mpWindow,aDlg.GetPath()));
+ ScopedVclPtrInstance< SvxLinkWarningDialog > aWarnDlg(mpWindow,aDlg.GetPath());
if( aWarnDlg->Execute() != RET_OK )
return; // don't store as link
}
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index fa683dbe7d94..7a7d98c9c7bd 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -281,7 +281,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
if( !bInserted )
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(mpWindow, SD_RESSTR( STR_READ_DATA_ERROR)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SD_RESSTR( STR_READ_DATA_ERROR));
aErrorBox->Execute();
delete pMedium;
}
@@ -431,7 +431,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
aErrorBox->Execute();
}
else
@@ -575,7 +575,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium)
if (nErr || pOutliner->GetEditEngine().GetText().isEmpty())
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(mpWindow, SD_RESSTR(STR_READ_DATA_ERROR));
aErrorBox->Execute();
}
else
diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx
index 6d67c9ac14ae..dc064412ff03 100644
--- a/sd/source/ui/slideshow/showwin.cxx
+++ b/sd/source/ui/slideshow/showwin.cxx
@@ -504,7 +504,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly )
if( SLIDE_NO_TIMEOUT != mnPauseTimeout )
{
MapMode aVMap( rMap );
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *this ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *this );
aVMap.SetOrigin( Point() );
pVDev->SetMapMode( aVMap );
diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
index c3f3bad8043c..8e3e2b0b6ad5 100644
--- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx
@@ -287,7 +287,7 @@ sal_Int32 Clipboard::GetInsertionPosition (::vcl::Window* pWindow)
else if (mrController.GetFocusManager().IsFocusShowing())
{
// Use the focus to determine the insertion position.
- ScopedVclPtr<SdInsertPasteDlg> aDialog (new SdInsertPasteDlg(pWindow));
+ ScopedVclPtrInstance< SdInsertPasteDlg > aDialog(pWindow);
if (aDialog->Execute() == RET_OK)
{
nInsertPosition = mrController.GetFocusManager().GetFocusedPageIndex();
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index b9d97b12b19b..7dfde4e00329 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -1068,7 +1068,7 @@ void Outliner::ShowEndOfSearchDialog (void)
// Show the message in an info box that is modal with respect to the
// whole application.
- ScopedVclPtr<MessageDialog> aInfoBox(new MessageDialog(NULL, aString, VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aInfoBox(nullptr, aString, VCL_MESSAGE_INFO);
ShowModalMessageBox (*aInfoBox.get());
@@ -1376,7 +1376,7 @@ bool Outliner::HandleFailedSearch (void)
if (HasNoPreviousMatch ())
{
// No match found in the whole presentation. Tell the user.
- ScopedVclPtr<InfoBox> aInfoBox (new InfoBox(NULL, SD_RESSTR(STR_SAR_NOT_FOUND)));
+ ScopedVclPtrInstance< InfoBox > aInfoBox(nullptr, SD_RESSTR(STR_SAR_NOT_FOUND));
ShowModalMessageBox (*aInfoBox.get());
}
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 3ea2b88a32de..9647e52c528f 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -993,7 +993,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
- ScopedVclPtr<CompressGraphicsDialog> dialog(new CompressGraphicsDialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() ) );
+ ScopedVclPtrInstance< CompressGraphicsDialog > dialog( GetParentWindow(), pGraphicObj, GetViewFrame()->GetBindings() );
if ( dialog->Execute() == RET_OK )
{
SdrGrafObj* pNewObject = dialog->GetCompressedSdrGrafObj();
diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx
index adffc746bf5c..c6bdfed2a8f0 100644
--- a/sd/source/ui/view/drviews6.cxx
+++ b/sd/source/ui/view/drviews6.cxx
@@ -294,7 +294,7 @@ void DrawViewShell::ExecBmpMask( SfxRequest& rReq )
if( pNewObj->IsLinkedGraphic() )
{
- ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( (vcl::Window*) GetActiveWindow(),"QueryUnlinkImageDialog","modules/sdraw/ui/queryunlinkimagedialog.ui") );
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( (vcl::Window*) GetActiveWindow(),"QueryUnlinkImageDialog","modules/sdraw/ui/queryunlinkimagedialog.ui");
if (RET_YES == aQueryBox->Execute())
pNewObj->ReleaseGraphicLink();
diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx
index 19bd115c7a85..7b2137113e9c 100644
--- a/sd/source/ui/view/drviews9.cxx
+++ b/sd/source/ui/view/drviews9.cxx
@@ -87,7 +87,7 @@ void DrawViewShell::ExecGallery(SfxRequest& rReq)
Graphic aGraphic( pGalleryItem->GetGraphic() );
// reduce size if necessary
- ScopedVclPtr<Window> aWindow(new Window(GetActiveWindow()));
+ ScopedVclPtrInstance< Window > aWindow(GetActiveWindow());
aWindow->SetMapMode(aGraphic.GetPrefMapMode());
Size aSizePix = aWindow->LogicToPixel(aGraphic.GetPrefSize());
aWindow->SetMapMode( MapMode(MAP_100TH_MM) );
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index b021cc1144fc..47938744425e 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -462,7 +462,7 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
bool bNewWin = false;
vcl::Window* pTopWin = GetTopWindow();
- ScopedVclPtr<SfxTemplateManagerDlg> aTemplDlg(new SfxTemplateManagerDlg);
+ ScopedVclPtrInstance< SfxTemplateManagerDlg > aTemplDlg;
int nRet = aTemplDlg->Execute();
if ( nRet == RET_OK )
{
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 27b4c9163752..ca1579ec249f 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -451,7 +451,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_SHOW_LICENSE:
{
- ScopedVclPtr<LicenseDialog> aDialog(new LicenseDialog);
+ ScopedVclPtrInstance< LicenseDialog > aDialog;
aDialog->Execute();
break;
}
@@ -539,7 +539,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_TEMPLATE_MANAGER:
{
- ScopedVclPtr<SfxTemplateManagerDlg> dlg(new SfxTemplateManagerDlg);
+ ScopedVclPtrInstance< SfxTemplateManagerDlg > dlg;
dlg->Execute();
bDone = true;
break;
@@ -547,7 +547,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_TEMPLATE_ADDRESSBOKSOURCE:
{
- ScopedVclPtr<svt::AddressBookSourceDialog> aDialog(new svt::AddressBookSourceDialog(GetTopWindow(), ::comphelper::getProcessComponentContext()));
+ ScopedVclPtrInstance< svt::AddressBookSourceDialog > aDialog(GetTopWindow(), ::comphelper::getProcessComponentContext());
aDialog->Execute();
bDone = true;
break;
diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index 8d66fa2bb126..b650538edc8e 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -271,7 +271,7 @@ bool SvDDEObject::Connect( SvBaseLink * pSvLink )
void SvDDEObject::Edit( vcl::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link& rEndEditHdl )
{
- ScopedVclPtr<SvDDELinkEditDialog> aDlg(new SvDDELinkEditDialog(pParent, pBaseLink) );
+ ScopedVclPtrInstance< SvDDELinkEditDialog > aDlg(pParent, pBaseLink);
if ( RET_OK == aDlg->Execute() && rEndEditHdl.IsSet() )
{
OUString sCommand = aDlg->GetCmd();
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 8debf888d69b..28323c5fef41 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1079,7 +1079,7 @@ IMPL_LINK_NOARG(SearchTabPage_Impl, SearchHdl)
if ( aFactories.empty() )
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_INFO_NOSEARCHRESULTS ), VCL_MESSAGE_INFO) );
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_INFO_NOSEARCHRESULTS ), VCL_MESSAGE_INFO);
aBox->Execute();
}
}
@@ -1225,7 +1225,7 @@ void BookmarksBox_Impl::DoAction( sal_uInt16 nAction )
sal_Int32 nPos = GetSelectEntryPos();
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- ScopedVclPtr<SfxAddHelpBookmarkDialog_Impl> aDlg(new SfxAddHelpBookmarkDialog_Impl(this, true));
+ ScopedVclPtrInstance< SfxAddHelpBookmarkDialog_Impl > aDlg(this, true);
aDlg->SetTitle( GetEntry( nPos ) );
if ( aDlg->Execute() == RET_OK )
{
@@ -2337,7 +2337,7 @@ IMPL_LINK( SfxHelpTextWindow_Impl, FindHdl, sfx2::SearchDialog*, pDlg )
else
{
DBG_ASSERT( pSrchDlg, "no search dialog" );
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(pSrchDlg, SfxResId( STR_INFO_NOSEARCHTEXTFOUND ), VCL_MESSAGE_INFO) );
+ ScopedVclPtrInstance< MessageDialog > aBox(pSrchDlg, SfxResId( STR_INFO_NOSEARCHTEXTFOUND ), VCL_MESSAGE_INFO);
aBox->Execute();
pSrchDlg->SetFocusOnEdit();
}
@@ -3212,7 +3212,7 @@ void SfxHelpWindow_Impl::DoAction( sal_uInt16 nActionId )
if ( aAny >>= aValue )
{
OUString aTitle( aValue );
- ScopedVclPtr<SfxAddHelpBookmarkDialog_Impl> aDlg(new SfxAddHelpBookmarkDialog_Impl(this, false));
+ ScopedVclPtrInstance< SfxAddHelpBookmarkDialog_Impl > aDlg(this, false);
aDlg->SetTitle( aTitle );
if ( aDlg->Execute() == RET_OK )
{
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index 348668185062..f120a177042b 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -158,7 +158,7 @@ short SvxOpenGraphicDialog::Execute()
// could not load?
if ( nFound == USHRT_MAX )
{
- ScopedVclPtr<WarningBox> aWarningBox(new WarningBox(NULL, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString()) );
+ ScopedVclPtrInstance< WarningBox > aWarningBox(nullptr, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString());
bQuitLoop = aWarningBox->Execute() != RET_RETRY;
}
else
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 25f0f099bd89..21e56b4c1920 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -605,7 +605,7 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
if ( impl_showOnlineHelp( aHelpURL ) )
return true;
- ScopedVclPtr<NoHelpErrorBox> aErrBox(new NoHelpErrorBox(const_cast< vcl::Window* >( pWindow )) );
+ ScopedVclPtrInstance< NoHelpErrorBox > aErrBox(const_cast< vcl::Window* >( pWindow ));
aErrBox->Execute();
return false;
}
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 4715a55fb694..6db9950b47e0 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -534,7 +534,7 @@ bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter )
// Here could a re-installation be offered
OUString aText( SfxResId(STR_FILTER_NOT_INSTALLED).toString() );
aText = aText.replaceFirst( "$(FILTER)", pFilter->GetUIName() );
- ScopedVclPtr<QueryBox> aQuery(new QueryBox(NULL, WB_YES_NO | WB_DEF_YES, aText) );
+ ScopedVclPtrInstance< QueryBox > aQuery(nullptr, WB_YES_NO | WB_DEF_YES, aText);
short nRet = aQuery->Execute();
if ( nRet == RET_YES )
{
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx
index 17a7e35c27db..103391877907 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -395,7 +395,7 @@ void BackingWindow::Paint( const Rectangle& )
DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack );
Pop();
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice( *this ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev( *this );
pVDev->EnableRTL( IsRTLEnabled() );
pVDev->SetOutputSizePixel( maStartCentButtons.GetSize() );
Point aOffset( Point( 0, 0 ) - maStartCentButtons.TopLeft());
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 8ad33279a0d7..c550ad94e37a 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1370,7 +1370,7 @@ CustomPropertiesEditButton::CustomPropertiesEditButton(vcl::Window* pParent, Win
IMPL_LINK_NOARG(CustomPropertiesEditButton, ClickHdl)
{
- VclPtr<DurationDialog_Impl> pDurationDlg(new DurationDialog_Impl( this, m_pLine->m_aDurationField->GetDuration() ));
+ VclPtrInstance< DurationDialog_Impl > pDurationDlg( this, m_pLine->m_aDurationField->GetDuration() );
if ( RET_OK == pDurationDlg->Execute() )
m_pLine->m_aDurationField->SetDuration( pDurationDlg->GetDuration() );
return 1;
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index b367b086e36a..818e43217c9b 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -858,7 +858,7 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css:
SolarMutexGuard aGuard;
vcl::Window* pParentWindow = VCLUnoHelper::GetWindow( xParentWindow );
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(pParentWindow, "ErrorFindEmailDialog", "sfx/ui/errorfindemaildialog.ui"));
+ ScopedVclPtrInstance< MessageDialog > aBox(pParentWindow, "ErrorFindEmailDialog", "sfx/ui/errorfindemaildialog.ui");
aBox->Execute();
eResult = SEND_MAIL_CANCELLED;
}
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index d9e393703949..fa98cff6c08c 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -645,7 +645,7 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
if (!pStyle->SetName(comphelper::string::stripStart(m_pNameRw->GetText(), ' ')))
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_TABPAGE_INVALIDNAME ), VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_TABPAGE_INVALIDNAME ), VCL_MESSAGE_INFO);
aBox->Execute();
m_pNameRw->GrabFocus();
m_pNameRw->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
@@ -662,7 +662,7 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
{
if ( !pStyle->SetFollow( aFollowEntry ) )
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_TABPAGE_INVALIDSTYLE ), VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_TABPAGE_INVALIDSTYLE ), VCL_MESSAGE_INFO);
aBox->Execute();
m_pFollowLb->GrabFocus();
return SfxTabPage::KEEP_PAGE;
@@ -682,7 +682,7 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
{
if ( !pStyle->SetParent( aParentEntry ) )
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_TABPAGE_INVALIDPARENT ), VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_TABPAGE_INVALIDPARENT ), VCL_MESSAGE_INFO);
aBox->Execute();
m_pBaseLb->GrabFocus();
return SfxTabPage::KEEP_PAGE;
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index 8eef6a765c69..de396429fa5f 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -71,7 +71,7 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl)
bConfirmFailed = true;
if ( bConfirmFailed )
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId(STR_ERROR_WRONG_CONFIRM)));
+ ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId(STR_ERROR_WRONG_CONFIRM));
aBox->Execute();
mpConfirm1ED->SetText( OUString() );
mpConfirm1ED->GrabFocus();
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx
index 7461eddd5473..7ba862eaeb93 100644
--- a/sfx2/source/dialog/recfloat.cxx
+++ b/sfx2/source/dialog/recfloat.cxx
@@ -152,7 +152,7 @@ bool SfxRecordingFloatWrapper_Impl::QueryClose()
com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder = pBindings->GetRecorder();
if ( xRecorder.is() && !xRecorder->getRecordedMacro().isEmpty() )
{
- ScopedVclPtr<QueryBox> aBox(new QueryBox(GetWindow(), WB_YES_NO | WB_DEF_NO , SfxResId(STR_MACRO_LOSS).toString()));
+ ScopedVclPtrInstance< QueryBox > aBox(GetWindow(), WB_YES_NO | WB_DEF_NO , SfxResId(STR_MACRO_LOSS).toString());
aBox->SetText( SfxResId(STR_CANCEL_RECORDING).toString() );
bRet = ( aBox->Execute() == RET_YES );
}
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
index 6260f5aa2b38..e80212d4e345 100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -99,7 +99,7 @@ static bool lcl_GetPassword(
/*out*/OUString &rPassword )
{
bool bRes = false;
- ScopedVclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(pParent));
+ ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg(pParent);
aPasswdDlg->SetMinLen( 1 );
if (bProtect)
aPasswdDlg->ShowExtras( SHOWEXTRAS_CONFIRM );
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 2274e61aa2d8..5f7d8155f09c 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1619,7 +1619,7 @@ void SfxCommonTemplateDialog_Impl::ActionSelect(sal_uInt16 nEntry)
nFilter=pStyleSheetPool->GetSearchMask();
pStyleSheetPool->SetSearchMask( eFam, SFXSTYLEBIT_USERDEF );
- ScopedVclPtr<SfxNewStyleDlg> pDlg(new SfxNewStyleDlg(pWindow, *pStyleSheetPool));
+ ScopedVclPtrInstance< SfxNewStyleDlg > pDlg(pWindow, *pStyleSheetPool);
// why? : FloatingWindow must not be parent of a modal dialog
if(RET_OK == pDlg->Execute())
{
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index 5e8967da78e3..11fb35f59a16 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -407,7 +407,7 @@ IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
{
SfxVersionInfo aInfo;
aInfo.aAuthor = SvtUserOptions().GetFullName();
- VclPtr<SfxViewVersionDialog_Impl> pDlg(new SfxViewVersionDialog_Impl(this, aInfo, true));
+ VclPtrInstance< SfxViewVersionDialog_Impl > pDlg(this, aInfo, true);
short nRet = pDlg->Execute();
if ( nRet == RET_OK )
{
@@ -439,7 +439,7 @@ IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
else if (pButton == m_pViewButton && pEntry)
{
SfxVersionInfo* pInfo = static_cast<SfxVersionInfo*>(pEntry->GetUserData());
- VclPtr<SfxViewVersionDialog_Impl> pDlg(new SfxViewVersionDialog_Impl(this, *pInfo, false));
+ VclPtrInstance<SfxViewVersionDialog_Impl> pDlg(this, *pInfo, false);
pDlg->Execute();
}
else if (pEntry && pButton == m_pCompareButton)
@@ -462,7 +462,7 @@ IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
}
else if (pButton == m_pCmisButton)
{
- VclPtr<SfxCmisVersionsDialog> pDlg(new SfxCmisVersionsDialog(pViewFrame, false));
+ VclPtrInstance< SfxCmisVersionsDialog > pDlg(pViewFrame, false);
pDlg->Execute();
}
diff --git a/sfx2/source/doc/QuerySaveDocument.cxx b/sfx2/source/doc/QuerySaveDocument.cxx
index d2a6cc20d976..a6f5ec97b73f 100644
--- a/sfx2/source/doc/QuerySaveDocument.cxx
+++ b/sfx2/source/doc/QuerySaveDocument.cxx
@@ -29,7 +29,7 @@ short ExecuteQuerySaveDocument(vcl::Window* _pParent, const OUString& _rTitle)
return RET_NO;
}
- ScopedVclPtr<MessageDialog> aQBox(new MessageDialog(_pParent, "QuerySaveDialog", "sfx/ui/querysavedialog.ui"));
+ ScopedVclPtrInstance< MessageDialog > aQBox(_pParent, "QuerySaveDialog", "sfx/ui/querysavedialog.ui");
aQBox->set_primary_text(aQBox->get_primary_text().replaceFirst("$(DOC)", _rTitle));
return aQBox->Execute();
}
diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx
index ea8e30165c25..bb6d2990ba65 100644
--- a/sfx2/source/doc/docinsert.cxx
+++ b/sfx2/source/doc/docinsert.cxx
@@ -190,7 +190,7 @@ IMPL_LINK_NOARG(DocumentInserter, DialogClosedHdl)
if ( ( aValue >>= bPassWord ) && bPassWord )
{
// ask for the password
- ScopedVclPtr<SfxPasswordDialog> aPasswordDlg( new SfxPasswordDialog(NULL) );
+ ScopedVclPtrInstance< SfxPasswordDialog > aPasswordDlg(nullptr);
aPasswordDlg->ShowExtras( SHOWEXTRAS_CONFIRM );
short nRet = aPasswordDlg->Execute();
if ( RET_OK == nRet )
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index fa3d548a4aa8..5ceccd9bb3d3 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -471,8 +471,7 @@ void SfxDocTplService_Impl::init_Impl()
aGuard.clear();
SolarMutexClearableGuard aSolarGuard;
- VclPtr<WaitWindow_Impl> pWin = new WaitWindow_Impl();
-
+ VclPtrInstance< WaitWindow_Impl > pWin;
aSolarGuard.clear();
::osl::ClearableMutexGuard anotherGuard( maMutex );
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index f6369f31b234..1fab2be1d48f 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1856,7 +1856,7 @@ bool SfxStoringHelper::WarnUnacceptableFormat( const uno::Reference< frame::XMod
return true;
vcl::Window* pWin = SfxStoringHelper::GetModelWindow( xModel );
- ScopedVclPtr<SfxAlienWarningDialog> aDlg(new SfxAlienWarningDialog(pWin, aOldUIName));
+ ScopedVclPtrInstance< SfxAlienWarningDialog > aDlg(pWin, aOldUIName);
return aDlg->Execute() == RET_OK;
}
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index ed0c5865be33..e94470c1bdff 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -127,7 +127,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const
std::shared_ptr<GDIMetaFile> xFile(new GDIMetaFile);
- ScopedVclPtr<VirtualDevice> pDevice( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pDevice;
pDevice->EnableOutput( false );
MapMode aMode( this->GetMapUnit() );
@@ -464,7 +464,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
{
OUString sMessage( SfxResId(STR_QRYTEMPL_MESSAGE).toString() );
sMessage = sMessage.replaceAll( "$(ARG1)", aTemplName );
- ScopedVclPtr<sfx2::QueryTemplateBox> aBox(new sfx2::QueryTemplateBox(GetDialogParent(), sMessage) );
+ ScopedVclPtrInstance< sfx2::QueryTemplateBox > aBox(GetDialogParent(), sMessage);
if ( RET_YES == aBox->Execute() )
bLoad = true;
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 146d8808c9c5..848f9bcd50e4 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -335,7 +335,7 @@ void SfxObjectShell::CheckOut( )
}
catch ( const uno::RuntimeException& e )
{
- ScopedVclPtr<MessageDialog> pErrorBox(new MessageDialog( &GetFrame()->GetWindow(), e.Message ));
+ ScopedVclPtrInstance< MessageDialog > pErrorBox( &GetFrame()->GetWindow(), e.Message );
pErrorBox->Execute( );
}
}
@@ -353,7 +353,7 @@ void SfxObjectShell::CancelCheckOut( )
}
catch ( const uno::RuntimeException& e )
{
- ScopedVclPtr<MessageDialog> pErrorBox(new MessageDialog(&GetFrame()->GetWindow(), e.Message));
+ ScopedVclPtrInstance< MessageDialog > pErrorBox(&GetFrame()->GetWindow(), e.Message);
pErrorBox->Execute( );
}
}
@@ -364,7 +364,7 @@ void SfxObjectShell::CheckIn( )
{
uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW );
// Pop up dialog to ask for comment and major
- ScopedVclPtr<SfxCheckinDialog> checkinDlg(new SfxCheckinDialog(&GetFrame( )->GetWindow( )));
+ ScopedVclPtrInstance< SfxCheckinDialog > checkinDlg(&GetFrame( )->GetWindow( ));
if ( checkinDlg->Execute( ) == RET_OK )
{
OUString sComment = checkinDlg->GetComment( );
@@ -377,7 +377,7 @@ void SfxObjectShell::CheckIn( )
}
catch ( const uno::RuntimeException& e )
{
- ScopedVclPtr<MessageDialog> pErrorBox(new MessageDialog(&GetFrame()->GetWindow(), e.Message));
+ ScopedVclPtrInstance< MessageDialog > pErrorBox(&GetFrame()->GetWindow(), e.Message);
pErrorBox->Execute( );
}
}
@@ -391,7 +391,7 @@ uno::Sequence< document::CmisVersion > SfxObjectShell::GetCmisVersions( )
}
catch ( const uno::RuntimeException& e )
{
- ScopedVclPtr<MessageDialog> pErrorBox(new MessageDialog(&GetFrame()->GetWindow(), e.Message));
+ ScopedVclPtrInstance< MessageDialog > pErrorBox(&GetFrame()->GetWindow(), e.Message);
pErrorBox->Execute( );
}
return uno::Sequence< document::CmisVersion > ( );
@@ -439,7 +439,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
if ( !IsOwnStorageFormat_Impl( *GetMedium() ) )
return;
- ScopedVclPtr<SfxVersionDialog> pDlg(new SfxVersionDialog( pFrame, IsSaveVersionOnClose() ));
+ ScopedVclPtrInstance< SfxVersionDialog > pDlg( pFrame, IsSaveVersionOnClose() );
pDlg->Execute();
SetSaveVersionOnClose( pDlg->IsSaveVersionOnClose() );
rReq.Done();
@@ -857,7 +857,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
case SID_DOCTEMPLATE:
{
// save as document templates
- ScopedVclPtr<SfxTemplateManagerDlg> aDlg(new SfxTemplateManagerDlg);
+ ScopedVclPtrInstance< SfxTemplateManagerDlg > aDlg;
aDlg->setDocumentModel(GetModel());
aDlg->setSaveMode();
aDlg->Execute();
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index c5a26a58531c..5ed19bd4455d 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3019,7 +3019,7 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, vcl::
{
sMessage += "\n";
sMessage += SfxResId(nResId).toString();
- ScopedVclPtr<WarningBox> aWBox(new WarningBox(pParent, WB_YES_NO | WB_DEF_NO, sMessage));
+ ScopedVclPtrInstance< WarningBox > aWBox(pParent, WB_YES_NO | WB_DEF_NO, sMessage);
nRet = aWBox->Execute();
}
}
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index b943bb13bec9..60270b45563c 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -624,7 +624,7 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu)
}
else if (nMenuId == MNI_REPOSITORY_NEW)
{
- ScopedVclPtr<PlaceEditDialog> dlg(new PlaceEditDialog(this));
+ ScopedVclPtrInstance< PlaceEditDialog > dlg(this);
if (dlg->Execute())
{
@@ -1168,14 +1168,14 @@ void SfxTemplateManagerDlg::OnTemplateProperties ()
{
const TemplateViewItem *pItem = static_cast<const TemplateViewItem*>(*maSelTemplates.begin());
- ScopedVclPtr<SfxTemplateInfoDlg> aDlg(new SfxTemplateInfoDlg);
+ ScopedVclPtrInstance< SfxTemplateInfoDlg > aDlg;
aDlg->loadDocument(pItem->getPath());
aDlg->Execute();
}
void SfxTemplateManagerDlg::OnTemplateDelete ()
{
- ScopedVclPtr<MessageDialog> aQueryDlg(new MessageDialog(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQueryDlg(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if ( aQueryDlg->Execute() != RET_YES )
return;
@@ -1246,7 +1246,7 @@ void SfxTemplateManagerDlg::OnTemplateAsDefault ()
void SfxTemplateManagerDlg::OnFolderNew()
{
- ScopedVclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));
+ ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this);
int ret = dlg->Execute();
@@ -1260,7 +1260,7 @@ void SfxTemplateManagerDlg::OnFolderNew()
void SfxTemplateManagerDlg::OnFolderDelete()
{
- ScopedVclPtr<MessageDialog> aQueryDlg(new MessageDialog(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQueryDlg(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if ( aQueryDlg->Execute() != RET_YES )
return;
@@ -1313,7 +1313,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
return;
}
- ScopedVclPtr<InputDialog> aDlg(new InputDialog(SfxResId(STR_INPUT_TEMPLATE_NEW).toString(),this));
+ ScopedVclPtrInstance< InputDialog > aDlg(SfxResId(STR_INPUT_TEMPLATE_NEW).toString(),this);
if (aDlg->Execute())
{
@@ -1323,7 +1323,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
{
OUString aFolderList;
OUString aQMsg(SfxResId(STR_QMSG_TEMPLATE_OVERWRITE).toString());
- ScopedVclPtr<MessageDialog> aQueryDlg(new MessageDialog(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQueryDlg(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if (mpLocalView->isNonRootRegionVisible())
{
@@ -1451,7 +1451,7 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 nMenuId)
if (nMenuId == MNI_MOVE_NEW)
{
- ScopedVclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));
+ ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this);
int ret = dlg->Execute();
@@ -1499,7 +1499,7 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 nMenuId)
if (nMenuId == MNI_MOVE_NEW)
{
- ScopedVclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));
+ ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this);
int ret = dlg->Execute();
@@ -1553,7 +1553,7 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId)
if (nMenuId == MNI_MOVE_NEW)
{
- ScopedVclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));
+ ScopedVclPtrInstance< InputDialog > dlg(SfxResId(STR_INPUT_NEW).toString(),this);
int ret = dlg->Execute();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index cee8e5517781..ebe6e3d8f995 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -595,7 +595,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
if ( eResult == SfxMailModel::SEND_MAIL_ERROR )
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aBox(SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO);
aBox->Execute();
rReq.Ignore();
}
@@ -615,7 +615,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
SfxMailModel::SendMailResult eResult = aModel.SaveAndSend( xFrame, OUString() );
if( eResult == SfxMailModel::SEND_MAIL_ERROR )
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aBox(SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO);
aBox->Execute();
rReq.Ignore();
}
@@ -1311,7 +1311,7 @@ bool SfxViewShell::PrepareClose
{
if ( bUI )
{
- ScopedVclPtr<MessageDialog> aInfoBox(new MessageDialog(&GetViewFrame()->GetWindow(), SfxResId( STR_CANT_CLOSE ), VCL_MESSAGE_INFO ));
+ ScopedVclPtrInstance< MessageDialog > aInfoBox(&GetViewFrame()->GetWindow(), SfxResId( STR_CANT_CLOSE ), VCL_MESSAGE_INFO );
aInfoBox->Execute();
}
diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx
index ad3535f0386a..46fa58df63be 100644
--- a/slideshow/source/engine/rehearsetimingsactivity.cxx
+++ b/slideshow/source/engine/rehearsetimingsactivity.cxx
@@ -159,7 +159,7 @@ RehearseTimingsActivity::RehearseTimingsActivity( const SlideShowContext& rConte
maFont.SetColor( COL_BLACK );
// determine sprite size (in pixel):
- ScopedVclPtr<VirtualDevice> blackHole( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > blackHole;
blackHole->EnableOutput(false);
blackHole->SetFont( maFont );
blackHole->SetMapMode( MAP_PIXEL );
@@ -444,7 +444,7 @@ void RehearseTimingsActivity::paint( cppcanvas::CanvasSharedPtr const & canvas )
// create the MetaFile:
GDIMetaFile metaFile;
- ScopedVclPtr<VirtualDevice> blackHole( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > blackHole;
metaFile.Record( blackHole );
metaFile.SetPrefSize( Size( 1, 1 ) );
blackHole->EnableOutput(false);
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx
index b4a7833378c5..c38a45777a47 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -286,12 +286,12 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
// normalize animations to n bitmaps of same size. An Animation,
// though, can contain bitmaps of varying sizes and different
// update modes)
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
pVDev->SetOutputSizePixel( aAnimSize );
pVDev->EnableMapMode( false );
// setup mask VDev (alpha VDev is currently rather slow)
- ScopedVclPtr<VirtualDevice> pVDevMask( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDevMask;
pVDevMask->SetOutputSizePixel( aAnimSize );
pVDevMask->EnableMapMode( false );
diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index 424e10c25e05..29d554a7e477 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -519,7 +519,7 @@ void Test::testBinomInBinHor()
pTree->Prepare(xDocShRef->GetFormat(), *xDocShRef);
SmCursor aCursor(pTree, xDocShRef);
- ScopedVclPtr<VirtualDevice> pOutputDevice( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pOutputDevice;
// move forward (more than) enough places to be at the end
int i;
@@ -547,7 +547,7 @@ void Test::testBinVerInUnary()
pTree->Prepare(xDocShRef->GetFormat(), *xDocShRef);
SmCursor aCursor(pTree, xDocShRef);
- ScopedVclPtr<VirtualDevice> pOutputDevice( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pOutputDevice;
// move forward (more than) enough places to be at the end
int i;
@@ -576,7 +576,7 @@ void Test::testBinHorInSubSup()
pTree->Prepare(xDocShRef->GetFormat(), *xDocShRef);
SmCursor aCursor(pTree, xDocShRef);
- ScopedVclPtr<VirtualDevice> pOutputDevice( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pOutputDevice;
// Insert an RSup expression with a BinHor for the exponent
aCursor.InsertText("a");
@@ -604,7 +604,7 @@ void Test::testUnaryInMixedNumberAsNumerator()
pTree->Prepare(xDocShRef->GetFormat(), *xDocShRef);
SmCursor aCursor(pTree, xDocShRef);
- ScopedVclPtr<VirtualDevice> pOutputDevice( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pOutputDevice;
// move forward (more than) enough places to be at the end
for (size_t i = 0; i < 3; ++i)
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index a78f678d24de..14276a84333f 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -989,7 +989,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
pDev = &SM_MOD()->GetDefaultVirtualDev();
OSL_ENSURE (pDev, "device for font list missing" );
- VclPtr<SmFontTypeDialog> xFontTypeDialog(new SmFontTypeDialog( NULL, pDev ));
+ VclPtrInstance< SmFontTypeDialog > xFontTypeDialog( nullptr, pDev );
SmFormat aOldFormat = GetFormat();
xFontTypeDialog->ReadFrom( aOldFormat );
@@ -1011,7 +1011,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
case SID_FONTSIZE:
{
- VclPtr<SmFontSizeDialog> xFontSizeDialog(new SmFontSizeDialog(NULL));
+ VclPtrInstance< SmFontSizeDialog > xFontSizeDialog(nullptr);
SmFormat aOldFormat = GetFormat();
xFontSizeDialog->ReadFrom( aOldFormat );
@@ -1034,7 +1034,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
case SID_DISTANCE:
{
- VclPtr<SmDistanceDialog> xDistanceDialog(new SmDistanceDialog(NULL));
+ VclPtrInstance< SmDistanceDialog > xDistanceDialog(nullptr);
SmFormat aOldFormat = GetFormat();
xDistanceDialog->ReadFrom( aOldFormat );
@@ -1057,7 +1057,7 @@ void SmDocShell::Execute(SfxRequest& rReq)
case SID_ALIGN:
{
- VclPtr<SmAlignDialog> xAlignDialog(new SmAlignDialog(NULL));
+ VclPtrInstance< SmAlignDialog > xAlignDialog(nullptr);
SmFormat aOldFormat = GetFormat();
xAlignDialog->ReadFrom( aOldFormat );
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index dbf1d122fbff..3e781c181842 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -879,7 +879,7 @@ void ViewTabListBox_Impl::DeleteEntries()
if ( eResult != svtools::QUERYDELETE_ALL )
{
INetURLObject aObj( aURL );
- ScopedVclPtr<svtools::QueryDeleteDlg_Impl> aDlg(new svtools::QueryDeleteDlg_Impl(NULL, aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ) ));
+ ScopedVclPtrInstance< svtools::QueryDeleteDlg_Impl > aDlg(nullptr, aObj.GetName( INetURLObject::DECODE_WITH_CHARSET ) );
if ( sDialogPosition.getLength() )
aDlg->SetWindowState( sDialogPosition );
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index b923ab34bd57..3c2efb6b696a 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -1894,7 +1894,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const Rectangle& rArea, c
// First combine very small bitmaps into a larger tile
- ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > aVDev;
const int nNumTilesInCacheX( (nTileCacheSize1D + rSizePixel.Width()-1) / rSizePixel.Width() );
const int nNumTilesInCacheY( (nTileCacheSize1D + rSizePixel.Height()-1) / rSizePixel.Height() );
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index e144f6bdea4b..9e7283ca42b4 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -634,7 +634,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal
}
else if ( ( rGraphic.GetType() == GRAPHIC_GDIMETAFILE ) && nImageResolution )
{
- ScopedVclPtr<VirtualDevice> aDummyVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > aDummyVDev;
GDIMetaFile aMtf( rGraphic.GetGDIMetaFile() );
Size aMtfSize( OutputDevice::LogicToLogic( aMtf.GetPrefSize(), aMtf.GetPrefMapMode(), MAP_100TH_MM ) );
if ( aMtfSize.Width() && aMtfSize.Height() )
diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx
index c2d4ad299e7d..e380fb1972cf 100644
--- a/svtools/source/java/javainteractionhandler.cxx
+++ b/svtools/source/java/javainteractionhandler.cxx
@@ -122,7 +122,7 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
// No suitable JRE found
SolarMutexGuard aSolarGuard;
m_bJavaNotFound_Handled = true;
- ScopedVclPtr<MessageDialog> aWarningBox(new MessageDialog(NULL, SvtResId(STR_WARNING_JAVANOTFOUND), VCL_MESSAGE_WARNING));
+ ScopedVclPtrInstance< MessageDialog > aWarningBox(nullptr, SvtResId(STR_WARNING_JAVANOTFOUND), VCL_MESSAGE_WARNING);
aWarningBox->SetText(SvtResId(STR_WARNING_JAVANOTFOUND_TITLE));
nResult = aWarningBox->Execute();
}
@@ -139,9 +139,9 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
SolarMutexGuard aSolarGuard;
m_bInvalidSettings_Handled = true;
#ifdef MACOSX
- ScopedVclPtr<MessageDialog> aWarningBox(new MessageDialog(NULL, SvtResId(STR_WARNING_INVALIDJAVASETTINGS_MAC), VCL_MESSAGE_WARNING));
+ ScopedVclPtrInstance< MessageDialog > aWarningBox(nullptr, SvtResId(STR_WARNING_INVALIDJAVASETTINGS_MAC), VCL_MESSAGE_WARNING);
#else
- ScopedVclPtr<MessageDialog> aWarningBox(new MessageDialog(NULL, SvtResId(STR_WARNING_INVALIDJAVASETTINGS), VCL_MESSAGE_WARNING));
+ ScopedVclPtrInstance< MessageDialog > aWarningBox(nullptr, SvtResId(STR_WARNING_INVALIDJAVASETTINGS), VCL_MESSAGE_WARNING);
#endif
aWarningBox->SetText(SvtResId(STR_WARNING_INVALIDJAVASETTINGS_TITLE));
nResult = aWarningBox->Execute();
@@ -182,9 +182,9 @@ void SAL_CALL JavaInteractionHandler::handle( const Reference< XInteractionReque
SolarMutexGuard aSolarGuard;
m_bVMCreationFailure_Handled = true;
#ifdef MACOSX
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, SvtResId(STR_ERROR_JVMCREATIONFAILED_MAC)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, SvtResId(STR_ERROR_JVMCREATIONFAILED_MAC));
#else
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, SvtResId(STR_ERROR_JVMCREATIONFAILED)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, SvtResId(STR_ERROR_JVMCREATIONFAILED));
#endif
aErrorBox->SetText(SvtResId(STR_ERROR_JVMCREATIONFAILED_TITLE));
nResult = aErrorBox->Execute();
diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx
index 889103dc9efe..63d8c9a9346f 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -1623,7 +1623,7 @@ OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const vcl::Font &r
{
OUString sRet(makeRepresentativeTextForLanguage(rFont.GetLanguage()));
- ScopedVclPtr<VirtualDevice> aDevice( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > aDevice;
if (sRet.isEmpty() || (-1 != aDevice->HasGlyphs(rFont, sRet)))
{
aDevice->SetFont(rFont);
diff --git a/svtools/source/table/gridtablerenderer.cxx b/svtools/source/table/gridtablerenderer.cxx
index b36ac6d9cf8a..d4b98433de3b 100644
--- a/svtools/source/table/gridtablerenderer.cxx
+++ b/svtools/source/table/gridtablerenderer.cxx
@@ -86,7 +86,7 @@ namespace svt { namespace table
Point const aBitmapPos( 0, 0 );
Size const aBitmapSize( nSortIndicatorWidth, nSortIndicatorHeight );
- ScopedVclPtr<VirtualDevice> aDevice( new VirtualDevice( i_device, 0, 0 ) );
+ ScopedVclPtrInstance< VirtualDevice > aDevice( i_device, 0, 0 );
aDevice->SetOutputSizePixel( aBitmapSize );
DecorationView aDecoView( aDevice.get() );
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 1b69bc730d35..7e033863237f 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -165,7 +165,7 @@ void CalculateHorizontalScalingFactor( const SdrObject* pCustomShape,
aFont.SetOrientation( 0 );
// initializing virtual device
- ScopedVclPtr<VirtualDevice> pVirDev( new VirtualDevice( 1 ) );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev( 1 );
pVirDev->SetMapMode( MAP_100TH_MM );
pVirDev->SetFont( aFont );
@@ -259,7 +259,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
aFont.SetWeight( rWeightItem.GetWeight() );
// initializing virtual device
- ScopedVclPtr<VirtualDevice> pVirDev( new VirtualDevice( 1 ) );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev( 1 );
pVirDev->SetMapMode( MAP_100TH_MM );
pVirDev->SetFont( aFont );
pVirDev->EnableRTL( true );
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index bb95f7eea8a5..fce58061722b 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -1006,7 +1006,7 @@ Animation SvxBmpMask::ImpReplaceTransparency( const Animation& rAnim, const Colo
GDIMetaFile SvxBmpMask::ImpReplaceTransparency( const GDIMetaFile& rMtf, const Color& rColor )
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
GDIMetaFile aMtf;
const MapMode& rPrefMap = rMtf.GetPrefMapMode();
const Size& rPrefSize = rMtf.GetPrefSize();
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index ba659b0c2bed..ce3e70bb1aae 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -113,7 +113,7 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
{
if( rGraphic.IsAnimated() )
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
MapMode aTransMap;
const Animation aAnim( rGraphic.GetAnimation() );
const Size& rSizePix = aAnim.GetDisplaySizePixel();
@@ -152,7 +152,7 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
else if( rGraphic.GetType() != GRAPHIC_NONE )
{
const Graphic aTmpGrf( rGraphic.GetGDIMetaFile().GetMonochromeMtf( Color( COL_BLACK ) ) );
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
Size aSizePix( pVDev->LogicToPixel( aTmpGrf.GetPrefSize(), aTmpGrf.GetPrefMapMode() ) );
if( aSizePix.Width() && aSizePix.Height() && ( aSizePix.Width() > 512 || aSizePix.Height() > 512 ) )
@@ -314,7 +314,7 @@ bool SvxSuperContourDlg::Close()
if (m_pTbx1->IsItemEnabled(mnApplyId))
{
- ScopedVclPtr<MessageDialog> aQBox(new MessageDialog( this,"QuerySaveContourChangesDialog","svx/ui/querysavecontchangesdialog.ui") );
+ ScopedVclPtrInstance< MessageDialog > aQBox( this,"QuerySaveContourChangesDialog","svx/ui/querysavecontchangesdialog.ui");
const long nRet = aQBox->Execute();
if ( nRet == RET_YES )
@@ -446,7 +446,7 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx )
{
if (m_pTbx1->IsItemChecked(mnWorkSpaceId))
{
- ScopedVclPtr<MessageDialog> aQBox(new MessageDialog( this,"QueryDeleteContourDialog","svx/ui/querydeletecontourdialog.ui" ));
+ ScopedVclPtrInstance< MessageDialog > aQBox( this,"QueryDeleteContourDialog","svx/ui/querydeletecontourdialog.ui" );
if ( !m_pContourWnd->IsContourChanged() || ( aQBox->Execute() == RET_YES ) )
m_pContourWnd->SetWorkplaceMode( true );
@@ -713,7 +713,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow*, pWnd )
if( !!aMask )
{
- ScopedVclPtr<MessageDialog> aQBox(new MessageDialog( this,"QueryNewContourDialog","svx/ui/querynewcontourdialog.ui" ));
+ ScopedVclPtrInstance< MessageDialog > aQBox( this,"QueryNewContourDialog","svx/ui/querynewcontourdialog.ui" );
bool bNewContour;
aRedoGraphic = Graphic();
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index 95584d7ac674..88baa47cb942 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1439,7 +1439,7 @@ namespace
{
if(!rBitmapEx.IsEmpty() && rSize.Width() > 0 && rSize.Height() > 0)
{
- ScopedVclPtr<VirtualDevice> pVirtualDevice( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVirtualDevice;
pVirtualDevice->SetOutputSizePixel(rSize);
if(rBitmapEx.IsTransparent())
@@ -1710,7 +1710,7 @@ void LineEndLB::Fill( const XLineEndListRef &pList, bool bStart )
return;
long nCount = pList->Count();
- ScopedVclPtrInstance<VirtualDevice> pVD;
+ ScopedVclPtrInstance< VirtualDevice > pVD;
SetUpdateMode( false );
for( long i = 0; i < nCount; i++ )
@@ -1740,7 +1740,7 @@ void LineEndLB::Append( const XLineEndEntry& rEntry, const Bitmap& rBitmap, bool
{
if(!rBitmap.IsEmpty())
{
- ScopedVclPtr<VirtualDevice> pVD( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVD;
const Size aBmpSize(rBitmap.GetSizePixel());
pVD->SetOutputSizePixel(aBmpSize, false);
@@ -1765,7 +1765,7 @@ void LineEndLB::Modify( const XLineEndEntry& rEntry, sal_Int32 nPos, const Bitma
if(!rBitmap.IsEmpty())
{
- ScopedVclPtr<VirtualDevice> pVD( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVD;
const Size aBmpSize(rBitmap.GetSizePixel());
pVD->SetOutputSizePixel(aBmpSize, false);
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 43eafbeb7698..ed4522f306a7 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -682,7 +682,7 @@ void SaveDialog::dispose()
IMPL_LINK_NOARG(SaveDialog, OKButtonHdl)
{
// start crash-save with progress
- ScopedVclPtr<SaveProgressDialog> pProgress(new SaveProgressDialog(this, m_pCore));
+ ScopedVclPtrInstance< SaveProgressDialog > pProgress(this, m_pCore);
short nResult = pProgress->Execute();
pProgress.reset();
@@ -855,7 +855,7 @@ void RecovDocList::InitEntry(SvTreeListEntry* pEntry,
short impl_askUserForWizardCancel(vcl::Window* pParent, sal_Int16 nRes)
{
- ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(pParent, SVX_RES(nRes), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQuery(pParent, SVX_RES(nRes), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if (aQuery->Execute() == RET_YES)
return DLG_RET_OK;
else
@@ -988,7 +988,7 @@ short RecoveryDialog::execute()
// failed recovery documents. They must be saved to
// a user selected directrory.
short nRet = DLG_RET_UNKNOWN;
- ScopedVclPtr<BrokenRecoveryDialog> pBrokenRecoveryDialog(new BrokenRecoveryDialog(this, m_pCore, !m_bWasRecoveryStarted));
+ ScopedVclPtrInstance< BrokenRecoveryDialog > pBrokenRecoveryDialog(this, m_pCore, !m_bWasRecoveryStarted);
OUString sSaveDir = pBrokenRecoveryDialog->getSaveDirURL(); // get the default dir
if (pBrokenRecoveryDialog->isExecutionNeeded())
{
@@ -1057,7 +1057,7 @@ short RecoveryDialog::execute()
// If no temp files exists or user decided to ignore it ...
// we have to remove all recovery/session data anyway!
short nRet = DLG_RET_UNKNOWN;
- ScopedVclPtr<BrokenRecoveryDialog> pBrokenRecoveryDialog(new BrokenRecoveryDialog(this, m_pCore, !m_bWasRecoveryStarted));
+ ScopedVclPtrInstance< BrokenRecoveryDialog > pBrokenRecoveryDialog(this, m_pCore, !m_bWasRecoveryStarted);
OUString sSaveDir = pBrokenRecoveryDialog->getSaveDirURL(); // get the default save location
// dialog itself checks if there is a need to copy files for this mode.
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index 7378ea95d466..d99bb6818c8d 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -242,7 +242,7 @@ bool SvxIMapDlg::Close()
if ( m_pTbxIMapDlg1->IsItemEnabled( mnApplyId ) )
{
- ScopedVclPtr<MessageDialog> aQBox(new MessageDialog(this,"QueryModifyImageMapChangesDialog","svx/ui/querymodifyimagemapchangesdialog.ui"));
+ ScopedVclPtrInstance< MessageDialog > aQBox(this,"QueryModifyImageMapChangesDialog","svx/ui/querymodifyimagemapchangesdialog.ui");
const long nRet = aQBox->Execute();
if( nRet == RET_YES )
@@ -256,7 +256,7 @@ bool SvxIMapDlg::Close()
}
else if( pIMapWnd->IsChanged() )
{
- ScopedVclPtr<MessageDialog> aQBox(new MessageDialog(this,"QuerySaveImageMapChangesDialog","svx/ui/querysaveimagemapchangesdialog.ui"));
+ ScopedVclPtrInstance< MessageDialog > aQBox(this,"QuerySaveImageMapChangesDialog","svx/ui/querysaveimagemapchangesdialog.ui");
const long nRet = aQBox->Execute();
if( nRet == RET_YES )
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 6930ee9327ce..94ccd8cfc576 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -3457,7 +3457,7 @@ void SvxRuler::Command( const CommandEvent& rCommandEvent )
{
PopupMenu aMenu;
aMenu.SetSelectHdl(LINK(this, SvxRuler, TabMenuSelect));
- ScopedVclPtrInstance<VirtualDevice()
+ ScopedVclPtrInstance< VirtualDevice > pDev;
const Size aSz(ruler_tab_svx.width + 2, ruler_tab_svx.height + 2);
pDev->SetOutputSize(aSz);
pDev->SetBackground(Wallpaper(Color(COL_WHITE)));
diff --git a/svx/source/form/databaselocationinput.cxx b/svx/source/form/databaselocationinput.cxx
index a5df5977bbe9..b7069a27b317 100644
--- a/svx/source/form/databaselocationinput.cxx
+++ b/svx/source/form/databaselocationinput.cxx
@@ -128,7 +128,7 @@ namespace svx
{
if ( ::utl::UCBContentHelper::Exists( sURL ) )
{
- ScopedVclPtr<QueryBox> aBox(new QueryBox( m_rLocationInput.GetSystemWindow(), WB_YES_NO, SVX_RESSTR(RID_STR_ALREADYEXISTOVERWRITE) ) );
+ ScopedVclPtrInstance< QueryBox > aBox( m_rLocationInput.GetSystemWindow(), WB_YES_NO, SVX_RESSTR(RID_STR_ALREADYEXISTOVERWRITE) );
if ( aBox->Execute() != RET_YES )
return false;
}
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index ea4f4c6ad6b1..7a7229f9b499 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -483,7 +483,7 @@ namespace svxform
DBG_ASSERT( xModel.is(), "XFormsPage::DoToolBoxAction(): Action without model" );
if ( DGTSubmission == m_eGroup )
{
- ScopedVclPtr<AddSubmissionDialog> aDlg(new AddSubmissionDialog( this, NULL, m_xUIHelper ));
+ ScopedVclPtrInstance< AddSubmissionDialog > aDlg( this, nullptr, m_xUIHelper );
if ( aDlg->Execute() == RET_OK && aDlg->GetNewSubmission().is() )
{
try
@@ -515,7 +515,7 @@ namespace svxform
{
if ( !m_sInstanceURL.isEmpty() )
{
- ScopedVclPtr<LinkedInstanceWarningBox> aMsgBox(new LinkedInstanceWarningBox( this ));
+ ScopedVclPtrInstance< LinkedInstanceWarningBox > aMsgBox( this );
if ( aMsgBox->Execute() != RET_OK )
return bHandled;
}
@@ -610,7 +610,7 @@ namespace svxform
}
}
- ScopedVclPtr<AddDataItemDialog> aDlg(new AddDataItemDialog( this, pNode, m_xUIHelper ));
+ ScopedVclPtrInstance< AddDataItemDialog > aDlg( this, pNode, m_xUIHelper );
aDlg->SetText( SVX_RESSTR( nResId ) );
aDlg->InitText( eType );
short nReturn = aDlg->Execute();
@@ -678,12 +678,12 @@ namespace svxform
{
if ( DGTInstance == m_eGroup && !m_sInstanceURL.isEmpty() )
{
- ScopedVclPtr<LinkedInstanceWarningBox> aMsgBox(new LinkedInstanceWarningBox( this ));
+ ScopedVclPtrInstance< LinkedInstanceWarningBox > aMsgBox( this );
if ( aMsgBox->Execute() != RET_OK )
return bHandled;
}
- ScopedVclPtr<AddDataItemDialog> aDlg(new AddDataItemDialog( this, pNode, m_xUIHelper ));
+ ScopedVclPtrInstance< AddDataItemDialog > aDlg( this, pNode, m_xUIHelper );
DataItemType eType = DITElement;
sal_uInt16 nResId = RID_STR_DATANAV_EDIT_ELEMENT;
if ( pNode && pNode->m_xNode.is() )
@@ -749,7 +749,7 @@ namespace svxform
}
else
{
- ScopedVclPtr<AddSubmissionDialog> aDlg(new AddSubmissionDialog( this, pNode, m_xUIHelper ));
+ ScopedVclPtrInstance< AddSubmissionDialog > aDlg( this, pNode, m_xUIHelper );
aDlg->SetText( SVX_RESSTR( RID_STR_DATANAV_EDIT_SUBMISSION ) );
if ( aDlg->Execute() == RET_OK )
{
@@ -764,7 +764,7 @@ namespace svxform
bHandled = true;
if ( DGTInstance == m_eGroup && !m_sInstanceURL.isEmpty() )
{
- ScopedVclPtr<LinkedInstanceWarningBox> aMsgBox(new LinkedInstanceWarningBox( this ));
+ ScopedVclPtrInstance< LinkedInstanceWarningBox > aMsgBox( this );
if ( aMsgBox->Execute() != RET_OK )
return bHandled;
}
@@ -956,7 +956,7 @@ namespace svxform
bool bIsElement = ( eChildType == css::xml::dom::NodeType_ELEMENT_NODE );
sal_uInt16 nResId = bIsElement ? RID_STR_QRY_REMOVE_ELEMENT : RID_STR_QRY_REMOVE_ATTRIBUTE;
OUString sVar = bIsElement ? OUString(ELEMENTNAME) : OUString(ATTRIBUTENAME);
- ScopedVclPtr<MessageDialog> aQBox(new MessageDialog(this, SVX_RES(nResId), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQBox(this, SVX_RES(nResId), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
OUString sMessText = aQBox->get_primary_text();
sMessText = sMessText.replaceFirst(
sVar, m_xUIHelper->getNodeDisplayName( pNode->m_xNode, sal_False ) );
@@ -1496,7 +1496,7 @@ namespace svxform
OString sIdent(pBtn->GetCurItemIdent());
if (sIdent == "modelsadd")
{
- ScopedVclPtr<AddModelDialog> aDlg(new AddModelDialog( this, false ));
+ ScopedVclPtrInstance< AddModelDialog > aDlg( this, false );
bool bShowDialog = true;
while ( bShowDialog )
{
@@ -1509,7 +1509,7 @@ namespace svxform
if ( m_pModelsBox->GetEntryPos( sNewName ) != LISTBOX_ENTRY_NOTFOUND )
{
// error: model name already exists
- ScopedVclPtr<MessageDialog> aErrBox(new MessageDialog( this, SVX_RES( RID_STR_DOUBLE_MODELNAME ) ));
+ ScopedVclPtrInstance< MessageDialog > aErrBox( this, SVX_RES( RID_STR_DOUBLE_MODELNAME ) );
aErrBox->set_primary_text(aErrBox->get_primary_text().replaceFirst(MSG_VARIABLE, sNewName));
aErrBox->Execute();
bShowDialog = true;
@@ -1542,7 +1542,7 @@ namespace svxform
}
else if (sIdent == "modelsedit")
{
- ScopedVclPtr<AddModelDialog> aDlg(new AddModelDialog( this, true ));
+ ScopedVclPtrInstance< AddModelDialog > aDlg( this, true );
aDlg->SetName( sSelectedModel );
bool bDocumentData( false );
@@ -1637,7 +1637,7 @@ namespace svxform
OString sIdent(pBtn->GetCurItemIdent());
if (sIdent == "instancesadd")
{
- ScopedVclPtr<AddInstanceDialog> aDlg(new AddInstanceDialog( this, false ));
+ ScopedVclPtrInstance< AddInstanceDialog > aDlg( this, false );
if ( aDlg->Execute() == RET_OK )
{
sal_uInt16 nInst = GetNewPageId();
@@ -1669,7 +1669,7 @@ namespace svxform
XFormsPage* pPage = GetCurrentPage( nId );
if ( pPage )
{
- ScopedVclPtr<AddInstanceDialog> aDlg(new AddInstanceDialog( this, true ));
+ ScopedVclPtrInstance< AddInstanceDialog > aDlg( this, true );
aDlg->SetName( pPage->GetInstanceName() );
aDlg->SetURL( pPage->GetInstanceURL() );
aDlg->SetLinkInstance( pPage->GetLinkOnce() );
@@ -2405,7 +2405,7 @@ namespace svxform
sPropName = PN_READONLY_EXPR;
else if (m_pCalculateBtn == pBtn)
sPropName = PN_CALCULATE_EXPR;
- ScopedVclPtr<AddConditionDialog> aDlg(new AddConditionDialog(this, sPropName, m_xTempBinding));
+ ScopedVclPtrInstance< AddConditionDialog > aDlg(this, sPropName, m_xTempBinding);
bool bIsDefBtn = ( m_pDefaultBtn == pBtn );
OUString sCondition;
if ( bIsDefBtn )
@@ -2479,7 +2479,7 @@ namespace svxform
( bIsHandleBinding && sNewName.isEmpty() ) )
{
// Error and don't close the dialog
- ScopedVclPtr<MessageDialog> aErrBox(new MessageDialog( this, SVX_RES( RID_STR_INVALID_XMLNAME ) ) );
+ ScopedVclPtrInstance< MessageDialog > aErrBox( this, SVX_RES( RID_STR_INVALID_XMLNAME ) );
aErrBox->set_primary_text(aErrBox->get_primary_text().replaceFirst(MSG_VARIABLE, sNewName));
aErrBox->Execute();
return 0;
@@ -2845,7 +2845,7 @@ namespace svxform
{
SAL_WARN( "svx.form", "AddDataItemDialog::EditHdl(): exception caught" );
}
- ScopedVclPtr<NamespaceItemDialog> aDlg(new NamespaceItemDialog( this, xNameContnr ) );
+ ScopedVclPtrInstance< NamespaceItemDialog > aDlg( this, xNameContnr );
aDlg->Execute();
try
{
@@ -2975,7 +2975,7 @@ namespace svxform
{
if ( m_pAddNamespaceBtn == pBtn )
{
- ScopedVclPtr<ManageNamespaceDialog> aDlg( new ManageNamespaceDialog(this, m_pConditionDlg, false) );
+ ScopedVclPtrInstance< ManageNamespaceDialog > aDlg(this, m_pConditionDlg, false);
if ( aDlg->Execute() == RET_OK )
{
OUString sEntry = aDlg->GetPrefix();
@@ -2986,7 +2986,7 @@ namespace svxform
}
else if ( m_pEditNamespaceBtn == pBtn )
{
- ScopedVclPtr<ManageNamespaceDialog> aDlg(new ManageNamespaceDialog( this, m_pConditionDlg, true ));
+ ScopedVclPtrInstance< ManageNamespaceDialog > aDlg( this, m_pConditionDlg, true );
SvTreeListEntry* pEntry = m_pNamespacesList->FirstSelected();
DBG_ASSERT( pEntry, "NamespaceItemDialog::ClickHdl(): no entry" );
OUString sPrefix( SvTabListBox::GetEntryText( pEntry, 0 ) );
@@ -3120,7 +3120,7 @@ namespace svxform
{
if ( !m_pConditionDlg->GetUIHelper()->isValidPrefixName( sPrefix ) )
{
- ScopedVclPtr<MessageDialog> aErrBox(new MessageDialog(this, SVX_RES( RID_STR_INVALID_XMLPREFIX ) ) );
+ ScopedVclPtrInstance< MessageDialog > aErrBox(this, SVX_RES( RID_STR_INVALID_XMLPREFIX ) );
aErrBox->set_primary_text(aErrBox->get_primary_text().replaceFirst(MSG_VARIABLE, sPrefix));
aErrBox->Execute();
return 0;
@@ -3183,7 +3183,7 @@ namespace svxform
IMPL_LINK_NOARG(AddSubmissionDialog, RefHdl)
{
- ScopedVclPtr<AddConditionDialog> aDlg(new AddConditionDialog(this, PN_BINDING_EXPR, m_xTempBinding ));
+ ScopedVclPtrInstance< AddConditionDialog > aDlg(this, PN_BINDING_EXPR, m_xTempBinding );
aDlg->SetCondition( m_pRefED->GetText() );
if ( aDlg->Execute() == RET_OK )
m_pRefED->SetText( aDlg->GetCondition() );
@@ -3197,7 +3197,7 @@ namespace svxform
OUString sName(m_pNameED->GetText());
if(sName.isEmpty()) {
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(this,SVX_RES(RID_STR_EMPTY_SUBMISSIONNAME)));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(this,SVX_RES(RID_STR_EMPTY_SUBMISSIONNAME));
aErrorBox->set_primary_text( Application::GetDisplayName() );
aErrorBox->Execute();
return 0;
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index 73e9b377d557..3565465e47c1 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -484,7 +484,7 @@ bool SgaObjectSvDraw::CreateThumb( const FmFormModel& rModel )
if(aObjRect.GetWidth() && aObjRect.GetHeight())
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
FmFormView aView(const_cast< FmFormModel* >(&rModel), pVDev);
aView.ShowSdrPage(const_cast< FmFormPage* >(pPage));
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 902438338f9b..69f3771eda3b 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -808,7 +808,7 @@ bool GalleryTheme::GetGraphic( sal_uIntPtr nPos, Graphic& rGraphic, bool bProgre
bRet = true;
else
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
pVDev->SetMapMode( MapMode( MAP_100TH_MM ) );
FmFormView aView( aModel.GetModel(), pVDev );
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 7577db59558c..f9bdc1fd6474 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -1558,7 +1558,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction& rAct)
else
{
// gradient transparence
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
pVDev->SetOutputSizePixel(aBitmapEx.GetBitmap().GetSizePixel());
pVDev->DrawGradient(Rectangle(Point(0, 0), pVDev->GetOutputSizePixel()), rGradient);
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 4244aa2747c1..a0c519d97555 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -1026,7 +1026,7 @@ GDIMetaFile SdrGrafObj::getMetafileFromEmbeddedSvg() const
if(isEmbeddedSvg() && GetModel())
{
- ScopedVclPtr<VirtualDevice> pOut( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pOut;
const Rectangle aBoundRect(GetCurrentBoundRect());
const MapMode aMap(GetModel()->GetScaleUnit(), Point(), GetModel()->GetScaleFraction(), GetModel()->GetScaleFraction());
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 61a9fb2a7792..4f5dc1510a67 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1877,7 +1877,7 @@ GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle(
// create the MetaFile
pRetval = new GDIMetaFile;
- ScopedVclPtr<VirtualDevice> pBlackHole(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pBlackHole;
pBlackHole->EnableOutput(false);
pRetval->Record(pBlackHole);
Point aPaintPos = aPaintRect.TopLeft();
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx
index d9ffbdac1849..488d6c66d601 100644
--- a/svx/source/svdraw/svdtrans.cxx
+++ b/svx/source/svdraw/svdtrans.cxx
@@ -634,13 +634,13 @@ FrPair GetInchOrMM(MapUnit eU)
case MAP_MM : return FrPair( 1,1);
case MAP_CM : return FrPair( 1,10);
case MAP_PIXEL : {
- ScopedVclPtr<VirtualDevice> pVD( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVD;
pVD->SetMapMode(MapMode(MAP_100TH_MM));
Point aP(pVD->PixelToLogic(Point(64,64))); // 64 pixels for more accuracy
return FrPair(6400,aP.X(),6400,aP.Y());
}
case MAP_APPFONT: case MAP_SYSFONT: {
- ScopedVclPtr<VirtualDevice> pVD( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVD;
pVD->SetMapMode(MapMode(eU));
Point aP(pVD->LogicToPixel(Point(32,32))); // 32 units for more accuracy
pVD->SetMapMode(MapMode(MAP_100TH_MM));
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 569d5a1ac8e2..a033fd8c7eb8 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -553,7 +553,7 @@ GDIMetaFile SdrExchangeView::GetMarkedObjMetaFile(bool bNoVDevIfOneMtfMarked) co
if( !aMtf.GetActionSize() )
{
- ScopedVclPtr<VirtualDevice> pOut(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pOut;
const Size aDummySize(2, 2);
pOut->SetOutputSizePixel(aDummySize);
@@ -640,7 +640,7 @@ Graphic SdrExchangeView::GetObjGraphic( const SdrModel* pModel, const SdrObject*
// if graphic could not be retrieved => go the hard way and create a MetaFile
if( ( GRAPHIC_NONE == aRet.GetType() ) || ( GRAPHIC_DEFAULT == aRet.GetType() ) )
{
- ScopedVclPtr<VirtualDevice> pOut(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pOut;
GDIMetaFile aMtf;
const Rectangle aBoundRect( pObj->GetCurrentBoundRect() );
const MapMode aMap( pModel->GetScaleUnit(),
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx
index df7954b0f313..103aa77a9505 100644
--- a/svx/source/tbxctrls/colrctrl.cxx
+++ b/svx/source/tbxctrls/colrctrl.cxx
@@ -277,7 +277,7 @@ void SvxColorDockingWindow::FillValueSet()
const Size aColorSize(aColorSet->getEntryEdgeLength(), aColorSet->getEntryEdgeLength());
long nPtX = aColorSize.Width() - 1;
long nPtY = aColorSize.Height() - 1;
- ScopedVclPtr<VirtualDevice> pVD(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pVD;
pVD->SetOutputSizePixel( aColorSize );
pVD->SetLineColor( Color( COL_BLACK ) );
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 2ee00f7460f0..2dfc0ad0806e 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -124,7 +124,7 @@ void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId)
if (GalleryExplorer::GetSdrObj(nThemeId, nModelPos, pModel, &aThumb) && !!aThumb)
{
- ScopedVclPtr<VirtualDevice> pVDev(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
const Point aNull(0, 0);
if (GetDPIScaleFactor() > 1)
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index eb19aa1171f4..fb591df68d04 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -401,7 +401,7 @@ void SvxLineEndWindow::FillValueSet()
if( pLineEndList.is() )
{
XLineEndEntry* pEntry = NULL;
- ScopedVclPtr<VirtualDevice> pVD(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > pVD;
long nCount = pLineEndList->Count();
diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx
index d3b9fac6d88d..bde80c43b67d 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionbar.cxx
@@ -583,7 +583,7 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rB
double fDepth = static_cast<const SvxDoubleItem*>(rReq.GetArgs()->GetItem(SID_EXTRUSION_DEPTH))->GetValue();
FieldUnit eUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(rReq.GetArgs()->GetItem(SID_ATTR_METRIC))->GetValue();
- ScopedVclPtr<ExtrusionDepthDialog> aDlg(new ExtrusionDepthDialog(0L, fDepth, eUnit));
+ ScopedVclPtrInstance< ExtrusionDepthDialog > aDlg(0L, fDepth, eUnit);
sal_uInt16 nRet = aDlg->Execute();
if( nRet != 0 )
{
diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx
index e0589a258d91..575cdc81d5d1 100644
--- a/svx/source/toolbars/fontworkbar.cxx
+++ b/svx/source/toolbars/fontworkbar.cxx
@@ -432,7 +432,7 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi
{
case SID_FONTWORK_GALLERY_FLOATER:
{
- ScopedVclPtr<FontWorkGalleryDialog> aDlg(new FontWorkGalleryDialog( pSdrView, ImpGetViewWin(pSdrView), nSID ) );
+ ScopedVclPtrInstance< FontWorkGalleryDialog > aDlg( pSdrView, ImpGetViewWin(pSdrView), nSID );
aDlg->Execute();
}
break;
@@ -491,7 +491,7 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi
if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SfxItemState::SET ) )
{
sal_Int32 nCharSpacing = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_FONTWORK_CHARACTER_SPACING))->GetValue();
- ScopedVclPtr<FontworkCharacterSpacingDialog> aDlg(new FontworkCharacterSpacingDialog( 0L, nCharSpacing ) );
+ ScopedVclPtrInstance< FontworkCharacterSpacingDialog > aDlg( 0L, nCharSpacing );
sal_uInt16 nRet = aDlg->Execute();
if( nRet != 0 )
{
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index adfbf587abec..b61c625b4cc2 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -624,7 +624,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
if( !pPage )
return false;
- ScopedVclPtr<VirtualDevice> aVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > aVDev;
const MapMode aMap( mpDoc->GetScaleUnit(), Point(), rSettings.maScaleX, rSettings.maScaleY );
SdrOutliner& rOutl=mpDoc->GetDrawOutliner(NULL);
@@ -907,7 +907,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic,
if( !bSingleGraphic )
{
// create a metafile for all shapes
- ScopedVclPtr<VirtualDevice> aOut(new VirtualDevice());
+ ScopedVclPtrInstance< VirtualDevice > aOut;
// calculate bound rect for all shapes
Rectangle aBound;
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 9c1981ee027f..e93ae4010d2b 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -670,7 +670,7 @@ uno::Any SvxShape::GetBitmap( bool bMetaFile /* = false */ ) const
if( !mpObj.is() || mpModel == NULL || !mpObj->IsInserted() || NULL == mpObj->GetPage() )
return aAny;
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
pVDev->SetMapMode(MapMode(MAP_100TH_MM));
SdrModel* pModel = mpObj->GetModel();
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index cecfc7c27725..73316ec1a6cb 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -140,7 +140,7 @@ const GraphicObject& XOBitmap::GetGraphicObject() const
void XOBitmap::Bitmap2Array()
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
bool bPixelColor = false;
const Bitmap aBitmap( GetBitmap() );
const sal_uInt16 nLines = 8; // type dependent
@@ -175,7 +175,7 @@ void XOBitmap::Bitmap2Array()
/// convert array, fore- and background color into a bitmap
void XOBitmap::Array2Bitmap()
{
- ScopedVclPtr<VirtualDevice> pVDev( new VirtualDevice() );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
sal_uInt16 nLines = 8; // type dependent
if( !pPixelArray )
diff --git a/svx/workben/pixelctl.cxx b/svx/workben/pixelctl.cxx
index b9fefd0d2e2c..2ff8ca838263 100644
--- a/svx/workben/pixelctl.cxx
+++ b/svx/workben/pixelctl.cxx
@@ -98,7 +98,7 @@ public:
void Main()
{
- ScopedVclPtr<MyWin> aMainWin(new MyWin( NULL, WB_STDWORK ));
+ ScopedVclPtrInstance< MyWin > aMainWin( nullptr, WB_STDWORK );
aMainWin->SetText( OUString( "SvxPixelCtl" ) );
aMainWin->Show();
diff --git a/sw/qa/tiledrendering/tiledrendering.cxx b/sw/qa/tiledrendering/tiledrendering.cxx
index 6ba5ae3a1c6c..2fddd6c33691 100644
--- a/sw/qa/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/tiledrendering/tiledrendering.cxx
@@ -197,7 +197,7 @@ int TiledRenderingApp::Main()
Help::EnableQuickHelp();
try
{
- ScopedVclPtr<TiledRenderingDialog> pDialog(new TiledRenderingDialog(this));
+ ScopedVclPtrInstance< TiledRenderingDialog > pDialog(this);
pDialog->Execute();
}
catch (const uno::Exception &e)
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index 360b45e1ab74..ccd71a80a94b 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -2665,7 +2665,7 @@ void DocumentRedlineManager::checkRedlining(RedlineMode_t& _rReadlineMode)
if ( pParent && !mbReadlineChecked && rRedlineTbl.size() > MAX_REDLINE_COUNT
&& !((_rReadlineMode & nsRedlineMode_t::REDLINE_SHOW_DELETE) == nsRedlineMode_t::REDLINE_SHOW_DELETE) )
{
- ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(pParent, "QueryShowChangesDialog", "modules/swriter/ui/queryshowchangesdialog.ui"));
+ ScopedVclPtrInstance< MessageDialog > aQuery(pParent, "QueryShowChangesDialog", "modules/swriter/ui/queryshowchangesdialog.ui");
sal_uInt16 nResult = aQuery->Execute();
mbReadlineChecked = true;
if ( nResult == RET_YES )
diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index 6ce1b194f628..ab6fe8a69e15 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -217,7 +217,7 @@ IMPL_LINK(SwMailConfigPage, ReplyToHdl, CheckBox*, pBox)
IMPL_LINK_NOARG(SwMailConfigPage, AuthenticationHdl)
{
- ScopedVclPtr<SwAuthenticationSettingsDialog> aDlg(new SwAuthenticationSettingsDialog(this, *m_pConfigItem));
+ ScopedVclPtrInstance< SwAuthenticationSettingsDialog > aDlg(this, *m_pConfigItem);
aDlg->Execute();
return 0;
}
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index c1a4aaa754e7..149041798109 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -576,7 +576,7 @@ void SwAddressListDialog::DetectTablesAndQueries(
if(nTables > 1 && bWidthDialog)
{
//now call the table select dialog - if more than one table exists
- VclPtr<SwSelectDBTableDialog> pDlg(new SwSelectDBTableDialog(this, pUserData->xConnection));
+ VclPtrInstance<SwSelectDBTableDialog> pDlg(this, pUserData->xConnection);
const OUString sTable = SvTabListBox::GetEntryText(pSelect, ITEMID_TABLE - 1);
if(!sTable.isEmpty())
pDlg->SetSelectedTable(sTable, pUserData->nCommandType == CommandType::TABLE);
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 5f7a6fde5281..6dbd308133ce 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -578,7 +578,7 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, FindHdl_Impl)
IMPL_LINK(SwCreateAddressListDialog, CustomizeHdl_Impl, PushButton*, pButton)
{
- VclPtr<SwCustomizeAddressListDialog> pDlg(new SwCustomizeAddressListDialog(pButton, *m_pCSVData));
+ VclPtrInstance< SwCustomizeAddressListDialog > pDlg(pButton, *m_pCSVData);
if(RET_OK == pDlg->Execute())
{
delete m_pCSVData;
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 42b9e33118be..9d632f1cb974 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -163,7 +163,7 @@ IMPL_LINK_NOARG(SwMailMergeAddressBlockPage, AddressListHdl_Impl)
{
try
{
- VclPtr<SwAddressListDialog> xAddrDialog(new SwAddressListDialog(this));
+ VclPtrInstance< SwAddressListDialog > xAddrDialog(this);
if(RET_OK == xAddrDialog->Execute())
{
SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index 6b4ee00ca8ae..50fe45c17446 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -126,7 +126,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
if(bTemplate)
{
m_pLoadTemplateRB->Check();
- VclPtr<SfxNewFileDialog> pNewFileDlg(new SfxNewFileDialog(this, 0));
+ VclPtrInstance< SfxNewFileDialog > pNewFileDlg(this, 0);
sal_uInt16 nRet = pNewFileDlg->Execute();
if(RET_TEMPLATE_LOAD == nRet)
bTemplate = false;
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index bdb8992004c1..438225085654 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -540,7 +540,7 @@ IMPL_LINK(SwMailMergeOutputPage, DocumentSelectionHdl_Impl, RadioButton*, pButto
IMPL_LINK(SwMailMergeOutputPage, CopyToHdl_Impl, PushButton*, pButton)
{
- ScopedVclPtr<SwCopyToDialog> pDlg(new SwCopyToDialog(pButton));
+ ScopedVclPtrInstance< SwCopyToDialog > pDlg(pButton);
pDlg->SetCC(m_sCC );
pDlg->SetBCC(m_sBCC);
if(RET_OK == pDlg->Execute())
@@ -733,7 +733,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
}
SwView* pSourceView = rConfigItem.GetSourceView();
- ScopedVclPtrInstance<PrintMonitor> aSaveMonitor(this, false, PrintMonitor::MONITOR_TYPE_SAVE);
+ ScopedVclPtrInstance< PrintMonitor > aSaveMonitor(this, false, PrintMonitor::MONITOR_TYPE_SAVE);
aSaveMonitor->m_pDocName->SetText(pSourceView->GetDocShell()->GetTitle(22));
aSaveMonitor->SetCancelHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl));
aSaveMonitor->m_pPrinter->SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) );
@@ -799,7 +799,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
if(bFailed)
{
- ScopedVclPtr<SwSaveWarningBox_Impl> aWarning(new SwSaveWarningBox_Impl( pButton, sOutPath ));
+ ScopedVclPtrInstance< SwSaveWarningBox_Impl > aWarning( pButton, sOutPath );
if(RET_OK == aWarning->Execute())
sOutPath = aWarning->GetFileName();
else
@@ -983,12 +983,12 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
if(rConfigItem.GetMailServer().isEmpty() ||
!SwMailMergeHelper::CheckMailAddress(rConfigItem.GetMailAddress()) )
{
- ScopedVclPtr<QueryBox> aQuery(new QueryBox(pButton, WB_YES_NO_CANCEL, m_sConfigureMail));
+ ScopedVclPtrInstance< QueryBox > aQuery(pButton, WB_YES_NO_CANCEL, m_sConfigureMail);
sal_uInt16 nRet = aQuery->Execute();
if(RET_YES == nRet )
{
SfxAllItemSet aSet(pTargetView->GetPool());
- ScopedVclPtr<SwMailConfigDlg> pDlg(new SwMailConfigDlg(pButton, aSet));
+ ScopedVclPtrInstance< SwMailConfigDlg > pDlg(pButton, aSet);
nRet = pDlg->Execute();
}
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index f486d75ae03b..09cf2cf750f3 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -583,7 +583,7 @@ void SwSendMailDialog::DocumentSent( uno::Reference< mail::XMailMessage> xMessag
if (pError)
{
- VclPtr<SwSendWarningBox_Impl> pDlg(new SwSendWarningBox_Impl(0, *pError));
+ VclPtrInstance< SwSendWarningBox_Impl > pDlg(nullptr, *pError);
pDlg->Execute();
}
}
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index 99581c799b16..5cf71f0eb173 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -187,7 +187,7 @@ IMPL_LINK(SwSelectDBTableDialog, PreviewHdl, PushButton*, pButton)
pProperties[4].Name = "ShowTreeViewButton";
pProperties[4].Value <<= sal_False;
- VclPtr<SwDBTablePreviewDialog> pDlg(new SwDBTablePreviewDialog(pButton, aProperties));
+ VclPtrInstance< SwDBTablePreviewDialog > pDlg(pButton, aProperties);
pDlg->Execute();
}
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index f0e6e9bc39dd..73a396cef327 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -404,7 +404,7 @@ bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox)
if (!pRepr->GetTempPasswd().getLength()
&& pRepr->GetSectionData().GetPassword().getLength())
{
- ScopedVclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(this));
+ ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg(this);
bRet = false;
if (aPasswdDlg->Execute())
{
@@ -1081,7 +1081,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl)
aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth));
aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
- ScopedVclPtr<SwSectionPropertyTabDialog> aTabDlg(new SwSectionPropertyTabDialog(this, aSet, rSh));
+ ScopedVclPtrInstance< SwSectionPropertyTabDialog > aTabDlg(this, aSet, rSh);
if(RET_OK == aTabDlg->Execute())
{
const SfxItemSet* pOutSet = aTabDlg->GetOutputItemSet();
@@ -1260,7 +1260,7 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox )
{
if(!pRepr->GetTempPasswd().getLength() || bChange)
{
- ScopedVclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(this));
+ ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg(this);
aPasswdDlg->ShowExtras(SHOWEXTRAS_CONFIRM);
if(RET_OK == aPasswdDlg->Execute())
{
@@ -1721,7 +1721,7 @@ IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton )
{
if(!m_aNewPasswd.getLength() || bChange)
{
- ScopedVclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(this));
+ ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg(this);
aPasswdDlg->ShowExtras(SHOWEXTRAS_CONFIRM);
if(RET_OK == aPasswdDlg->Execute())
{
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 4cb70e88476d..b8ec0bd0e391 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -319,7 +319,7 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
::PrepareBoxInfo( aTmpSet, *pSh );
const OUString sFmtStr = pColl->GetName();
- VclPtr<SwParaDlg> pDlg(new SwParaDlg(GetParentSwEnvDlg(), pSh->GetView(), aTmpSet, DLG_ENVELOP, &sFmtStr));
+ VclPtrInstance< SwParaDlg > pDlg(GetParentSwEnvDlg(), pSh->GetView(), aTmpSet, DLG_ENVELOP, &sFmtStr);
if ( pDlg->Execute() == RET_OK )
{
diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx
index 0fea874dca82..b6b8a3f580dc 100644
--- a/sw/source/ui/envelp/envprt.cxx
+++ b/sw/source/ui/envelp/envprt.cxx
@@ -116,7 +116,7 @@ IMPL_LINK( SwEnvPrtPage, ButtonHdl, Button *, pBtn )
// Call printer setup
if (pPrt)
{
- VclPtr<PrinterSetupDialog> pDlg(new PrinterSetupDialog(this));
+ VclPtrInstance< PrinterSetupDialog > pDlg(this);
pDlg->SetPrinter(pPrt);
pDlg->Execute();
pDlg.reset();
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index 7c1ca59c064c..cfffa1f57b54 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -436,7 +436,7 @@ IMPL_LINK_NOARG_INLINE_END(SwLabPage, TypeHdl)
void SwLabPage::DisplayFormat()
{
- ScopedVclPtr<MetricField> aField(new MetricField(this, WinBits(0)));
+ ScopedVclPtrInstance< MetricField > aField(this, WinBits(0));
FieldUnit aMetric = ::GetDfltMetric(false);
SetMetric(*aField.get(), aMetric);
aField->SetDecimalDigits(2);
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index ee31bc5d3841..7ff48c71944e 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -579,7 +579,7 @@ IMPL_LINK_NOARG(SwLabFmtPage, SaveHdl)
aRec.lPWidth = static_cast< long >(GETFLDVAL(*m_pPWidthField ));
aRec.lPHeight = static_cast< long >(GETFLDVAL(*m_pPHeightField));
aRec.bCont = aItem.bCont;
- ScopedVclPtr<SwSaveLabelDlg> pSaveDlg(new SwSaveLabelDlg(this, aRec));
+ ScopedVclPtrInstance< SwSaveLabelDlg > pSaveDlg(this, aRec);
pSaveDlg->SetLabel(aItem.aLstMake, aItem.aLstType);
pSaveDlg->Execute();
if(pSaveDlg->GetLabel(aItem))
diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx
index 77be9df13fc2..4fd81fe25f87 100644
--- a/sw/source/ui/envelp/labprt.cxx
+++ b/sw/source/ui/envelp/labprt.cxx
@@ -88,7 +88,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
if (!pPrinter)
pPrinter = new Printer;
- VclPtr<PrinterSetupDialog> pDlg(new PrinterSetupDialog(this));
+ VclPtrInstance< PrinterSetupDialog > pDlg(this);
pDlg->SetPrinter(pPrinter);
pDlg->Execute();
pDlg.reset();
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index b08a6af3ecb9..11dccd075cc9 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -540,7 +540,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
// collect character styles
- ScopedVclPtr<ListBox> rCharFmtLB(new ListBox(this));
+ ScopedVclPtrInstance< ListBox > rCharFmtLB(this);
rCharFmtLB->Clear();
rCharFmtLB->InsertEntry( SwViewShell::GetShellRes()->aStrNone );
SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index d66cf500b440..14c43ccb9d7d 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -284,8 +284,8 @@ IMPL_LINK_INLINE_START( SwCaptionDialog, OptionHdl, Button*, pButton )
{
OUString sFldTypeName = m_pCategoryBox->GetText();
if(sFldTypeName == m_sNone)
- sFldTypeName = OUString();
- ScopedVclPtrInstance<SwSequenceOptionDialog> aDlg( pButton, rView, sFldTypeName );
+ sFldTypeName.clear();
+ ScopedVclPtrInstance< SwSequenceOptionDialog > aDlg( pButton, rView, sFldTypeName );
aDlg->SetApplyBorderAndShadow(bCopyAttributes);
aDlg->SetCharacterStyle( sCharacterStyle );
aDlg->SetOrderNumberingFirst( bOrderNumberingFirst );
@@ -339,7 +339,7 @@ IMPL_LINK_NOARG(SwCaptionDialog, ModifyHdl)
IMPL_LINK_NOARG(SwCaptionDialog, CaptionHdl)
{
SfxItemSet aSet( rView.GetDocShell()->GetDoc()->GetAttrPool() );
- ScopedVclPtr<SwCaptionOptDlg> aDlg(new SwCaptionOptDlg( this, aSet ) );
+ ScopedVclPtrInstance< SwCaptionOptDlg > aDlg( this, aSet );
aDlg->Execute();
return 0;
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index ccf04859f8eb..a274cbd426c7 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -490,7 +490,7 @@ IMPL_LINK_NOARG( SwMultiTOXTabDialog, ShowPreviewHdl )
OUString sInfo(SW_RESSTR(STR_FILE_NOT_FOUND));
sInfo = sInfo.replaceFirst( "%1", sTemplate );
sInfo = sInfo.replaceFirst( "%2", aOpt.GetTemplatePath() );
- ScopedVclPtr<InfoBox> aInfo(new InfoBox(GetParent(), sInfo));
+ ScopedVclPtrInstance< InfoBox > aInfo(GetParent(), sInfo);
aInfo->Execute();
}
else
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 34ca667d31be..bb595bf5d737 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -584,7 +584,7 @@ IMPL_LINK( SwNewUserIdxDlg, ModifyHdl, Edit*, pEdit)
IMPL_LINK_NOARG(SwIndexMarkPane, NewUserIdxHdl)
{
- ScopedVclPtr<SwNewUserIdxDlg> pDlg(new SwNewUserIdxDlg(this));
+ ScopedVclPtrInstance< SwNewUserIdxDlg > pDlg(this);
if(RET_OK == pDlg->Execute())
{
OUString sNewName(pDlg->GetName());
@@ -1208,7 +1208,7 @@ IMPL_LINK_NOARG(SwAuthorMarkPane, InsertHdl)
bDifferent |= m_sFields[i] != pEntry->GetAuthorField((ToxAuthorityField)i);
if(bDifferent)
{
- ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(&m_rDialog, SW_RES(STR_QUERY_CHANGE_AUTH_ENTRY), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQuery(&m_rDialog, SW_RES(STR_QUERY_CHANGE_AUTH_ENTRY), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if(RET_YES != aQuery->Execute())
return 0;
}
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 458c6aca348a..7f86ef083348 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -151,7 +151,7 @@ void SwGlossaryGroupDlg::Apply()
const OUString sMsg(SW_RESSTR(STR_QUERY_DELETE_GROUP1)
+ sTitle
+ SW_RESSTR(STR_QUERY_DELETE_GROUP2));
- ScopedVclPtr<QueryBox> aQuery(new QueryBox(this->GetParent(), WB_YES_NO|WB_DEF_NO, sMsg ));
+ ScopedVclPtrInstance< QueryBox > aQuery(this->GetParent(), WB_YES_NO|WB_DEF_NO, sMsg );
if(RET_YES == aQuery->Execute())
pGlosHdl->DelGroup( sDelGroup );
}
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index be6bf1546d8a..0d21fa03ba3e 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -523,7 +523,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
}
else if (sItemIdent == "delete")
{
- ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(this, SW_RES(STR_QUERY_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aQuery(this, SW_RES(STR_QUERY_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if (RET_YES == aQuery->Execute())
{
const OUString aShortName(m_pShortNameEdit->GetText());
@@ -651,7 +651,7 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl)
if(bIsWritable)
{
- ScopedVclPtr<SwGlossaryGroupDlg> pDlg(new SwGlossaryGroupDlg( this, pGloss->GetPathArray(), pGlossaryHdl ));
+ ScopedVclPtrInstance< SwGlossaryGroupDlg > pDlg( this, pGloss->GetPathArray(), pGlossaryHdl );
if ( RET_OK == pDlg->Execute() )
{
Init();
@@ -681,7 +681,7 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl)
}
else
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(this, sReadonlyPath, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aBox(this, sReadonlyPath, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if(RET_YES == aBox->Execute())
PathHdl(m_pPathBtn);
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 276e76ea572c..2d347ba8eb42 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -990,7 +990,7 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
// collect char styles
- ScopedVclPtr<ListBox> rCharFmtLB(new ListBox(this));
+ ScopedVclPtrInstance< ListBox > rCharFmtLB(this);
rCharFmtLB->Clear();
rCharFmtLB->InsertEntry( SwViewShell::GetShellRes()->aStrNone );
SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell();
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 08583bf9f9bd..c648fb635cb1 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -287,7 +287,7 @@ IMPL_LINK( SwOutlineTabDialog, MenuSelectHdl, Menu *, pMenu )
nLevelNo = 9;
else if (sIdent == "saveas")
{
- VclPtr<SwNumNamesDlg> pDlg(new SwNumNamesDlg(this));
+ VclPtrInstance< SwNumNamesDlg > pDlg(this);
const OUString *aStrArr[SwChapterNumRules::nMaxRules];
for(sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i)
{
@@ -931,7 +931,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
{
const Size aSize(PixelToLogic(GetOutputSizePixel()));
- ScopedVclPtr<VirtualDevice> pVDev(new VirtualDevice(*this));
+ ScopedVclPtrInstance< VirtualDevice > pVDev(*this);
pVDev->SetMapMode(GetMapMode());
pVDev->SetOutputSize( aSize );
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index b4c9881803c3..a578ff05ebbc 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -388,7 +388,9 @@ namespace
sal_uInt16 aRotation = aMetadata.getRotation();
if (aRotation != 0)
{
- ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( 0,"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui") );
+ ScopedVclPtrInstance< MessageDialog > aQueryBox(
+ nullptr, "QueryRotateIntoStandardOrientationDialog",
+ "modules/swriter/ui/queryrotateintostandarddialog.ui");
if (aQueryBox->Execute() == RET_YES)
{
GraphicNativeTransform aTransform( aGraphic );
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index 641739755dc2..dbe37ec77fbc 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -803,7 +803,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
uno::Any exc( ::cppu::getCaughtException() );
OUString msg( ::comphelper::anyToString( exc ) );
const SolarMutexGuard guard;
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(NULL, msg));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg);
aErrorBox->SetText( "Explanations" );
aErrorBox->Execute();
}
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 5014223d5e6f..7823ca126637 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -163,7 +163,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
Graphic aGraphic = Graphic( *pGraphic );
- ScopedVclPtr<CompressGraphicsDialog> aDialog(new CompressGraphicsDialog( GetView().GetWindow(), aGraphic, aSize, aCropRectangle, GetView().GetViewFrame()->GetBindings() ) );
+ ScopedVclPtrInstance< CompressGraphicsDialog > aDialog( GetView().GetWindow(), aGraphic, aSize, aCropRectangle, GetView().GetViewFrame()->GetBindings() );
if( aDialog->Execute() == RET_OK )
{
rSh.StartAllAction();
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 314eccf5e12e..4367f93b3102 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -240,7 +240,7 @@ int SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter,
const sal_uInt16 aRotation = aMetadata.getRotation();
if (aRotation != 0)
{
- ScopedVclPtr<MessageDialog> aQueryBox(new MessageDialog( GetWindow(),"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui") );
+ ScopedVclPtrInstance< MessageDialog > aQueryBox( GetWindow(),"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui");
if (aQueryBox->Execute() == RET_YES)
{
GraphicNativeTransform aTransform( aGraphic );
@@ -439,7 +439,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
// really store as link only?
if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
{
- ScopedVclPtr<SvxLinkWarningDialog> aWarnDlg(new SvxLinkWarningDialog(GetWindow(),pFileDlg->GetPath()));
+ ScopedVclPtrInstance< SvxLinkWarningDialog > aWarnDlg(GetWindow(),pFileDlg->GetPath());
if( aWarnDlg->Execute() != RET_OK )
bAsLink=false; // don't store as link
}
@@ -504,7 +504,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
{
if( bShowError )
{
- ScopedVclPtr<MessageDialog> aInfoBox(new MessageDialog( GetWindow(), SW_RESSTR( nResId ), VCL_MESSAGE_INFO) );
+ ScopedVclPtrInstance< MessageDialog > aInfoBox( GetWindow(), SW_RESSTR( nResId ), VCL_MESSAGE_INFO);
aInfoBox->Execute();
}
rReq.Ignore();
@@ -585,7 +585,7 @@ void SwView::Execute(SfxRequest &rReq)
pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
else
pParent = &GetViewFrame()->GetWindow();
- ScopedVclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog( pParent ));
+ ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg( pParent );
aPasswdDlg->SetMinLen( 1 );
//#i69751# the result of Execute() can be ignored
(void)aPasswdDlg->Execute();
@@ -623,7 +623,7 @@ void SwView::Execute(SfxRequest &rReq)
pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr();
else
pParent = &GetViewFrame()->GetWindow();
- ScopedVclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog( pParent ));
+ ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg( pParent );
aPasswdDlg->SetMinLen( 1 );
if(!aPasswd.getLength())
aPasswdDlg->ShowExtras(SHOWEXTRAS_CONFIRM);
@@ -2390,7 +2390,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument)
SfxApplication* pSfxApp = SfxGetpApp();
vcl::Window* pTopWin = pSfxApp->GetTopWindow();
- ScopedVclPtr<SfxTemplateManagerDlg> aDocTemplDlg(new SfxTemplateManagerDlg);
+ ScopedVclPtrInstance< SfxTemplateManagerDlg > aDocTemplDlg;
int nRet = aDocTemplDlg->Execute();
bool bNewWin = false;
if ( nRet == RET_OK )
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index 0b75147b401a..228ba99bae98 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -177,7 +177,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
if ( pSdrView )
{
SdrObject* pObj = NULL;
- ScopedVclPtr<svx::FontWorkGalleryDialog> aDlg(new svx::FontWorkGalleryDialog( pSdrView, pWin, nSlotId ));
+ ScopedVclPtrInstance< svx::FontWorkGalleryDialog > aDlg( pSdrView, pWin, nSlotId );
aDlg->SetSdrObjectRef( &pObj, pSdrView->GetModel() );
aDlg->Execute();
if ( pObj )
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index a68bd58e5ede..637fdd0f9913 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -459,7 +459,7 @@ void SwView::HyphenateDocument()
// turned on no special area
{
// I want also in special areas hyphenation
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(&GetEditWin(), SW_RES(STR_QUERY_SPECIAL_FORCED), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ ScopedVclPtrInstance< MessageDialog > aBox(&GetEditWin(), SW_RES(STR_QUERY_SPECIAL_FORCED), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
if( aBox->Execute() == RET_YES )
{
bOther = true;
diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx
index f3b963724472..2309ea25209e 100644
--- a/sw/source/uibase/uiview/viewprt.cxx
+++ b/sw/source/uibase/uiview/viewprt.cxx
@@ -175,7 +175,7 @@ void SwView::ExecutePrint(SfxRequest& rReq)
}
else
{
- ScopedVclPtr<MessageDialog> aInfoBox(new MessageDialog(&GetEditWin(), SW_RES(STR_ERR_NO_FAX), VCL_MESSAGE_INFO));
+ ScopedVclPtrInstance< MessageDialog > aInfoBox(&GetEditWin(), SW_RES(STR_ERR_NO_FAX), VCL_MESSAGE_INFO);
sal_uInt16 nResNo = bWeb ? STR_WEBOPTIONS : STR_TEXTOPTIONS;
aInfoBox->set_primary_text(aInfoBox->get_primary_text().replaceFirst("%1", OUString(SW_RES(nResNo))));
aInfoBox->Execute();
diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx
index cf9d634e5435..f6924e73b40a 100644
--- a/sw/source/uibase/utlui/gloslst.cxx
+++ b/sw/source/uibase/utlui/gloslst.cxx
@@ -158,7 +158,7 @@ bool SwGlossaryList::GetShortName(const OUString& rLongName,
}
else if(1 < nCount)
{
- ScopedVclPtr<SwGlossDecideDlg> aDlg(new SwGlossDecideDlg(0));
+ ScopedVclPtrInstance< SwGlossDecideDlg > aDlg(0);
OUString sTitle = aDlg->GetText() + " " + aTripleStrings.front().sBlock;
aDlg->SetText(sTitle);
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index f8ec35ec28f3..e0ea07c1b85f 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -1024,7 +1024,7 @@ executeMessageBox(
{
SolarMutexGuard aGuard;
- ScopedVclPtr<MessBox> xBox(new MessBox(pParent, nButtonMask, rTitle, rMessage));
+ ScopedVclPtrInstance< MessBox > xBox(pParent, nButtonMask, rTitle, rMessage);
sal_uInt16 aResult = xBox->Execute();
switch( aResult )
diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
index 1dd9205c6525..85ddf2754b81 100644
--- a/uui/source/masterpasscrtdlg.cxx
+++ b/uui/source/masterpasscrtdlg.cxx
@@ -41,7 +41,7 @@ IMPL_LINK_NOARG(MasterPasswordCreateDialog, OKHdl_Impl)
else
{
OUString aErrorMsg( ResId( STR_ERROR_PASSWORDS_NOT_IDENTICAL, *pResourceMgr ));
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(this, aErrorMsg));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(this, aErrorMsg);
aErrorBox->Execute();
m_pEDMasterPasswordCrt->SetText( OUString() );
m_pEDMasterPasswordRepeat->SetText( OUString() );
diff --git a/uui/source/masterpassworddlg.cxx b/uui/source/masterpassworddlg.cxx
index 46d4b7ebbbdb..924112b088c7 100644
--- a/uui/source/masterpassworddlg.cxx
+++ b/uui/source/masterpassworddlg.cxx
@@ -49,7 +49,7 @@ MasterPasswordDialog::MasterPasswordDialog
if( nDialogMode == ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER )
{
OUString aErrorMsg( ResId( STR_ERROR_MASTERPASSWORD_WRONG, *pResourceMgr ));
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(pParent, aErrorMsg));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(pParent, aErrorMsg);
aErrorBox->Execute();
}
diff --git a/uui/source/nameclashdlg.cxx b/uui/source/nameclashdlg.cxx
index 8e11603b278d..06ff359bf3ca 100644
--- a/uui/source/nameclashdlg.cxx
+++ b/uui/source/nameclashdlg.cxx
@@ -34,7 +34,7 @@ IMPL_LINK( NameClashDialog, ButtonHdl_Impl, PushButton *, pBtn )
OUString aNewName = m_pEDNewName->GetText();
if ( ( aNewName == maNewName ) || aNewName.isEmpty() )
{
- ScopedVclPtr<MessageDialog> aError(new MessageDialog(NULL, maSameName));
+ ScopedVclPtrInstance< MessageDialog > aError(nullptr, maSameName);
aError->Execute();
return 1;
}
diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx
index b5f3e99d519a..2563ea745de7 100644
--- a/uui/source/passworddlg.cxx
+++ b/uui/source/passworddlg.cxx
@@ -44,7 +44,7 @@ PasswordDialog::PasswordDialog(vcl::Window* _pParent,
const sal_uInt16 nOpenToModifyErrStrId = bOpenToModify ? STR_ERROR_PASSWORD_TO_MODIFY_WRONG : STR_ERROR_PASSWORD_TO_OPEN_WRONG;
const sal_uInt16 nErrStrId = bIsSimplePasswordRequest ? STR_ERROR_SIMPLE_PASSWORD_WRONG : nOpenToModifyErrStrId;
OUString aErrorMsg(ResId(nErrStrId, *pResourceMgr).toString());
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(GetParent(), aErrorMsg));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(GetParent(), aErrorMsg);
aErrorBox->Execute();
}
@@ -106,7 +106,7 @@ IMPL_LINK_NOARG(PasswordDialog, OKHdl_Impl)
if (m_pEDConfirmPassword->IsVisible() && bPasswdMismatch)
{
- ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(this, aPasswdMismatch));
+ ScopedVclPtrInstance< MessageDialog > aErrorBox(this, aPasswdMismatch);
aErrorBox->Execute();
}
else if (bValid)
diff --git a/writerperfect/source/writer/WordPerfectImportFilter.cxx b/writerperfect/source/writer/WordPerfectImportFilter.cxx
index 1f7d8db9aa90..54c671294cc0 100644
--- a/writerperfect/source/writer/WordPerfectImportFilter.cxx
+++ b/writerperfect/source/writer/WordPerfectImportFilter.cxx
@@ -119,7 +119,7 @@ throw (RuntimeException, std::exception)
int unsuccessfulAttempts = 0;
while (true)
{
- ScopedVclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(0));
+ ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg(0);
aPasswdDlg->SetMinLen(0);
if (!aPasswdDlg->Execute())
return false;
@@ -303,7 +303,7 @@ throw (RuntimeException, std::exception)
int unsuccessfulAttempts = 0;
while (true)
{
- ScopedVclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(0));
+ ScopedVclPtrInstance< SfxPasswordDialog > aPasswdDlg(0);
aPasswdDlg->SetMinLen(0);
if (!aPasswdDlg->Execute())
return com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL;
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 8f5a0362c9e0..57c338dfe81a 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -246,7 +246,7 @@ bool DocumentDigitalSignatures::ImplViewSignatures(
}
else
{
- ScopedVclPtr<MessageDialog> aBox(new MessageDialog(NULL, XMLSEC_RES(RID_XMLSECWB_NO_MOZILLA_PROFILE), VCL_MESSAGE_WARNING));
+ ScopedVclPtrInstance< MessageDialog > aBox(nullptr, XMLSEC_RES(RID_XMLSECWB_NO_MOZILLA_PROFILE), VCL_MESSAGE_WARNING);
aBox->Execute();
}
@@ -386,7 +386,7 @@ void DocumentDigitalSignatures::manageTrustedSources( ) throw (RuntimeException
if ( aSignatureHelper.Init() )
xSecEnv = aSignatureHelper.GetSecurityEnvironment();
- ScopedVclPtr<MacroSecurity> aDlg(new MacroSecurity( NULL, mxCtx, xSecEnv ) );
+ ScopedVclPtrInstance< MacroSecurity > aDlg( nullptr, mxCtx, xSecEnv );
aDlg->Execute();
}
@@ -401,7 +401,7 @@ void DocumentDigitalSignatures::showCertificate(
if ( bInit )
{
- ScopedVclPtr<CertificateViewer> aViewer(new CertificateViewer( NULL, aSignatureHelper.GetSecurityEnvironment(), _Certificate, false ) );
+ ScopedVclPtrInstance< CertificateViewer > aViewer( nullptr, aSignatureHelper.GetSecurityEnvironment(), _Certificate, false );
aViewer->Execute();
}
@@ -441,7 +441,7 @@ Reference< css::security::XCertificate > DocumentDigitalSignatures::chooseCertif
if ( aSignatureHelper.Init() )
xSecEnv = aSignatureHelper.GetSecurityEnvironment();
- ScopedVclPtr<CertificateChooser> aChooser(new CertificateChooser( NULL, mxCtx, xSecEnv, aSignatureHelper.GetSignatureInformations()) );
+ ScopedVclPtrInstance< CertificateChooser > aChooser( nullptr, mxCtx, xSecEnv, aSignatureHelper.GetSignatureInformations());
if (aChooser->Execute() != RET_OK)
return Reference< css::security::XCertificate >(0);
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index fde97b92e0e3..4d1f11a91104 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -225,7 +225,7 @@ void CertificateChooser::ImplShowCertificateDetails()
uno::Reference< css::security::XCertificate > xCert = GetSelectedCertificate();
if( xCert.is() )
{
- ScopedVclPtr<CertificateViewer> aViewer(new CertificateViewer( this, mxSecurityEnvironment, xCert, true ));
+ ScopedVclPtrInstance< CertificateViewer > aViewer( this, mxSecurityEnvironment, xCert, true );
aViewer->Execute();
}
}
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index 6a859e878cfa..58bf309f5b3c 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -425,7 +425,10 @@ IMPL_LINK_NOARG(CertificateViewerCertPathTP, ViewCertHdl)
SvTreeListEntry* pEntry = mpCertPathLB->FirstSelected();
if( pEntry )
{
- ScopedVclPtrInstance<CertificateViewer> aViewer( this, mpDlg->mxSecurityEnvironment, static_cast<CertPath_UserData*>(pEntry->GetUserData())->mxCert, false );
+ ScopedVclPtrInstance< CertificateViewer > aViewer(
+ this, mpDlg->mxSecurityEnvironment,
+ static_cast<CertPath_UserData*>(pEntry->GetUserData())->mxCert,
+ false );
aViewer->Execute();
}
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index b2e40bed19b8..ecd95070f7a5 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -313,7 +313,7 @@ bool DigitalSignaturesDialog::canAddRemove()
if ( (!bSave1_1 && bDoc1_1) || (bSave1_1 && bDoc1_1) )
{
//#4
- ScopedVclPtr<MessageDialog> err(new MessageDialog(NULL, XMLSEC_RES(STR_XMLSECDLG_OLD_ODF_FORMAT)));
+ ScopedVclPtrInstance< MessageDialog > err(nullptr, XMLSEC_RES(STR_XMLSECDLG_OLD_ODF_FORMAT));
err->Execute();
ret = false;
}
@@ -432,7 +432,7 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, AddButtonHdl)
uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter =
::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
- ScopedVclPtr<CertificateChooser> aChooser(new CertificateChooser( this, mxCtx, xSecEnv, maCurrentSignatureInformations ));
+ ScopedVclPtrInstance< CertificateChooser > aChooser( this, mxCtx, xSecEnv, maCurrentSignatureInformations );
if ( aChooser->Execute() == RET_OK )
{
uno::Reference< ::com::sun::star::security::XCertificate > xCert = aChooser->GetSelectedCertificate();
@@ -767,7 +767,7 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails()
DBG_ASSERT( xCert.is(), "Error getting cCertificate!" );
if ( xCert.is() )
{
- ScopedVclPtr<CertificateViewer> aViewer(new CertificateViewer( this, maSignatureHelper.GetSecurityEnvironment(), xCert, false ));
+ ScopedVclPtrInstance< CertificateViewer > aViewer( this, maSignatureHelper.GetSecurityEnvironment(), xCert, false );
aViewer->Execute();
}
}
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index 2b2b64e7ae1b..ab3ac51ba3f6 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -238,7 +238,7 @@ IMPL_LINK_NOARG(MacroSecurityTrustedSourcesTP, ViewCertPBHdl)
if ( xCert.is() )
{
- ScopedVclPtr<CertificateViewer> aViewer(new CertificateViewer( this, mpDlg->mxSecurityEnvironment, xCert, false ));
+ ScopedVclPtrInstance< CertificateViewer > aViewer( this, mpDlg->mxSecurityEnvironment, xCert, false );
aViewer->Execute();
}
}