summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/basicide/basdoc.cxx2
-rw-r--r--basic/source/runtime/inputbox.cxx2
-rw-r--r--basic/source/runtime/iosys.cxx2
-rw-r--r--cui/source/customize/cfg.cxx5
-rw-r--r--cui/source/dialogs/hltpbase.cxx2
-rw-r--r--cui/source/inc/align.hxx1
-rw-r--r--cui/source/inc/autocdlg.hxx3
-rw-r--r--cui/source/inc/backgrnd.hxx1
-rw-r--r--cui/source/inc/border.hxx1
-rw-r--r--cui/source/inc/chardlg.hxx4
-rw-r--r--cui/source/inc/grfpage.hxx1
-rw-r--r--cui/source/inc/numfmt.hxx1
-rw-r--r--cui/source/inc/optlingu.hxx1
-rw-r--r--cui/source/inc/page.hxx1
-rw-r--r--cui/source/inc/paragrph.hxx4
-rw-r--r--cui/source/inc/tabstpge.hxx1
-rw-r--r--cui/source/options/dbregister.cxx2
-rw-r--r--cui/source/options/optinet2.cxx2
-rw-r--r--cui/source/options/optinet2.hxx2
-rw-r--r--cui/source/options/optlingu.cxx3
-rw-r--r--cui/source/tabpages/align.cxx3
-rw-r--r--cui/source/tabpages/autocdlg.cxx7
-rw-r--r--cui/source/tabpages/backgrnd.cxx2
-rw-r--r--cui/source/tabpages/border.cxx3
-rw-r--r--cui/source/tabpages/chardlg.cxx12
-rw-r--r--cui/source/tabpages/grfpage.cxx3
-rw-r--r--cui/source/tabpages/macroass.cxx2
-rw-r--r--cui/source/tabpages/numfmt.cxx2
-rw-r--r--cui/source/tabpages/page.cxx4
-rw-r--r--cui/source/tabpages/paragrph.cxx8
-rw-r--r--cui/source/tabpages/tabstpge.cxx2
-rw-r--r--cui/source/tabpages/tpcolor.cxx2
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx2
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPage.cxx2
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPage.hxx1
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPageSetup.cxx10
-rw-r--r--dbaccess/source/ui/dlg/ConnectionPageSetup.hxx1
-rw-r--r--dbaccess/source/ui/dlg/UserAdmin.cxx2
-rw-r--r--dbaccess/source/ui/dlg/UserAdmin.hxx1
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx2
-rw-r--r--desktop/source/splash/splash.cxx2
-rw-r--r--extensions/source/bibliography/bibload.cxx4
-rw-r--r--framework/source/services/tabwindowservice.cxx2
-rw-r--r--include/vcl/layout.hxx2
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx6
-rw-r--r--sc/source/ui/attrdlg/tabpages.cxx2
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx2
-rw-r--r--sc/source/ui/dbgui/tpsubt.cxx14
-rw-r--r--sc/source/ui/dbgui/validate.cxx2
-rw-r--r--sc/source/ui/docshell/tpstat.cxx2
-rw-r--r--sc/source/ui/inc/scuitphfedit.hxx4
-rw-r--r--sc/source/ui/inc/tabpages.hxx1
-rw-r--r--sc/source/ui/inc/tpcalc.hxx1
-rw-r--r--sc/source/ui/inc/tpcompatibility.hxx1
-rw-r--r--sc/source/ui/inc/tpdefaults.hxx1
-rw-r--r--sc/source/ui/inc/tpformula.hxx1
-rw-r--r--sc/source/ui/inc/tphf.hxx2
-rw-r--r--sc/source/ui/inc/tpprint.hxx1
-rw-r--r--sc/source/ui/inc/tpstat.hxx1
-rw-r--r--sc/source/ui/inc/tpsubt.hxx4
-rw-r--r--sc/source/ui/inc/tptable.hxx1
-rw-r--r--sc/source/ui/inc/tpusrlst.hxx1
-rw-r--r--sc/source/ui/inc/tpview.hxx2
-rw-r--r--sc/source/ui/miscdlgs/filldlg.cxx4
-rw-r--r--sc/source/ui/miscdlgs/scuiautofmt.cxx14
-rw-r--r--sc/source/ui/optdlg/tpcalc.cxx6
-rw-r--r--sc/source/ui/optdlg/tpcompatibility.cxx2
-rw-r--r--sc/source/ui/optdlg/tpdefaults.cxx2
-rw-r--r--sc/source/ui/optdlg/tpformula.cxx2
-rw-r--r--sc/source/ui/optdlg/tpprint.cxx2
-rw-r--r--sc/source/ui/optdlg/tpusrlst.cxx8
-rw-r--r--sc/source/ui/optdlg/tpview.cxx4
-rw-r--r--sc/source/ui/pagedlg/scuitphfedit.cxx16
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx4
-rw-r--r--sc/source/ui/pagedlg/tptable.cxx2
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx4
-rw-r--r--sc/source/ui/sidebar/ScPanelFactory.cxx4
-rw-r--r--sc/source/ui/view/cellsh3.cxx4
-rw-r--r--sc/source/ui/view/tabvwshf.cxx4
-rw-r--r--sd/source/ui/dlg/sddlgfact.cxx16
-rw-r--r--sd/source/ui/sidebar/AllMasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/sidebar/AllMasterPagesSelector.hxx1
-rw-r--r--sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx1
-rw-r--r--sd/source/ui/sidebar/PanelFactory.cxx10
-rw-r--r--sd/source/ui/sidebar/RecentMasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/sidebar/RecentMasterPagesSelector.hxx1
-rw-r--r--sfx2/source/appl/openuriexternally.cxx6
-rw-r--r--sfx2/source/dialog/taskpane.cxx2
-rw-r--r--sfx2/source/doc/guisaveas.cxx4
-rw-r--r--sfx2/source/sidebar/ControlFactory.cxx4
-rw-r--r--starmath/source/dialog.cxx8
-rw-r--r--svtools/source/dialogs/prnsetup.cxx2
-rw-r--r--svtools/source/uno/unoiface.cxx4
-rw-r--r--svx/source/dialog/fntctrl.cxx2
-rw-r--r--svx/source/dialog/srchdlg.cxx2
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx4
-rw-r--r--sw/source/ui/chrdlg/numpara.cxx3
-rw-r--r--sw/source/ui/chrdlg/swuiccoll.cxx3
-rw-r--r--sw/source/ui/config/optpage.cxx15
-rw-r--r--sw/source/ui/envelp/envfmt.cxx2
-rw-r--r--sw/source/ui/envelp/envlop1.cxx2
-rw-r--r--sw/source/ui/envelp/envprt.cxx2
-rw-r--r--sw/source/ui/envelp/label1.cxx8
-rw-r--r--sw/source/ui/envelp/labfmt.cxx2
-rw-r--r--sw/source/ui/envelp/labprt.cxx4
-rw-r--r--sw/source/ui/frmdlg/column.cxx2
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx8
-rw-r--r--sw/source/ui/frmdlg/wrap.cxx2
-rw-r--r--sw/source/ui/index/cnttab.cxx2
-rw-r--r--sw/source/ui/misc/docfnote.cxx2
-rw-r--r--sw/source/ui/misc/impfnote.hxx1
-rw-r--r--sw/source/ui/misc/pgfnote.cxx2
-rw-r--r--sw/source/ui/misc/pggrid.cxx2
-rw-r--r--sw/source/ui/table/tabledlg.cxx2
-rw-r--r--sw/source/ui/table/tautofmt.cxx8
-rw-r--r--sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx4
-rw-r--r--sw/source/uibase/docvw/AnnotationWin.cxx2
-rw-r--r--sw/source/uibase/inc/optpage.hxx1
-rw-r--r--sw/source/uibase/inc/pgfnote.hxx1
-rw-r--r--sw/source/uibase/sidebar/PageColumnControl.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageOrientationControl.cxx2
-rw-r--r--sw/source/uibase/sidebar/PageSizeControl.cxx2
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.cxx2
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.hxx1
-rw-r--r--sw/source/uibase/sidebar/SwPanelFactory.cxx4
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.cxx2
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.hxx1
-rw-r--r--sw/source/uibase/uiview/pview.cxx2
-rw-r--r--sw/source/uibase/utlui/navipi.cxx3
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx4
-rw-r--r--vcl/source/window/builder.cxx2
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx4
134 files changed, 247 insertions, 204 deletions
diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index 93302febee1d..1c878d826cc4 100644
--- a/basctl/source/basicide/basdoc.cxx
+++ b/basctl/source/basicide/basdoc.cxx
@@ -58,7 +58,7 @@ DocShell::~DocShell()
SfxPrinter* DocShell::GetPrinter( bool bCreate )
{
if ( !pPrinter && bCreate )
- pPrinter.reset(new SfxPrinter(new SfxItemSet(
+ pPrinter.reset(VclPtr<SfxPrinter>::Create(new SfxItemSet(
GetPool(), SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN
)));
diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx
index 0e942fc5555c..e993bed63cb8 100644
--- a/basic/source/runtime/inputbox.cxx
+++ b/basic/source/runtime/inputbox.cxx
@@ -56,7 +56,7 @@ SvRTLInputBox::SvRTLInputBox( vcl::Window* pParent, const OUString& rPrompt,
long nXTwips, long nYTwips ) :
ModalDialog( pParent,WB_3DLOOK | WB_MOVEABLE | WB_CLOSEABLE ),
aEdit( VclPtr<Edit>::Create(this, WB_LEFT | WB_BORDER) ),
- aOk( new OKButton(this) ), aCancel( new CancelButton(this) ), aPromptText( VclPtr<FixedText>::Create(this, WB_WORDBREAK) )
+ aOk( VclPtr<OKButton>::Create(this) ), aCancel( VclPtr<CancelButton>::Create(this) ), aPromptText( VclPtr<FixedText>::Create(this, WB_WORDBREAK) )
{
SetMapMode( MapMode( MAP_APPFONT ) );
Size aDlgSizeApp( 280, 80 );
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 40fb2f63be77..321630c8f23a 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -82,7 +82,7 @@ public:
SbiInputDialog::SbiInputDialog( vcl::Window* pParent, const OUString& rPrompt )
:ModalDialog( pParent, WB_3DLOOK | WB_MOVEABLE | WB_CLOSEABLE ),
aInput( VclPtr<Edit>::Create(this, WB_3DLOOK | WB_LEFT | WB_BORDER) ),
- aOk( new OKButton(this) ), aCancel( VclPtr<CancelButton>::Create(this) )
+ aOk( VclPtr<OKButton>::Create(this) ), aCancel( VclPtr<CancelButton>::Create(this) )
{
SetText( rPrompt );
aOk->SetClickHdl( LINK( this, SbiInputDialog, Ok ) );
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index bbf8d43b2a9f..5e74b9cc53dc 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2118,8 +2118,9 @@ IMPL_LINK( SvxConfigPage, AsyncInfoMsg, OUString*, pMsg )
(void)pMsg;
// Asynchronous msg because of D&D
- MessageDialog( this, CUI_RES(
- RID_SVXSTR_MNUCFG_ALREADY_INCLUDED ), VCL_MESSAGE_INFO ).Execute();
+ ScopedVclPtr<MessageDialog>::Create( this,
+ CUI_RES( RID_SVXSTR_MNUCFG_ALREADY_INCLUDED ),
+ VCL_MESSAGE_INFO )->Execute();
return 0;
}
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 44724042527d..c9b7af89df3c 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -100,7 +100,7 @@ SvxHyperlinkTabPageBase::SvxHyperlinkTabPageBase ( vcl::Window *pParent,
aEmptyStr()
{
// create bookmark-window
- mpMarkWnd = new SvxHlinkDlgMarkWnd ( this );
+ mpMarkWnd = VclPtr<SvxHlinkDlgMarkWnd>::Create( this );
}
SvxHyperlinkTabPageBase::~SvxHyperlinkTabPageBase()
diff --git a/cui/source/inc/align.hxx b/cui/source/inc/align.hxx
index 10ab45233440..a667eb9a902b 100644
--- a/cui/source/inc/align.hxx
+++ b/cui/source/inc/align.hxx
@@ -54,6 +54,7 @@ namespace svx {
class AlignmentTabPage : public SfxTabPage
{
using TabPage::DeactivatePage;
+ friend class VclPtr<AlignmentTabPage>;
static const sal_uInt16 s_pRanges[];
public:
diff --git a/cui/source/inc/autocdlg.hxx b/cui/source/inc/autocdlg.hxx
index db8bc8a84323..1ff86e70fcdf 100644
--- a/cui/source/inc/autocdlg.hxx
+++ b/cui/source/inc/autocdlg.hxx
@@ -125,6 +125,7 @@ public:
class OfaSwAutoFmtOptionsPage : public SfxTabPage
{
+ friend class VclPtr<OfaSwAutoFmtOptionsPage>;
using TabPage::ActivatePage;
VclPtr<OfaACorrCheckListBox> m_pCheckLB;
@@ -338,6 +339,7 @@ public:
class OfaQuoteTabPage : public SfxTabPage
{
+ friend class VclPtr<OfaQuoteTabPage>;
using TabPage::ActivatePage;
private:
@@ -402,6 +404,7 @@ public:
class OfaAutoCompleteTabPage : public SfxTabPage
{
+ friend class VclPtr<OfaAutoCompleteTabPage>;
public:
class AutoCompleteMultiListBox : public MultiListBox
{
diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index 89af13d6f0a9..633e4e6c1e9e 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -45,6 +45,7 @@ class SvxBrushItem;
class SvxBackgroundTabPage : public SvxTabPage
{
using TabPage::DeactivatePage;
+ friend class VclPtr<SvxBackgroundTabPage>;
static const sal_uInt16 pPageRanges[];
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rAttrSet );
diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx
index 75b438b1962a..ff7780403bbb 100644
--- a/cui/source/inc/border.hxx
+++ b/cui/source/inc/border.hxx
@@ -40,6 +40,7 @@ namespace editeng
class SvxBorderTabPage : public SfxTabPage
{
+ friend class VclPtr<SvxBorderTabPage>;
using TabPage::DeactivatePage;
static const sal_uInt16 pRanges[];
diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx
index 9611af4c268f..577b5e1f09d6 100644
--- a/cui/source/inc/chardlg.hxx
+++ b/cui/source/inc/chardlg.hxx
@@ -77,6 +77,7 @@ struct SvxCharNamePage_Impl;
class SvxCharNamePage : public SvxCharBasePage
{
+ friend class VclPtr<SvxCharNamePage>;
private:
static const sal_uInt16 pNameRanges[];
@@ -175,6 +176,7 @@ public:
class SvxCharEffectsPage : public SvxCharBasePage
{
+ friend class VclPtr<SvxCharEffectsPage>;
private:
static const sal_uInt16 pEffectsRanges[];
@@ -254,6 +256,7 @@ public:
class SvxCharPositionPage : public SvxCharBasePage
{
+ friend class VclPtr<SvxCharPositionPage>;
static const sal_uInt16 pPositionRanges[];
private:
@@ -334,6 +337,7 @@ public:
class SvxCharTwoLinesPage : public SvxCharBasePage
{
+ friend class VclPtr<SvxCharTwoLinesPage>;
private:
static const sal_uInt16 pTwoLinesRanges[];
VclPtr<CheckBox> m_pTwoLinesBtn;
diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx
index 47fb0e9425a7..47ac00007c03 100644
--- a/cui/source/inc/grfpage.hxx
+++ b/cui/source/inc/grfpage.hxx
@@ -52,6 +52,7 @@ public:
class SvxGrfCropPage : public SfxTabPage
{
+ friend class VclPtr<SvxGrfCropPage>;
using Window::CalcZoom;
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx
index c4413ab894fd..0c3e21295c41 100644
--- a/cui/source/inc/numfmt.hxx
+++ b/cui/source/inc/numfmt.hxx
@@ -65,6 +65,7 @@ public:
class SvxNumberFormatTabPage : public SfxTabPage
{
+ friend class VclPtr<SvxNumberFormatTabPage>;
using SfxTabPage::DeactivatePage;
static const sal_uInt16 pRanges[];
diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index 73d9aceac4f4..96a02388f8f4 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -93,6 +93,7 @@ public:
class SvxLinguTabPage : public SfxTabPage
{
+ friend class VclPtr<SvxLinguTabPage>;
private:
VclPtr<FixedText> m_pLinguModulesFT;
VclPtr<SvxCheckListBox> m_pLinguModulesCLB;
diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx
index f68bf339bab7..c7b6436e551d 100644
--- a/cui/source/inc/page.hxx
+++ b/cui/source/inc/page.hxx
@@ -69,6 +69,7 @@ typedef sal_uInt16 MarginPosition;
class SvxPageDescPage : public SfxTabPage
{
+ friend class VclPtr<SvxPageDescPage>;
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx
index 0c55af1988e2..db939787629c 100644
--- a/cui/source/inc/paragrph.hxx
+++ b/cui/source/inc/paragrph.hxx
@@ -45,6 +45,7 @@ class SvxLineSpacingItem;
class SvxStdParagraphTabPage: public SfxTabPage
{
+ friend class VclPtr<SvxStdParagraphTabPage>;
using TabPage::DeactivatePage;
static const sal_uInt16 pStdRanges[];
@@ -124,6 +125,7 @@ public:
class SvxParaAlignTabPage : public SfxTabPage
{
+ friend class VclPtr<SvxParaAlignTabPage>;
using TabPage::DeactivatePage;
static const sal_uInt16 pAlignRanges[];
@@ -191,6 +193,7 @@ public:
class SvxExtParagraphTabPage: public SfxTabPage
{
+ friend class VclPtr<SvxExtParagraphTabPage>;
using TabPage::DeactivatePage;
static const sal_uInt16 pExtRanges[];
@@ -265,6 +268,7 @@ private:
class SvxAsianTabPage : public SfxTabPage
{
+ friend class VclPtr<SvxAsianTabPage>;
VclPtr<CheckBox> m_pForbiddenRulesCB;
VclPtr<CheckBox> m_pHangingPunctCB;
diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx
index 05903afd03a4..d73e9635a813 100644
--- a/cui/source/inc/tabstpge.hxx
+++ b/cui/source/inc/tabstpge.hxx
@@ -45,6 +45,7 @@ class TabWin_Impl;
class SvxTabulatorTabPage : public SfxTabPage
{
+ friend class VclPtr<SvxTabulatorTabPage>;
using TabPage::DeactivatePage;
static const sal_uInt16 pRanges[];
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index ba17c70246ef..dc58d2c2e034 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -125,7 +125,7 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons
Size aBoxSize = m_pPathCtrl->GetOutputSizePixel();
WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP;
- pPathBox = new svx::OptHeaderTabListBox( *m_pPathCtrl, nBits );
+ pPathBox = VclPtr<svx::OptHeaderTabListBox>::Create( *m_pPathCtrl, nBits );
HeaderBar &rBar = pPathBox->GetTheHeaderBar();
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 62989f32822c..a3c72ff37eef 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -912,7 +912,7 @@ void SvxSecurityTabPage::InitControls()
VclPtr<SfxTabPage> SvxSecurityTabPage::Create(vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>(new SvxSecurityTabPage(pParent, *rAttrSet), SAL_NO_ACQUIRE);
+ return VclPtr<SvxSecurityTabPage>::Create(pParent, *rAttrSet);
}
void SvxSecurityTabPage::ActivatePage( const SfxItemSet& )
diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx
index 15403a16082a..c23dc7be8c87 100644
--- a/cui/source/options/optinet2.hxx
+++ b/cui/source/options/optinet2.hxx
@@ -128,7 +128,7 @@ class SvxSecurityTabPage : public SfxTabPage
{
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
-
+ friend class VclPtr<SvxSecurityTabPage>;
private:
VclPtr<PushButton> m_pSecurityOptionsPB;
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 3c535f85e544..cafbe1180deb 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1153,8 +1153,7 @@ void SvxLinguTabPage::dispose()
VclPtr<SfxTabPage> SvxLinguTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>( new SvxLinguTabPage( pParent, *rAttrSet ),
- SAL_NO_ACQUIRE );
+ return VclPtr<SvxLinguTabPage>::Create( pParent, *rAttrSet );
}
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 94012e5dc25e..cad777dfcc7a 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -286,8 +286,7 @@ void AlignmentTabPage::dispose()
VclPtr<SfxTabPage> AlignmentTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>( new AlignmentTabPage( pParent, *rAttrSet ),
- SAL_NO_ACQUIRE );
+ return VclPtr<AlignmentTabPage>::Create( pParent, *rAttrSet );
}
bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index c4a91772b2fe..c720d6725028 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -514,7 +514,7 @@ void OfaSwAutoFmtOptionsPage::dispose()
VclPtr<SfxTabPage> OfaSwAutoFmtOptionsPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet)
{
- return VclPtr<SfxTabPage>( new OfaSwAutoFmtOptionsPage(pParent, *rAttrSet), SAL_NO_ACQUIRE );
+ return VclPtr<OfaSwAutoFmtOptionsPage>::Create(pParent, *rAttrSet);
}
bool OfaSwAutoFmtOptionsPage::FillItemSet( SfxItemSet* )
@@ -1906,8 +1906,7 @@ void OfaQuoteTabPage::dispose()
VclPtr<SfxTabPage> OfaQuoteTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet)
{
- return VclPtr<SfxTabPage>( new OfaQuoteTabPage(pParent, *rAttrSet),
- SAL_NO_ACQUIRE );
+ return VclPtr<OfaQuoteTabPage>::Create(pParent, *rAttrSet);
}
bool OfaQuoteTabPage::FillItemSet( SfxItemSet* )
@@ -2247,7 +2246,7 @@ void OfaAutoCompleteTabPage::dispose()
VclPtr<SfxTabPage> OfaAutoCompleteTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>( new OfaAutoCompleteTabPage( pParent, *rSet ), SAL_NO_ACQUIRE );
+ return VclPtr<OfaAutoCompleteTabPage>::Create( pParent, *rSet );
}
bool OfaAutoCompleteTabPage::FillItemSet( SfxItemSet* )
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 8c5703cd6241..9ba70fa9758f 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -482,7 +482,7 @@ void SvxBackgroundTabPage::dispose()
VclPtr<SfxTabPage> SvxBackgroundTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>( new SvxBackgroundTabPage( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
+ return VclPtr<SvxBackgroundTabPage>::Create( pParent, *rAttrSet );
}
void SvxBackgroundTabPage::Reset( const SfxItemSet* rSet )
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 01881fe816d4..3daf13fb0317 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -372,8 +372,7 @@ void SvxBorderTabPage::dispose()
VclPtr<SfxTabPage> SvxBorderTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>(new SvxBorderTabPage( pParent, *rAttrSet ),
- SAL_NO_ACQUIRE);
+ return VclPtr<SvxBorderTabPage>::Create( pParent, *rAttrSet );
}
void SvxBorderTabPage::ResetFrameLine_Impl( svx::FrameBorderType eBorder, const SvxBorderLine* pCoreLine, bool bValid )
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index ec30ed37a87e..dc1e7ef5de17 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1220,8 +1220,7 @@ SfxTabPage::sfxpg SvxCharNamePage::DeactivatePage( SfxItemSet* _pSet )
VclPtr<SfxTabPage> SvxCharNamePage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>( new SvxCharNamePage( pParent, *rSet ),
- SAL_NO_ACQUIRE );
+ return VclPtr<SvxCharNamePage>::Create( pParent, *rSet );
}
@@ -1786,8 +1785,7 @@ SfxTabPage::sfxpg SvxCharEffectsPage::DeactivatePage( SfxItemSet* _pSet )
VclPtr<SfxTabPage> SvxCharEffectsPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>( new SvxCharEffectsPage( pParent, *rSet ),
- SAL_NO_ACQUIRE );
+ return VclPtr<SvxCharEffectsPage>::Create( pParent, *rSet );
}
@@ -2977,8 +2975,7 @@ SfxTabPage::sfxpg SvxCharPositionPage::DeactivatePage( SfxItemSet* _pSet )
VclPtr<SfxTabPage> SvxCharPositionPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>( new SvxCharPositionPage( pParent, *rSet ),
- SAL_NO_ACQUIRE );
+ return VclPtr<SvxCharPositionPage>::Create( pParent, *rSet );
}
@@ -3550,8 +3547,7 @@ SfxTabPage::sfxpg SvxCharTwoLinesPage::DeactivatePage( SfxItemSet* _pSet )
VclPtr<SfxTabPage> SvxCharTwoLinesPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>( new SvxCharTwoLinesPage( pParent, *rSet ),
- SAL_NO_ACQUIRE );
+ return VclPtr<SvxCharTwoLinesPage>::Create( pParent, *rSet );
}
void SvxCharTwoLinesPage::Reset( const SfxItemSet* rSet )
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 4e4095a60e93..7d24012235e3 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -156,8 +156,7 @@ void SvxGrfCropPage::dispose()
VclPtr<SfxTabPage> SvxGrfCropPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return VclPtr<SfxTabPage>( new SvxGrfCropPage( pParent, *rSet ),
- SAL_NO_ACQUIRE );
+ return VclPtr<SvxGrfCropPage>::Create( pParent, *rSet );
}
void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index 2e90ed844306..cb096cab7018 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -458,7 +458,7 @@ namespace
{
VclPtr<SfxMacroTabPage> CreateSfxMacroTabPage( vcl::Window* pParent, const SfxItemSet& rAttrSet )
{
- return VclPtr<SfxMacroTabPage>( new SfxMacroTabPage( pParent, NULL, rAttrSet ), SAL_NO_ACQUIRE );
+ return VclPtr<SfxMacroTabPage>::Create( pParent, nullptr, rAttrSet );
}
}
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index a8974af76baf..54bcb270b116 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -383,7 +383,7 @@ void SvxNumberFormatTabPage::Init_Impl()
VclPtr<SfxTabPage> SvxNumberFormatTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>( new SvxNumberFormatTabPage( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
+ return VclPtr<SvxNumberFormatTabPage>::Create( pParent, *rAttrSet );
}
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 65c28c798561..7a60414d310f 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -166,7 +166,7 @@ bool IsEqualSize_Impl( const SvxSizeItem* pSize, const Size& rSize )
VclPtr<SfxTabPage> SvxPageDescPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>(new SvxPageDescPage( pParent, *rSet ), SAL_NO_ACQUIRE );
+ return VclPtr<SvxPageDescPage>::Create( pParent, *rSet );
}
SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr ) :
@@ -292,7 +292,7 @@ SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr
}
else
{
- mpDefPrinter = new Printer;
+ mpDefPrinter = VclPtr<Printer>::Create();
mbDelPrinter = true;
}
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index d128a30060b4..111dac960a4b 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -196,7 +196,7 @@ IMPL_LINK_NOARG(SvxStdParagraphTabPage, ELRLoseFocusHdl)
VclPtr<SfxTabPage> SvxStdParagraphTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>( new SvxStdParagraphTabPage( pParent, *rSet ), SAL_NO_ACQUIRE );
+ return VclPtr<SvxStdParagraphTabPage>::Create( pParent, *rSet );
}
bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
@@ -1072,7 +1072,7 @@ SfxTabPage::sfxpg SvxParaAlignTabPage::DeactivatePage( SfxItemSet* _pSet )
VclPtr<SfxTabPage> SvxParaAlignTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>( new SvxParaAlignTabPage(pParent, *rSet), SAL_NO_ACQUIRE );
+ return VclPtr<SvxParaAlignTabPage>::Create(pParent, *rSet);
}
bool SvxParaAlignTabPage::FillItemSet( SfxItemSet* rOutSet )
@@ -1346,7 +1346,7 @@ void SvxParaAlignTabPage::PageCreated (const SfxAllItemSet& aSet)
VclPtr<SfxTabPage> SvxExtParagraphTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>( new SvxExtParagraphTabPage( pParent, *rSet ), SAL_NO_ACQUIRE );
+ return VclPtr<SvxExtParagraphTabPage>::Create( pParent, *rSet );
}
bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
@@ -2193,7 +2193,7 @@ void SvxAsianTabPage::dispose()
VclPtr<SfxTabPage> SvxAsianTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>(new SvxAsianTabPage(pParent, *rSet), SAL_NO_ACQUIRE );
+ return VclPtr<SvxAsianTabPage>::Create(pParent, *rSet);
}
const sal_uInt16* SvxAsianTabPage::GetRanges()
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index 6bef88304734..87c493b43901 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -265,7 +265,7 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet)
VclPtr<SfxTabPage> SvxTabulatorTabPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>(new SvxTabulatorTabPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SvxTabulatorTabPage>::Create(pParent, *rSet);
}
void SvxTabulatorTabPage::Reset(const SfxItemSet* rSet)
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 6319c4d47752..94231c5f0f32 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -723,7 +723,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl)
if( !pWarnBox )
{
- pWarnBox.reset(new MessageDialog( GetParentDialog()
+ pWarnBox.reset(VclPtr<MessageDialog>::Create( GetParentDialog()
,"DuplicateNameDialog"
,"cui/ui/queryduplicatedialog.ui"));
}
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index c3dc8ef4a089..bdb662dd57ad 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -193,7 +193,7 @@ OAppDetailPageHelper::OAppDetailPageHelper(vcl::Window* _pParent,OAppBorderWindo
,m_aTBPreview(VclPtr<ToolBox>::Create(this,WB_TABSTOP) )
,m_aBorder(VclPtr<Window>::Create(this,WB_BORDER | WB_READONLY))
,m_aPreview(VclPtr<OPreviewWindow>::Create(m_aBorder.get()))
- ,m_aDocumentInfo(new ::svtools::ODocumentInfoPreview(m_aBorder.get(), WB_LEFT | WB_VSCROLL | WB_READONLY) )
+ ,m_aDocumentInfo(VclPtr<::svtools::ODocumentInfoPreview>::Create(m_aBorder.get(), WB_LEFT | WB_VSCROLL | WB_READONLY) )
,m_ePreviewMode(_ePreviewMode)
{
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx
index ed99f813357d..b9c8fba68944 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx
@@ -83,7 +83,7 @@ namespace dbaui
VclPtr<SfxTabPage> OConnectionTabPage::Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return VclPtr<SfxTabPage>(new OConnectionTabPage( pParent, *_rAttrSet ), SAL_NO_ACQUIRE);
+ return VclPtr<OConnectionTabPage>::Create( pParent, *_rAttrSet );
}
// OConnectionTabPage
diff --git a/dbaccess/source/ui/dlg/ConnectionPage.hxx b/dbaccess/source/ui/dlg/ConnectionPage.hxx
index 2b4626d8fa08..6f373cc24426 100644
--- a/dbaccess/source/ui/dlg/ConnectionPage.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionPage.hxx
@@ -34,6 +34,7 @@ namespace dbaui
*/
class OConnectionTabPage : public OConnectionHelper
{
+ friend class VclPtr<OConnectionTabPage>;
protected:
// user authentification
VclPtr<FixedText> m_pFL2;
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
index b081ad82c565..fd82603a2c3d 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx
@@ -65,27 +65,27 @@ namespace dbaui
VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateDbaseTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return VclPtr<OGenericAdministrationPage>( new OConnectionTabPageSetup ( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_DBASE_HELPTEXT, STR_DBASE_HEADERTEXT, STR_DBASE_PATH_OR_FILE), SAL_NO_ACQUIRE );
+ return VclPtr<OConnectionTabPageSetup>::Create ( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_DBASE_HELPTEXT, STR_DBASE_HEADERTEXT, STR_DBASE_PATH_OR_FILE );
}
VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateMSAccessTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return VclPtr<OGenericAdministrationPage>( new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_MSACCESS_HELPTEXT, STR_MSACCESS_HEADERTEXT, STR_MSACCESS_MDB_FILE), SAL_NO_ACQUIRE );
+ return VclPtr<OConnectionTabPageSetup>::Create( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_MSACCESS_HELPTEXT, STR_MSACCESS_HEADERTEXT, STR_MSACCESS_MDB_FILE );
}
VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateADOTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return VclPtr<OGenericAdministrationPage>( new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ADO_HELPTEXT, STR_ADO_HEADERTEXT, STR_COMMONURL), SAL_NO_ACQUIRE );
+ return VclPtr<OConnectionTabPageSetup>::Create( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ADO_HELPTEXT, STR_ADO_HEADERTEXT, STR_COMMONURL );
}
VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateODBCTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return VclPtr<OGenericAdministrationPage>( new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ODBC_HELPTEXT, STR_ODBC_HEADERTEXT, STR_NAME_OF_ODBC_DATASOURCE), SAL_NO_ACQUIRE );
+ return VclPtr<OConnectionTabPageSetup>::Create( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, STR_ODBC_HELPTEXT, STR_ODBC_HEADERTEXT, STR_NAME_OF_ODBC_DATASOURCE );
}
VclPtr<OGenericAdministrationPage> OConnectionTabPageSetup::CreateUserDefinedTabPage( vcl::Window* pParent, const SfxItemSet& _rAttrSet )
{
- return VclPtr<OGenericAdministrationPage>( new OConnectionTabPageSetup( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, USHRT_MAX, USHRT_MAX, STR_COMMONURL), SAL_NO_ACQUIRE );
+ return VclPtr<OConnectionTabPageSetup>::Create( pParent, "ConnectionPage", "dbaccess/ui/dbwizconnectionpage.ui", _rAttrSet, USHRT_MAX, USHRT_MAX, STR_COMMONURL );
}
OConnectionTabPageSetup::OConnectionTabPageSetup(vcl::Window* pParent, const OString& _rId, const OUString& _rUIXMLDescription, const SfxItemSet& _rCoreAttrs, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderResId, sal_uInt16 _nUrlResId)
diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
index 1f0a22c69cf4..cad08bcff1e2 100644
--- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
+++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx
@@ -36,6 +36,7 @@ namespace dbaui
*/
class OConnectionTabPageSetup : public OConnectionHelper
{
+ friend class VclPtr<OConnectionTabPageSetup>;
bool m_bUserGrabFocus : 1;
protected:
diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx
index ee25dd304bb1..5e9afea0f7ea 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.cxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.cxx
@@ -204,7 +204,7 @@ void OUserAdmin::FillUserNames()
VclPtr<SfxTabPage> OUserAdmin::Create( vcl::Window* pParent, const SfxItemSet* _rAttrSet )
{
- return VclPtr<SfxTabPage>(new OUserAdmin( pParent, *_rAttrSet ), SAL_NO_ACQUIRE);
+ return VclPtr<OUserAdmin>::Create( pParent, *_rAttrSet );
}
IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton )
diff --git a/dbaccess/source/ui/dlg/UserAdmin.hxx b/dbaccess/source/ui/dlg/UserAdmin.hxx
index eeea260a60ee..f08b43f4dfa2 100644
--- a/dbaccess/source/ui/dlg/UserAdmin.hxx
+++ b/dbaccess/source/ui/dlg/UserAdmin.hxx
@@ -40,6 +40,7 @@ namespace dbaui
class OUserAdmin : public OGenericAdministrationPage
{
+ friend class VclPtr<OUserAdmin>;
protected:
VclPtr<ListBox> m_pUSER;
VclPtr<PushButton> m_pNEWUSER;
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 3b85887911a2..e7b2088f66c2 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -1058,7 +1058,7 @@ void OQueryController::impl_initialize()
m_bGraphicalDesign = false;
getContainer()->initialize();
ODataView* pWindow = getView();
- OSQLMessageBox(pWindow,e).Execute();
+ ScopedVclPtr<OSQLMessageBox>::Create(pWindow,e)->Execute();
}
throw;
}
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index 63c8232a321e..d0378ad58454 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -155,7 +155,7 @@ void SplashScreenWindow::Redraw()
}
SplashScreen::SplashScreen()
- : pWindow( new SplashScreenWindow (this) )
+ : pWindow( VclPtr<SplashScreenWindow>::Create(this) )
, _cProgressFrameColor(sal::static_int_cast< ColorData >(NOT_LOADED))
, _cProgressBarColor(sal::static_int_cast< ColorData >(NOT_LOADED))
, _cProgressTextColor(sal::static_int_cast< ColorData >(NOT_LOADED))
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index bee83d8f3869..db810db9b134 100644
--- a/extensions/source/bibliography/bibload.cxx
+++ b/extensions/source/bibliography/bibload.cxx
@@ -276,11 +276,11 @@ void BibliographyLoader::loadView(const Reference< XFrame > & rFrame, const OUSt
VclPtrInstance<BibBookContainer> pMyWindow( pParent );
pMyWindow->Show();
- ::bib::BibView* pView = new ::bib::BibView( pMyWindow, m_pDatMan, WB_VSCROLL | WB_HSCROLL | WB_3DLOOK );
+ VclPtrInstance<::bib::BibView> pView( pMyWindow, m_pDatMan, WB_VSCROLL | WB_HSCROLL | WB_3DLOOK );
pView->Show();
m_pDatMan->SetView( pView );
- ::bib::BibBeamer* pBeamer = new ::bib::BibBeamer( pMyWindow, m_pDatMan );
+ VclPtrInstance<::bib::BibBeamer> pBeamer( pMyWindow, m_pDatMan );
pBeamer->Show();
pMyWindow->createTopFrame(pBeamer);
diff --git a/framework/source/services/tabwindowservice.cxx b/framework/source/services/tabwindowservice.cxx
index f93aee07ed9a..2f8bd08b631f 100644
--- a/framework/source/services/tabwindowservice.cxx
+++ b/framework/source/services/tabwindowservice.cxx
@@ -521,7 +521,7 @@ FwkTabWindow* TabWindowService::mem_TabWin ()
{
vcl::Window* pFakeParent = dynamic_cast< vcl::Window* >(Application::GetDefaultDevice ());
- m_pTabWin = new FwkTabWindow (pFakeParent);
+ m_pTabWin = VclPtr<FwkTabWindow>::Create(pFakeParent);
m_xTabWin = VCLUnoHelper::GetInterface (m_pTabWin);
m_pTabWin->AddEventListener( LINK( this, TabWindowService, EventListener ) );
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 813999a794b0..fc9eb56faa6a 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -731,7 +731,7 @@ private:
short get_response(const vcl::Window *pWindow) const;
void create_owned_areas();
- friend class VclBuilder;
+ friend class VclPtr<MessageDialog>;
MessageDialog(vcl::Window* pParent, WinBits nStyle = WB_MOVEABLE | WB_3DLOOK | WB_CLOSEABLE);
public:
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 3dfbf8a3b663..d74f344b1f02 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1172,9 +1172,9 @@ namespace {
sal_Int32 getColumnWidth(UnitConverter& rConverter, double nWidth)
{
double nCoeff = rConverter.getCoefficient(UNIT_DIGIT);
- VirtualDevice aDev;
+ ScopedVclPtrInstance<VirtualDevice> aDev;
- long nPixel = aDev.LogicToPixel(Point(nCoeff, 0), MapMode(MAP_100TH_MM)).getX();
+ long nPixel = aDev->LogicToPixel(Point(nCoeff, 0), MapMode(MAP_100TH_MM)).getX();
// the 1.047 has been experimentally chosen based on measurements witha screen ruler
@@ -1182,7 +1182,7 @@ sal_Int32 getColumnWidth(UnitConverter& rConverter, double nWidth)
// algorithm from OOXML spec part1: 18.3.1.13
sal_Int32 nColWidthPixel= std::floor(((256*nWidth + std::floor(128.0/nPixel))/256.0)*nPixel) * 1.047;
- return aDev.PixelToLogic(Point(nColWidthPixel, 0), MapMode(MAP_100TH_MM)).getX();
+ return aDev->PixelToLogic(Point(nColWidthPixel, 0), MapMode(MAP_100TH_MM)).getX();
}
}
diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx
index 163b8742fc4c..d75a976303a9 100644
--- a/sc/source/ui/attrdlg/tabpages.cxx
+++ b/sc/source/ui/attrdlg/tabpages.cxx
@@ -75,7 +75,7 @@ void ScTabPageProtection::dispose()
VclPtr<SfxTabPage> ScTabPageProtection::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>( new ScTabPageProtection( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScTabPageProtection>::Create( pParent, *rAttrSet );
}
void ScTabPageProtection::Reset( const SfxItemSet* rCoreAttrs )
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 470a0b8f5782..98ba5335957c 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -873,7 +873,7 @@ void ScCheckListMenuWindow::CancelButton::Click()
ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc) :
ScMenuFloatingWindow(pParent, pDoc),
- maEdSearch(new Edit (this)),
+ maEdSearch(VclPtr<Edit>::Create(this)),
maChecks(VclPtr<ScCheckListBox>::Create(this, WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT) ),
maChkToggleAll(VclPtr<TriStateBox>::Create(this, 0)),
maBtnSelectSingle(VclPtr<ImageButton>::Create(this, 0)),
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index c41bbc1a07ca..e36c39f1e963 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -387,15 +387,21 @@ IMPL_LINK( ScTpSubTotalGroup, CheckHdl, void *, pLb )
VclPtr<SfxTabPage> ScTpSubTotalGroup1::Create( vcl::Window* pParent,
const SfxItemSet* rArgSet )
- { return VclPtr<SfxTabPage>( new ScTpSubTotalGroup1( pParent, *rArgSet ), SAL_NO_ACQUIRE ); }
+{
+ return VclPtr<ScTpSubTotalGroup1>::Create( pParent, *rArgSet );
+}
VclPtr<SfxTabPage> ScTpSubTotalGroup2::Create( vcl::Window* pParent,
const SfxItemSet* rArgSet )
- { return VclPtr<SfxTabPage>( new ScTpSubTotalGroup2( pParent, *rArgSet ), SAL_NO_ACQUIRE ); }
+{
+ return VclPtr<ScTpSubTotalGroup2>::Create( pParent, *rArgSet );
+}
VclPtr<SfxTabPage> ScTpSubTotalGroup3::Create( vcl::Window* pParent,
const SfxItemSet* rArgSet )
- { return VclPtr<SfxTabPage>( new ScTpSubTotalGroup3( pParent, *rArgSet ), SAL_NO_ACQUIRE ); }
+{
+ return VclPtr<ScTpSubTotalGroup3>::Create( pParent, *rArgSet );
+}
ScTpSubTotalGroup1::ScTpSubTotalGroup1( vcl::Window* pParent, const SfxItemSet& rArgSet ) :
ScTpSubTotalGroup( pParent, rArgSet )
@@ -487,7 +493,7 @@ void ScTpSubTotalOptions::Init()
VclPtr<SfxTabPage> ScTpSubTotalOptions::Create( vcl::Window* pParent,
const SfxItemSet* rArgSet )
{
- return VclPtr<SfxTabPage>( new ScTpSubTotalOptions( pParent, *rArgSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScTpSubTotalOptions>::Create( pParent, *rArgSet );
}
void ScTpSubTotalOptions::Reset( const SfxItemSet* /* rArgSet */ )
diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index 54edca1eed8a..23fb0f8df0ee 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -407,7 +407,7 @@ void ScTPValidationValue::Init()
VclPtr<SfxTabPage> ScTPValidationValue::Create( vcl::Window* pParent, const SfxItemSet* rArgSet )
{
- return VclPtr<SfxTabPage>(new ScTPValidationValue( pParent, *rArgSet ), SAL_NO_ACQUIRE);
+ return VclPtr<ScTPValidationValue>::Create( pParent, *rArgSet );
}
void ScTPValidationValue::Reset( const SfxItemSet* rArgSet )
diff --git a/sc/source/ui/docshell/tpstat.cxx b/sc/source/ui/docshell/tpstat.cxx
index 7aca08e43042..729af3bd6357 100644
--- a/sc/source/ui/docshell/tpstat.cxx
+++ b/sc/source/ui/docshell/tpstat.cxx
@@ -29,7 +29,7 @@
VclPtr<SfxTabPage> ScDocStatPage::Create( vcl::Window *pParent, const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>( new ScDocStatPage ( pParent, *rSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScDocStatPage>::Create( pParent, *rSet );
}
ScDocStatPage::ScDocStatPage( vcl::Window *pParent, const SfxItemSet& rSet )
diff --git a/sc/source/ui/inc/scuitphfedit.hxx b/sc/source/ui/inc/scuitphfedit.hxx
index c22ec2510525..3fddc293ddad 100644
--- a/sc/source/ui/inc/scuitphfedit.hxx
+++ b/sc/source/ui/inc/scuitphfedit.hxx
@@ -104,6 +104,7 @@ private:
class ScRightHeaderEditPage : public ScHFEditPage
{
+ friend class VclPtr<ScRightHeaderEditPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
@@ -113,6 +114,7 @@ private:
class ScLeftHeaderEditPage : public ScHFEditPage
{
+ friend class VclPtr<ScLeftHeaderEditPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
@@ -122,6 +124,7 @@ private:
class ScRightFooterEditPage : public ScHFEditPage
{
+ friend class VclPtr<ScRightFooterEditPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
@@ -131,6 +134,7 @@ private:
class ScLeftFooterEditPage : public ScHFEditPage
{
+ friend class VclPtr<ScLeftFooterEditPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rCoreSet );
diff --git a/sc/source/ui/inc/tabpages.hxx b/sc/source/ui/inc/tabpages.hxx
index c2f9c38d1e66..b2c20142ac37 100644
--- a/sc/source/ui/inc/tabpages.hxx
+++ b/sc/source/ui/inc/tabpages.hxx
@@ -26,6 +26,7 @@
class ScTabPageProtection : public SfxTabPage
{
+ friend class VclPtr<ScTabPageProtection>;
static const sal_uInt16 pProtectionRanges[];
public:
static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx
index 25bd390fed20..0b27e75b27b6 100644
--- a/sc/source/ui/inc/tpcalc.hxx
+++ b/sc/source/ui/inc/tpcalc.hxx
@@ -31,6 +31,7 @@ class ScDocOptions;
class ScTpCalcOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpCalcOptions>;
public:
static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rCoreSet );
diff --git a/sc/source/ui/inc/tpcompatibility.hxx b/sc/source/ui/inc/tpcompatibility.hxx
index 550bd9b0836c..322e50d003bb 100644
--- a/sc/source/ui/inc/tpcompatibility.hxx
+++ b/sc/source/ui/inc/tpcompatibility.hxx
@@ -16,6 +16,7 @@
class ScTpCompatOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpCompatOptions>;
public:
using SfxTabPage::DeactivatePage;
diff --git a/sc/source/ui/inc/tpdefaults.hxx b/sc/source/ui/inc/tpdefaults.hxx
index 429cbabde87f..deb267368baa 100644
--- a/sc/source/ui/inc/tpdefaults.hxx
+++ b/sc/source/ui/inc/tpdefaults.hxx
@@ -16,6 +16,7 @@
class ScTpDefaultsOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpDefaultsOptions>;
public:
using SfxTabPage::DeactivatePage;
diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index 7397d062d31d..a3175b8ee1fd 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -30,6 +30,7 @@
class ScTpFormulaOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpFormulaOptions>;
public:
using SfxTabPage::DeactivatePage;
diff --git a/sc/source/ui/inc/tphf.hxx b/sc/source/ui/inc/tphf.hxx
index da972cbd44a9..9f5c8a599a23 100644
--- a/sc/source/ui/inc/tphf.hxx
+++ b/sc/source/ui/inc/tphf.hxx
@@ -60,6 +60,7 @@ private:
class ScHeaderPage : public ScHFPage
{
+ friend class VclPtr<ScHeaderPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
@@ -70,6 +71,7 @@ private:
class ScFooterPage : public ScHFPage
{
+ friend class VclPtr<ScFooterPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
static const sal_uInt16* GetRanges();
diff --git a/sc/source/ui/inc/tpprint.hxx b/sc/source/ui/inc/tpprint.hxx
index 5b8370f13267..bf38a927c3b6 100644
--- a/sc/source/ui/inc/tpprint.hxx
+++ b/sc/source/ui/inc/tpprint.hxx
@@ -25,6 +25,7 @@
class ScTpPrintOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpPrintOptions>;
VclPtr<CheckBox> m_pSkipEmptyPagesCB;
VclPtr<CheckBox> m_pSelectedSheetsCB;
VclPtr<CheckBox> m_pForceBreaksCB;
diff --git a/sc/source/ui/inc/tpstat.hxx b/sc/source/ui/inc/tpstat.hxx
index a5cbdf7a925e..5bcdd6c7aca1 100644
--- a/sc/source/ui/inc/tpstat.hxx
+++ b/sc/source/ui/inc/tpstat.hxx
@@ -26,6 +26,7 @@
class ScDocStatPage: public SfxTabPage
{
+ friend class VclPtr<ScDocStatPage>;
public:
static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
virtual ~ScDocStatPage();
diff --git a/sc/source/ui/inc/tpsubt.hxx b/sc/source/ui/inc/tpsubt.hxx
index a54536c11f79..3295262e33b2 100644
--- a/sc/source/ui/inc/tpsubt.hxx
+++ b/sc/source/ui/inc/tpsubt.hxx
@@ -76,6 +76,7 @@ private:
class ScTpSubTotalGroup1 : public ScTpSubTotalGroup
{
+ friend class VclPtr<ScTpSubTotalGroup1>;
protected:
ScTpSubTotalGroup1( vcl::Window* pParent,
const SfxItemSet& rArgSet );
@@ -91,6 +92,7 @@ public:
class ScTpSubTotalGroup2 : public ScTpSubTotalGroup
{
+ friend class VclPtr<ScTpSubTotalGroup2>;
protected:
ScTpSubTotalGroup2( vcl::Window* pParent,
const SfxItemSet& rArgSet );
@@ -106,6 +108,7 @@ public:
class ScTpSubTotalGroup3 : public ScTpSubTotalGroup
{
+ friend class VclPtr<ScTpSubTotalGroup3>;
protected:
ScTpSubTotalGroup3( vcl::Window* pParent,
const SfxItemSet& rArgSet );
@@ -121,6 +124,7 @@ public:
class ScTpSubTotalOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpSubTotalOptions>;
protected:
ScTpSubTotalOptions( vcl::Window* pParent,
const SfxItemSet& rArgSet );
diff --git a/sc/source/ui/inc/tptable.hxx b/sc/source/ui/inc/tptable.hxx
index e135c91ea4ef..46042b854896 100644
--- a/sc/source/ui/inc/tptable.hxx
+++ b/sc/source/ui/inc/tptable.hxx
@@ -27,6 +27,7 @@
class ScTablePage : public SfxTabPage
{
+ friend class VclPtr<ScTablePage>;
static const sal_uInt16 pPageTableRanges[];
public:
static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
diff --git a/sc/source/ui/inc/tpusrlst.hxx b/sc/source/ui/inc/tpusrlst.hxx
index a0c8663df0d9..2a4c28ffc77f 100644
--- a/sc/source/ui/inc/tpusrlst.hxx
+++ b/sc/source/ui/inc/tpusrlst.hxx
@@ -32,6 +32,7 @@ class ScRangeUtil;
class ScTpUserLists : public SfxTabPage
{
+ friend class VclPtr<ScTpUserLists>;
public:
static VclPtr<SfxTabPage> Create ( vcl::Window* pParent,
const SfxItemSet* rAttrSet );
diff --git a/sc/source/ui/inc/tpview.hxx b/sc/source/ui/inc/tpview.hxx
index f31c850a5eb7..baece6cffd4a 100644
--- a/sc/source/ui/inc/tpview.hxx
+++ b/sc/source/ui/inc/tpview.hxx
@@ -31,6 +31,7 @@ class ScViewOptions;
class ScTpContentOptions : public SfxTabPage
{
+ friend class VclPtr<ScTpContentOptions>;
VclPtr<ListBox> pGridLB;
VclPtr<FixedText> pColorFT;
VclPtr<ColorListBox> pColorLB;
@@ -84,6 +85,7 @@ public:
class ScDocument;
class ScTpLayoutOptions : public SfxTabPage
{
+ friend class VclPtrInstance<ScTpLayoutOptions>;
VclPtr<ListBox> m_pUnitLB;
VclPtr<MetricField> m_pTabMF;
diff --git a/sc/source/ui/miscdlgs/filldlg.cxx b/sc/source/ui/miscdlgs/filldlg.cxx
index 4a0113d85e7d..73244b6304e8 100644
--- a/sc/source/ui/miscdlgs/filldlg.cxx
+++ b/sc/source/ui/miscdlgs/filldlg.cxx
@@ -325,9 +325,7 @@ IMPL_LINK_NOARG(ScFillSeriesDlg, OKHdl)
EndDialog( RET_OK );
else
{
- MessageDialog(this,
- aErrMsgInvalidVal
- ).Execute();
+ ScopedVclPtr<MessageDialog>::Create(this, aErrMsgInvalidVal)->Execute();
pEdWrong->GrabFocus();
}
diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx
index 773169d21ef6..6f7fa2ec74fa 100644
--- a/sc/source/ui/miscdlgs/scuiautofmt.cxx
+++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx
@@ -266,11 +266,11 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl)
if ( !bFmtInserted )
{
- sal_uInt16 nRet = MessageDialog(this,
+ sal_uInt16 nRet = ScopedVclPtr<MessageDialog>::Create(this,
ScGlobal::GetRscString(STR_INVALID_AFNAME),
VCL_MESSAGE_ERROR,
VCL_BUTTONS_OK_CANCEL
- ).Execute();
+ )->Execute();
bOk = ( nRet == RET_CANCEL );
}
@@ -390,11 +390,11 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl)
}
if( !bFmtRenamed )
{
- bOk = RET_CANCEL == MessageDialog( this,
- ScGlobal::GetRscString(STR_INVALID_AFNAME),
- VCL_MESSAGE_ERROR,
- VCL_BUTTONS_OK_CANCEL
- ).Execute();
+ bOk = RET_CANCEL == ScopedVclPtr<MessageDialog>::Create( this,
+ ScGlobal::GetRscString(STR_INVALID_AFNAME),
+ VCL_MESSAGE_ERROR,
+ VCL_BUTTONS_OK_CANCEL
+ )->Execute();
}
}
else
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 74cbf8878709..a3fad625889e 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -103,7 +103,7 @@ void ScTpCalcOptions::Init()
VclPtr<SfxTabPage> ScTpCalcOptions::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>( new ScTpCalcOptions ( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScTpCalcOptions>::Create( pParent, *rAttrSet );
}
void ScTpCalcOptions::Reset( const SfxItemSet* /* rCoreAttrs */ )
@@ -192,9 +192,9 @@ SfxTabPage::sfxpg ScTpCalcOptions::DeactivatePage( SfxItemSet* pSetP )
if ( nReturn == KEEP_PAGE )
{
- MessageDialog( this,
+ ScopedVclPtr<MessageDialog>::Create( this,
ScGlobal::GetRscString( STR_INVALID_EPS )
- ).Execute();
+ )->Execute();
m_pEdEps->GrabFocus();
}
diff --git a/sc/source/ui/optdlg/tpcompatibility.cxx b/sc/source/ui/optdlg/tpcompatibility.cxx
index ca828292c7db..3c83b980b7aa 100644
--- a/sc/source/ui/optdlg/tpcompatibility.cxx
+++ b/sc/source/ui/optdlg/tpcompatibility.cxx
@@ -34,7 +34,7 @@ void ScTpCompatOptions::dispose()
VclPtr<SfxTabPage> ScTpCompatOptions::Create(vcl::Window *pParent, const SfxItemSet *rCoreAttrs)
{
- return VclPtr<SfxTabPage>(new ScTpCompatOptions(pParent, *rCoreAttrs), SAL_NO_ACQUIRE);
+ return VclPtr<ScTpCompatOptions>::Create(pParent, *rCoreAttrs);
}
bool ScTpCompatOptions::FillItemSet(SfxItemSet *rCoreAttrs)
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx
index 79b8475a5145..a2929f77eb3a 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -42,7 +42,7 @@ void ScTpDefaultsOptions::dispose()
VclPtr<SfxTabPage> ScTpDefaultsOptions::Create(vcl::Window *pParent, const SfxItemSet *rCoreAttrs)
{
- return VclPtr<SfxTabPage>(new ScTpDefaultsOptions(pParent, *rCoreAttrs), SAL_NO_ACQUIRE);
+ return VclPtr<ScTpDefaultsOptions>::Create(pParent, *rCoreAttrs);
}
bool ScTpDefaultsOptions::FillItemSet(SfxItemSet *rCoreSet)
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index 3e7feb1ff2f8..2e4643e5d055 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -239,7 +239,7 @@ IMPL_LINK( ScTpFormulaOptions, SepEditOnFocusHdl, Edit*, pEdit )
VclPtr<SfxTabPage> ScTpFormulaOptions::Create(vcl::Window* pParent, const SfxItemSet* rCoreSet)
{
- return VclPtr<SfxTabPage>(new ScTpFormulaOptions(pParent, *rCoreSet), SAL_NO_ACQUIRE);
+ return VclPtr<ScTpFormulaOptions>::Create(pParent, *rCoreSet);
}
bool ScTpFormulaOptions::FillItemSet(SfxItemSet* rCoreSet)
diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx
index e38c830431d0..6ee0b8945925 100644
--- a/sc/source/ui/optdlg/tpprint.cxx
+++ b/sc/source/ui/optdlg/tpprint.cxx
@@ -54,7 +54,7 @@ void ScTpPrintOptions::dispose()
VclPtr<SfxTabPage> ScTpPrintOptions::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>(new ScTpPrintOptions( pParent, *rAttrSet ), SAL_NO_ACQUIRE);
+ return VclPtr<ScTpPrintOptions>::Create( pParent, *rAttrSet );
}
SfxTabPage::sfxpg ScTpPrintOptions::DeactivatePage( SfxItemSet* pSetP )
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 0815c1322b51..37a0aadbadc8 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -155,7 +155,7 @@ void ScTpUserLists::Init()
VclPtr<SfxTabPage> ScTpUserLists::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>( new ScTpUserLists( pParent, *rAttrSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScTpUserLists>::Create( pParent, *rAttrSet );
}
void ScTpUserLists::Reset( const SfxItemSet* rCoreAttrs )
@@ -361,7 +361,7 @@ void ScTpUserLists::CopyListFromArea( const ScRefAddress& rStartPos,
if ( (nStartCol != nEndCol) && (nStartRow != nEndRow) )
{
- nCellDir = ScColOrRowDlg( this, aStrCopyList, aStrCopyFrom ).Execute();
+ nCellDir = ScopedVclPtr<ScColOrRowDlg>::Create( this, aStrCopyList, aStrCopyFrom )->Execute();
}
else if ( nStartCol != nEndCol )
nCellDir = SCRET_ROWS;
@@ -701,9 +701,9 @@ IMPL_LINK( ScTpUserLists, BtnClickHdl, PushButton*, pBtn )
}
else
{
- MessageDialog(this,
+ ScopedVclPtr<MessageDialog>::Create(this,
ScGlobal::GetRscString( STR_INVALID_TABREF )
- ).Execute();
+ )->Execute();
mpEdCopyFrom->GrabFocus();
mpEdCopyFrom->SetSelection( Selection( 0, SELECTION_MAX ) );
}
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index c1d533417e13..d6edcb137c7b 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -128,7 +128,7 @@ void ScTpContentOptions::dispose()
VclPtr<SfxTabPage> ScTpContentOptions::Create( vcl::Window* pParent,
const SfxItemSet* rCoreSet )
{
- return VclPtr<SfxTabPage>( new ScTpContentOptions (pParent, *rCoreSet), SAL_NO_ACQUIRE );
+ return VclPtr<ScTpContentOptions>::Create(pParent, *rCoreSet);
}
bool ScTpContentOptions::FillItemSet( SfxItemSet* rCoreSet )
@@ -460,7 +460,7 @@ void ScTpLayoutOptions::dispose()
VclPtr<SfxTabPage> ScTpLayoutOptions::Create( vcl::Window* pParent,
const SfxItemSet* rCoreSet )
{
- VclPtr<ScTpLayoutOptions> pNew( new ScTpLayoutOptions( pParent, *rCoreSet), SAL_NO_ACQUIRE );
+ VclPtrInstance<ScTpLayoutOptions> pNew( pParent, *rCoreSet );
ScDocShell* pDocSh = PTR_CAST(ScDocShell,SfxObjectShell::Current());
if(pDocSh!=NULL)
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 59b24a048f82..1a14789a8b4c 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -867,7 +867,9 @@ ScRightHeaderEditPage::ScRightHeaderEditPage( vcl::Window* pParent, const SfxIte
{}
VclPtr<SfxTabPage> ScRightHeaderEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return VclPtr<SfxTabPage>( new ScRightHeaderEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); }
+{
+ return VclPtr<ScRightHeaderEditPage>::Create( pParent, *rCoreSet );
+}
// class ScLeftHeaderEditPage
@@ -879,7 +881,9 @@ ScLeftHeaderEditPage::ScLeftHeaderEditPage( vcl::Window* pParent, const SfxItemS
{}
VclPtr<SfxTabPage> ScLeftHeaderEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return VclPtr<SfxTabPage>( new ScLeftHeaderEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); };
+{
+ return VclPtr<ScLeftHeaderEditPage>::Create( pParent, *rCoreSet );
+}
// class ScRightFooterEditPage
@@ -891,7 +895,9 @@ ScRightFooterEditPage::ScRightFooterEditPage( vcl::Window* pParent, const SfxIte
{}
VclPtr<SfxTabPage> ScRightFooterEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return VclPtr<SfxTabPage>( new ScRightFooterEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); };
+{
+ return VclPtr<ScRightFooterEditPage>::Create( pParent, *rCoreSet );
+}
// class ScLeftFooterEditPage
@@ -903,6 +909,8 @@ ScLeftFooterEditPage::ScLeftFooterEditPage( vcl::Window* pParent, const SfxItemS
{}
VclPtr<SfxTabPage> ScLeftFooterEditPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
- { return VclPtr<SfxTabPage>( new ScLeftFooterEditPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE ); };
+{
+ return VclPtr<ScLeftFooterEditPage>::Create( pParent, *rCoreSet );
+};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index cf1918e2403e..8575607d6e48 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -249,7 +249,7 @@ ScHeaderPage::ScHeaderPage( vcl::Window* pParent, const SfxItemSet& rSet )
VclPtr<SfxTabPage> ScHeaderPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
{
- return VclPtr<SfxTabPage>( new ScHeaderPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScHeaderPage>::Create( pParent, *rCoreSet );
}
const sal_uInt16* ScHeaderPage::GetRanges()
@@ -266,7 +266,7 @@ ScFooterPage::ScFooterPage( vcl::Window* pParent, const SfxItemSet& rSet )
VclPtr<SfxTabPage> ScFooterPage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
{
- return VclPtr<SfxTabPage>( new ScFooterPage( pParent, *rCoreSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScFooterPage>::Create( pParent, *rCoreSet );
}
const sal_uInt16* ScFooterPage::GetRanges()
diff --git a/sc/source/ui/pagedlg/tptable.cxx b/sc/source/ui/pagedlg/tptable.cxx
index 910bc3f4423b..685e288796ed 100644
--- a/sc/source/ui/pagedlg/tptable.cxx
+++ b/sc/source/ui/pagedlg/tptable.cxx
@@ -156,7 +156,7 @@ void ScTablePage::dispose()
VclPtr<SfxTabPage> ScTablePage::Create( vcl::Window* pParent, const SfxItemSet* rCoreSet )
{
- return VclPtr<SfxTabPage>( new ScTablePage( pParent, *rCoreSet ), SAL_NO_ACQUIRE );
+ return VclPtr<ScTablePage>::Create( pParent, *rCoreSet );
}
void ScTablePage::Reset( const SfxItemSet* rCoreSet )
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index 5c7ade47726f..761a4c345910 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -53,7 +53,7 @@ namespace sc { namespace sidebar {
svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateCellLineStylePopupControl(svx::sidebar::PopupContainer* pParent)
{
- return new CellLineStyleControl(pParent, *this);
+ return VclPtr<CellLineStyleControl>::Create(pParent, *this);
}
void CellAppearancePropertyPanel::EndCellLineStylePopupMode()
@@ -66,7 +66,7 @@ void CellAppearancePropertyPanel::EndCellLineStylePopupMode()
svx::sidebar::PopupControl* CellAppearancePropertyPanel::CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer* pParent)
{
- return new CellBorderStyleControl(pParent, *this);
+ return VclPtr<CellBorderStyleControl>::Create(pParent, *this);
}
void CellAppearancePropertyPanel::EndCellBorderStylePopupMode()
diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx b/sc/source/ui/sidebar/ScPanelFactory.cxx
index 00e8eb14d454..7857685aa1c2 100644
--- a/sc/source/ui/sidebar/ScPanelFactory.cxx
+++ b/sc/source/ui/sidebar/ScPanelFactory.cxx
@@ -94,12 +94,12 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
else if (rsResourceURL.endsWith("/NavigatorPanel"))
{
- pPanel = VclPtr<vcl::Window>(new ScNavigatorDlg(pBindings, NULL, pParentWindow, false), SAL_NO_ACQUIRE);
+ pPanel = VclPtr<ScNavigatorDlg>::Create(pBindings, nullptr, pParentWindow, false);
nMinimumSize = 0;
}
else if (rsResourceURL.endsWith("/FunctionsPanel"))
{
- pPanel = VclPtr<vcl::Window>(new ScFunctionDockWin(pBindings, NULL, pParentWindow, ScResId(FID_FUNCTION_BOX)), SAL_NO_ACQUIRE);;
+ pPanel = VclPtr<ScFunctionDockWin>::Create(pBindings, nullptr, pParentWindow, ScResId(FID_FUNCTION_BOX));
nMinimumSize = 0;
}
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 6c12d034440a..b1b5d7f6a8ed 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -835,8 +835,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
}
}
else
- MessageDialog (pDlgParent,
- ScGlobal::GetRscString(STR_INVALID_AFAREA) ).Execute();
+ ScopedVclPtrInstance<MessageDialog>(pDlgParent,
+ ScGlobal::GetRscString(STR_INVALID_AFAREA) )->Execute();
}
break;
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 29cfc5fe6990..c3ae18dfa9d8 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -412,9 +412,9 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
}
else
{
- nRet = MessageDialog(GetDialogParent(),
+ nRet = ScopedVclPtr<MessageDialog>::Create(GetDialogParent(),
aErrMsg
- ).Execute();
+ )->Execute();
}
}
}
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index ead579c831b8..2da799145ff3 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -378,7 +378,7 @@ VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateBreakDlg(
sal_uLong nSumActionCount,
sal_uLong nObjCount )
{
- return new SdVclAbstractDialog_Impl( new ::sd::BreakDlg( pWindow, pDrView, pShell, nSumActionCount, nObjCount ) );
+ return new SdVclAbstractDialog_Impl( VclPtr<::sd::BreakDlg>::Create( pWindow, pDrView, pShell, nSumActionCount, nObjCount ) );
}
AbstractCopyDlg * SdAbstractDialogFactory_Impl::CreateCopyDlg(
@@ -386,7 +386,7 @@ AbstractCopyDlg * SdAbstractDialogFactory_Impl::CreateCopyDlg(
const rtl::Reference<XColorList> &pColTab,
::sd::View* pView )
{
- return new AbstractCopyDlg_Impl( new ::sd::CopyDlg( pWindow, rInAttrs, pColTab, pView ) );
+ return new AbstractCopyDlg_Impl( VclPtr<::sd::CopyDlg>::Create( pWindow, rInAttrs, pColTab, pView ) );
}
AbstractSdCustomShowDlg * SdAbstractDialogFactory_Impl::CreateSdCustomShowDlg( vcl::Window* pWindow, SdDrawDocument& rDrawDoc )
@@ -436,12 +436,12 @@ AbstractSdInsertPagesObjsDlg * SdAbstractDialogFactory_Impl::CreateSdInsertPages
AbstractMorphDlg * SdAbstractDialogFactory_Impl::CreateMorphDlg( vcl::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2)
{
- return new AbstractMorphDlg_Impl( new ::sd::MorphDlg( pParent, pObj1, pObj2 ) );
+ return new AbstractMorphDlg_Impl( VclPtr<::sd::MorphDlg>::Create( pParent, pObj1, pObj2 ) );
}
SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdOutlineBulletTabDlg( vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView )
{
- return new AbstractBulletDialog_Impl( new ::sd::OutlineBulletDlg( pParent, pAttr, pView ) );
+ return new AbstractBulletDialog_Impl( VclPtr<::sd::OutlineBulletDlg>::Create( pParent, pAttr, pView ) );
}
SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg( vcl::Window* pParent, const SfxItemSet* pAttr )
@@ -457,7 +457,7 @@ AbstractSdStartPresDlg * SdAbstractDialogFactory_Impl::CreateSdStartPresentatio
VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Window* pWindow )
{
- return new SdVclAbstractDialog_Impl( new ::sd::RemoteDialog( pWindow ) );
+ return new SdVclAbstractDialog_Impl( VclPtr<::sd::RemoteDialog>::Create( pWindow ) );
}
SfxAbstractTabDialog * SdAbstractDialogFactory_Impl::CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, const SdResId& DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool )
@@ -514,18 +514,18 @@ CreateTabPage SdAbstractDialogFactory_Impl::GetSdOptionsSnapTabPageCreatorFunc()
VclAbstractDialog* SdAbstractDialogFactory_Impl::CreateMasterLayoutDialog( vcl::Window* pParent,
SdDrawDocument* pDoc, SdPage* pCurrentPage )
{
- return new SdVclAbstractDialog_Impl( new ::sd::MasterLayoutDialog( pParent, pDoc, pCurrentPage ));
+ return new SdVclAbstractDialog_Impl( VclPtr<::sd::MasterLayoutDialog>::Create( pParent, pDoc, pCurrentPage ));
}
AbstractHeaderFooterDialog* SdAbstractDialogFactory_Impl::CreateHeaderFooterDialog( sd::ViewShell* pViewShell,
vcl::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage )
{
- return new AbstractHeaderFooterDialog_Impl( new ::sd::HeaderFooterDialog( pViewShell, pParent, pDoc, pCurrentPage ));
+ return new AbstractHeaderFooterDialog_Impl( VclPtr<::sd::HeaderFooterDialog>::Create( pViewShell, pParent, pDoc, pCurrentPage ));
}
VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateSdPhotoAlbumDialog( vcl::Window* pWindow, SdDrawDocument* pDoc )
{
- return new SdVclAbstractDialog_Impl( new ::sd::SdPhotoAlbumDialog( pWindow, pDoc ) );
+ return new SdVclAbstractDialog_Impl( VclPtr<::sd::SdPhotoAlbumDialog>::Create( pWindow, pDoc ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
index 1ab67e2a63ef..e700df1443ed 100644
--- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
@@ -88,14 +88,12 @@ VclPtr<vcl::Window> AllMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
- VclPtr<MasterPagesSelector> pSelector(
- new AllMasterPagesSelector (
+ VclPtrInstance<AllMasterPagesSelector> pSelector(
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar),
- SAL_NO_ACQUIRE);
+ rxSidebar);
pSelector->LateInit();
pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_ALL);
diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
index 58c958517bd6..e63e00c5b76c 100644
--- a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
@@ -36,6 +36,7 @@ namespace sd { namespace sidebar {
class AllMasterPagesSelector
: public MasterPagesSelector
{
+ friend class VclPtrInstance<AllMasterPagesSelector>;
public:
static VclPtr<vcl::Window> Create (
vcl::Window* pParent,
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
index c9009629c24d..c7729447d130 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
@@ -53,14 +53,12 @@ VclPtr<vcl::Window> CurrentMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
- VclPtr<MasterPagesSelector> pSelector(
- new CurrentMasterPagesSelector (
+ VclPtrInstance<CurrentMasterPagesSelector> pSelector(
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar),
- SAL_NO_ACQUIRE);
+ rxSidebar);
pSelector->LateInit();
pSelector->SetHelpId( HID_SD_TASK_PANE_PREVIEW_CURRENT );
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
index 9443b991654c..b587a3f52aec 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
@@ -34,6 +34,7 @@ class CurrentMasterPagesSelector
: public MasterPagesSelector,
public SfxListener
{
+ friend class VclPtrInstance<CurrentMasterPagesSelector>;
public:
static VclPtr<vcl::Window> Create (
vcl::Window* pParent,
diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx
index 73013aa037a5..3adab6c29a0c 100644
--- a/sd/source/ui/sidebar/PanelFactory.cxx
+++ b/sd/source/ui/sidebar/PanelFactory.cxx
@@ -125,9 +125,9 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
#define EndsWith(s,t) s.endsWithAsciiL(t,strlen(t))
if (EndsWith(rsUIElementResourceURL, gsResourceNameCustomAnimations))
- pControl = VclPtr<vcl::Window>(new CustomAnimationPanel(pParentWindow, *pBase, xFrame), SAL_NO_ACQUIRE);
+ pControl = VclPtr<CustomAnimationPanel>::Create(pParentWindow, *pBase, xFrame);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameLayouts))
- pControl = VclPtr<vcl::Window>(new LayoutMenu(pParentWindow, *pBase, xSidebar), SAL_NO_ACQUIRE);
+ pControl = VclPtr<LayoutMenu>::Create(pParentWindow, *pBase, xSidebar);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameAllMasterPages))
pControl = AllMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameRecentMasterPages))
@@ -135,11 +135,11 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
else if (EndsWith(rsUIElementResourceURL, gsResourceNameUsedMasterPages))
pControl = CurrentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameSlideTransitions))
- pControl = VclPtr<vcl::Window>(new SlideTransitionPanel(pParentWindow, *pBase, xFrame), SAL_NO_ACQUIRE);
+ pControl = VclPtr<SlideTransitionPanel>::Create(pParentWindow, *pBase, xFrame);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameTableDesign))
- pControl = VclPtr<vcl::Window>(new TableDesignPanel(pParentWindow, *pBase), SAL_NO_ACQUIRE);
+ pControl = VclPtr<TableDesignPanel>::Create(pParentWindow, *pBase);
else if (EndsWith(rsUIElementResourceURL, gsResourceNameNavigator))
- pControl = VclPtr<vcl::Window>(new NavigatorWrapper(pParentWindow, *pBase, pBindings), SAL_NO_ACQUIRE);
+ pControl = VclPtr<NavigatorWrapper>::Create(pParentWindow, *pBase, pBindings);
#undef EndsWith
if (!pControl)
diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
index b31e139e22d6..00c7db8ee27f 100644
--- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
@@ -43,14 +43,12 @@ VclPtr<vcl::Window> RecentMasterPagesSelector::Create (
::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
- VclPtr<MasterPagesSelector> pSelector(
- new RecentMasterPagesSelector (
+ VclPtrInstance<RecentMasterPagesSelector> pSelector(
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar),
- SAL_NO_ACQUIRE);
+ rxSidebar);
pSelector->LateInit();
pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_RECENT);
diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
index a7f470317989..2a74f1447ada 100644
--- a/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
@@ -29,6 +29,7 @@ namespace sd { namespace sidebar {
class RecentMasterPagesSelector
: public MasterPagesSelector
{
+ friend class VclPtrInstance<RecentMasterPagesSelector>;
public:
static VclPtr<vcl::Window> Create (
vcl::Window* pParent,
diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx
index beb4deed9ec3..77c412bff0e9 100644
--- a/sfx2/source/appl/openuriexternally.cxx
+++ b/sfx2/source/appl/openuriexternally.cxx
@@ -53,10 +53,10 @@ bool sfx2::openUriExternally(
throw;
}
SolarMutexGuard g;
- MessageDialog(
+ ScopedVclPtrInstance<MessageDialog> eb(
SfxGetpApp()->GetTopWindow(),
- SfxResId(STR_NO_WEBBROWSER_FOUND)).
- Execute();
+ SfxResId(STR_NO_WEBBROWSER_FOUND));
+ eb->Execute();
}
return false;
}
diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx
index d7f822d028a7..2039b5d6104f 100644
--- a/sfx2/source/dialog/taskpane.cxx
+++ b/sfx2/source/dialog/taskpane.cxx
@@ -518,7 +518,7 @@ namespace sfx2
:m_rAntiImpl( i_rAntiImpl )
,m_sModuleIdentifier( lcl_identifyModule( i_rDocumentFrame ) )
,m_xFrame( i_rDocumentFrame )
- ,m_aPanelDeck( new ::svt::ToolPanelDeck(i_rAntiImpl) )
+ ,m_aPanelDeck( VclPtr<::svt::ToolPanelDeck>::Create(i_rAntiImpl) )
{
m_aPanelDeck->Show();
OnResize();
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index a3aef2d2a21a..33579954fe9f 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1463,8 +1463,8 @@ bool SfxStoringHelper::GUIStoreModel( uno::Reference< frame::XModel > xModel,
|| SignatureState::NOTVALIDATED == nDocumentSignatureState
|| SignatureState::PARTIAL_OK == nDocumentSignatureState)
{
- if (MessageDialog(NULL, SfxResId(RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE),
- VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute() != RET_YES)
+ if (ScopedVclPtrInstance<MessageDialog>(nullptr, SfxResId(RID_SVXSTR_XMLSEC_QUERY_LOSINGSIGNATURE),
+ VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)->Execute() != RET_YES)
{
// the user has decided not to store the document
throw task::ErrorCodeIOException(
diff --git a/sfx2/source/sidebar/ControlFactory.cxx b/sfx2/source/sidebar/ControlFactory.cxx
index d8a49b3dd148..1376f9ee9961 100644
--- a/sfx2/source/sidebar/ControlFactory.cxx
+++ b/sfx2/source/sidebar/ControlFactory.cxx
@@ -27,12 +27,12 @@ namespace sfx2 { namespace sidebar {
VclPtr<CheckBox> ControlFactory::CreateMenuButton (vcl::Window* pParentWindow)
{
- return VclPtr<CheckBox>(new MenuButton(pParentWindow), SAL_NO_ACQUIRE);
+ return VclPtr<MenuButton>::Create(pParentWindow);
}
VclPtr<ImageRadioButton> ControlFactory::CreateTabItem (vcl::Window* pParentWindow)
{
- return VclPtr<ImageRadioButton>(new TabItem(pParentWindow), SAL_NO_ACQUIRE);
+ return VclPtr<TabItem>::Create(pParentWindow);
}
} } // end of namespace sfx2::sidebar
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index c305e066ff84..5ec52289e6fb 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -422,7 +422,7 @@ public:
IMPL_LINK( SmFontSizeDialog, DefaultButtonClickHdl, Button *, /*pButton*/ )
{
- if (SaveDefaultsQuery(this).Execute() == RET_YES)
+ if (ScopedVclPtr<SaveDefaultsQuery>::Create(this)->Execute() == RET_YES)
{
SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
@@ -526,7 +526,7 @@ IMPL_LINK( SmFontTypeDialog, MenuSelectHdl, Menu *, pMenu )
IMPL_LINK( SmFontTypeDialog, DefaultButtonClickHdl, Button *, /*pButton*/ )
{
- if (SaveDefaultsQuery(this).Execute() == RET_YES)
+ if (ScopedVclPtr<SaveDefaultsQuery>::Create(this)->Execute() == RET_YES)
{
SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
@@ -723,7 +723,7 @@ IMPL_LINK( SmDistanceDialog, MenuSelectHdl, Menu *, pMenu )
IMPL_LINK( SmDistanceDialog, DefaultButtonClickHdl, Button *, /*pButton*/ )
{
- if (SaveDefaultsQuery(this).Execute() == RET_YES)
+ if (ScopedVclPtr<SaveDefaultsQuery>::Create(this)->Execute() == RET_YES)
{
SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
@@ -1029,7 +1029,7 @@ void SmDistanceDialog::WriteTo(SmFormat &rFormat) /*const*/
IMPL_LINK( SmAlignDialog, DefaultButtonClickHdl, Button *, /*pButton*/ )
{
- if (SaveDefaultsQuery(this).Execute() == RET_YES)
+ if (ScopedVclPtr<SaveDefaultsQuery>::Create(this)->Execute() == RET_YES)
{
SmModule *pp = SM_MOD();
SmFormat aFmt( pp->GetConfig()->GetStandardFormat() );
diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx
index a4c4431d8da9..05a7e6d9c59b 100644
--- a/svtools/source/dialogs/prnsetup.cxx
+++ b/svtools/source/dialogs/prnsetup.cxx
@@ -104,7 +104,7 @@ Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinterIn )
if ( ! Printer::GetQueueInfo( aPrnName, false ) )
{
pTempPrinter.disposeAndClear();
- pTempPrinter = new Printer;
+ pTempPrinter = VclPtr<Printer>::Create();
}
return pTempPrinter;
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index 8b9dd52f5446..55d0a483ca0d 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -118,7 +118,7 @@ SAL_DLLPUBLIC_EXPORT vcl::Window* CreateWindow( VCLXWindow** ppNewComp, const ::
}
else if (aServiceName.equalsIgnoreAsciiCase("roadmap") )
{
- pWindow = new ::svt::ORoadmap( pParent, WB_TABSTOP );
+ pWindow = VclPtr<::svt::ORoadmap>::Create( pParent, WB_TABSTOP );
*ppNewComp = new SVTXRoadmap;
}
else if ( aServiceName.equalsIgnoreAsciiCase( "ProgressBar" ) )
@@ -157,7 +157,7 @@ SAL_DLLPUBLIC_EXPORT vcl::Window* CreateWindow( VCLXWindow** ppNewComp, const ::
{
if ( pParent )
{
- pWindow = new ::svt::table::TableControl(pParent, nWinBits);
+ pWindow = VclPtr<::svt::table::TableControl>::Create(pParent, nWinBits);
*ppNewComp = new SVTXGridControl;
}
else
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 34768b21677f..2767bb79b02f 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -493,7 +493,7 @@ void SvxFontPrevWindow::Init()
if (!pImpl->mpPrinter)
{
- pImpl->mpPrinter = new Printer;
+ pImpl->mpPrinter = VclPtr<Printer>::Create();
pImpl->mbDelPrinter = true;
}
SetMapMode(MapMode(MAP_TWIP));
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index efe7b6b873c1..be442144fb39 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -2267,7 +2267,7 @@ SvxSearchDialogWrapper::SvxSearchDialogWrapper( vcl::Window* _pParent, sal_uInt1
SfxBindings* pBindings,
SfxChildWinInfo* pInfo )
: SfxChildWindow( _pParent, nId )
- , dialog (new SvxSearchDialog (_pParent, this, *pBindings))
+ , dialog (VclPtr<SvxSearchDialog>::Create(_pParent, this, *pBindings))
{
pWindow = dialog.get();
dialog->Initialize( pInfo );
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index a18073102e68..2401be789b43 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -525,7 +525,7 @@ void SwDropCapsPict::_InitPrinter()
if (!mpPrinter)
{
- mpPrinter = new Printer;
+ mpPrinter = VclPtr<Printer>::Create();
mbDelPrinter = true;
}
}
@@ -621,7 +621,7 @@ SfxTabPage::sfxpg SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet)
VclPtr<SfxTabPage> SwDropCapsPage::Create(vcl::Window *pParent,
const SfxItemSet *rSet)
{
- return VclPtr<SfxTabPage>(new SwDropCapsPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwDropCapsPage>::Create(pParent, *rSet);
}
bool SwDropCapsPage::FillItemSet(SfxItemSet *rSet)
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index 26b8a210b31f..ff8f908b5f23 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -126,8 +126,7 @@ void SwParagraphNumTabPage::dispose()
VclPtr<SfxTabPage> SwParagraphNumTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>( new SwParagraphNumTabPage(pParent, *rSet),
- SAL_NO_ACQUIRE );
+ return VclPtr<SwParagraphNumTabPage>::Create(pParent, *rSet);
}
bool SwParagraphNumTabPage::FillItemSet( SfxItemSet* rSet )
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index 7b813250e690..62be945beb74 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -155,8 +155,7 @@ SfxTabPage::sfxpg SwCondCollPage::DeactivatePage(SfxItemSet * _pSet)
VclPtr<SfxTabPage> SwCondCollPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return VclPtr<SfxTabPage>(new SwCondCollPage(pParent, *rSet),
- SAL_NO_ACQUIRE);
+ return VclPtr<SwCondCollPage>::Create(pParent, *rSet);
}
bool SwCondCollPage::FillItemSet(SfxItemSet *rSet)
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 86da07785385..a70f57c0a9fb 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -430,8 +430,7 @@ void SwAddPrinterTabPage::SetPreview(bool bPrev)
VclPtr<SfxTabPage> SwAddPrinterTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>(new SwAddPrinterTabPage( pParent, *rAttrSet ),
- SAL_NO_ACQUIRE);
+ return VclPtr<SwAddPrinterTabPage>::Create( pParent, *rAttrSet );
}
bool SwAddPrinterTabPage::FillItemSet( SfxItemSet* rCoreSet )
@@ -667,8 +666,7 @@ void SwStdFontTabPage::dispose()
VclPtr<SfxTabPage> SwStdFontTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>(new SwStdFontTabPage(pParent, *rAttrSet),
- SAL_NO_ACQUIRE);
+ return VclPtr<SwStdFontTabPage>::Create(pParent, *rAttrSet);
}
static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
@@ -1192,8 +1190,7 @@ void SwTableOptionsTabPage::dispose()
VclPtr<SfxTabPage> SwTableOptionsTabPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>( new SwTableOptionsTabPage(pParent, *rAttrSet ),
- SAL_NO_ACQUIRE );
+ return VclPtr<SwTableOptionsTabPage>::Create(pParent, *rAttrSet);
}
bool SwTableOptionsTabPage::FillItemSet( SfxItemSet* )
@@ -1453,7 +1450,7 @@ void SwShdwCrsrOptionsTabPage::dispose()
VclPtr<SfxTabPage> SwShdwCrsrOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
{
- return VclPtr<SfxTabPage>(new SwShdwCrsrOptionsTabPage( pParent, *rSet ), SAL_NO_ACQUIRE);
+ return VclPtr<SwShdwCrsrOptionsTabPage>::Create( pParent, *rSet );
}
void SwShdwCrsrOptionsTabPage::PageCreated( const SfxAllItemSet& aSet )
@@ -1874,7 +1871,7 @@ void SwRedlineOptionsTabPage::dispose()
VclPtr<SfxTabPage> SwRedlineOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>( new SwRedlineOptionsTabPage( pParent, *rSet ), SAL_NO_ACQUIRE );
+ return VclPtr<SwRedlineOptionsTabPage>::Create( pParent, *rSet );
}
bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
@@ -2388,7 +2385,7 @@ void SwCompareOptionsTabPage::dispose()
VclPtr<SfxTabPage> SwCompareOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
{
- return VclPtr<SfxTabPage>(new SwCompareOptionsTabPage( pParent, *rAttrSet ), SAL_NO_ACQUIRE);
+ return VclPtr<SwCompareOptionsTabPage>::Create( pParent, *rAttrSet );
}
bool SwCompareOptionsTabPage::FillItemSet( SfxItemSet* )
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 3a9f6b4c76ce..906825a5a755 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -461,7 +461,7 @@ void SwEnvFormatPage::SetMinMax()
VclPtr<SfxTabPage> SwEnvFormatPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>(new SwEnvFormatPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwEnvFormatPage>::Create(pParent, *rSet);
}
void SwEnvFormatPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx
index be34f66b3bdf..8e20c6adbd1f 100644
--- a/sw/source/ui/envelp/envlop1.cxx
+++ b/sw/source/ui/envelp/envlop1.cxx
@@ -321,7 +321,7 @@ void SwEnvPage::InitDatabaseBox()
VclPtr<SfxTabPage> SwEnvPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>(new SwEnvPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwEnvPage>::Create(pParent, *rSet);
}
void SwEnvPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx
index b256af9cdb2d..8fb8a3917c8c 100644
--- a/sw/source/ui/envelp/envprt.cxx
+++ b/sw/source/ui/envelp/envprt.cxx
@@ -145,7 +145,7 @@ IMPL_LINK_NOARG_TYPED(SwEnvPrtPage, AlignHdl, ToolBox *, void)
VclPtr<SfxTabPage> SwEnvPrtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>(new SwEnvPrtPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwEnvPrtPage>::Create(pParent, *rSet);
}
void SwEnvPrtPage::ActivatePage(const SfxItemSet&)
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index dfffd5dbe369..96c02c28caa3 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -488,7 +488,7 @@ void SwLabPage::InitDatabaseBox()
VclPtr<SfxTabPage> SwLabPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>(new SwLabPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwLabPage>::Create(pParent, *rSet);
}
void SwLabPage::ActivatePage(const SfxItemSet& rSet)
@@ -633,7 +633,7 @@ void SwVisitingCardPage::dispose()
VclPtr<SfxTabPage> SwVisitingCardPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>(new SwVisitingCardPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwVisitingCardPage>::Create(pParent, *rSet);
}
void SwVisitingCardPage::ActivatePage(const SfxItemSet& rSet)
@@ -794,7 +794,7 @@ void SwPrivateDataPage::dispose()
VclPtr<SfxTabPage> SwPrivateDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>(new SwPrivateDataPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwPrivateDataPage>::Create(pParent, *rSet);
}
void SwPrivateDataPage::ActivatePage(const SfxItemSet& rSet)
@@ -907,7 +907,7 @@ void SwBusinessDataPage::dispose()
VclPtr<SfxTabPage> SwBusinessDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>(new SwBusinessDataPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwBusinessDataPage>::Create(pParent, *rSet);
}
void SwBusinessDataPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index e8b3d53c1369..6ed49bc016af 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -488,7 +488,7 @@ void SwLabFormatPage::ChangeMinMax()
VclPtr<SfxTabPage> SwLabFormatPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>(new SwLabFormatPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwLabFormatPage>::Create(pParent, *rSet);
}
void SwLabFormatPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx
index ae5970d4f4f6..ae81bbeac08d 100644
--- a/sw/source/ui/envelp/labprt.cxx
+++ b/sw/source/ui/envelp/labprt.cxx
@@ -86,7 +86,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
{
// Call printer setup
if (!pPrinter)
- pPrinter = new Printer;
+ pPrinter = VclPtr<Printer>::Create();
VclPtrInstance< PrinterSetupDialog > pDlg(this);
pDlg->SetPrinter(pPrinter);
@@ -110,7 +110,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
VclPtr<SfxTabPage> SwLabPrtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
{
- return VclPtr<SfxTabPage>(new SwLabPrtPage( pParent, *rSet ), SAL_NO_ACQUIRE);
+ return VclPtr<SwLabPrtPage>::Create( pParent, *rSet );
}
void SwLabPrtPage::ActivatePage( const SfxItemSet& rSet )
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index 43766da0bcb6..903926976f31 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -662,7 +662,7 @@ void SwColumnPage::Reset(const SfxItemSet *rSet)
// create TabPage
VclPtr<SfxTabPage> SwColumnPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return VclPtr<SfxTabPage>(new SwColumnPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwColumnPage>::Create(pParent, *rSet);
}
// stuff attributes into the Set when OK
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index f756ad9c32ed..01e12dcf0e1a 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -861,7 +861,7 @@ void SwFrmPage::setOptimalRelWidth()
VclPtr<SfxTabPage> SwFrmPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return VclPtr<SfxTabPage>(new SwFrmPage( pParent, *rSet ), SAL_NO_ACQUIRE);
+ return VclPtr<SwFrmPage>::Create( pParent, *rSet );
}
void SwFrmPage::EnableGraficMode()
@@ -2423,7 +2423,7 @@ void SwGrfExtPage::dispose()
VclPtr<SfxTabPage> SwGrfExtPage::Create( vcl::Window *pParent, const SfxItemSet *rSet )
{
- return VclPtr<SfxTabPage>(new SwGrfExtPage( pParent, *rSet ), SAL_NO_ACQUIRE);
+ return VclPtr<SwGrfExtPage>::Create( pParent, *rSet );
}
void SwGrfExtPage::Reset(const SfxItemSet *rSet)
@@ -2850,7 +2850,7 @@ bool SwFrmURLPage::FillItemSet(SfxItemSet *rSet)
VclPtr<SfxTabPage> SwFrmURLPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return VclPtr<SfxTabPage>(new SwFrmURLPage( pParent, *rSet ), SAL_NO_ACQUIRE);
+ return VclPtr<SwFrmURLPage>::Create( pParent, *rSet );
}
IMPL_LINK_NOARG(SwFrmURLPage, InsertFileHdl)
@@ -2942,7 +2942,7 @@ void SwFrmAddPage::dispose()
VclPtr<SfxTabPage> SwFrmAddPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return VclPtr<SfxTabPage>(new SwFrmAddPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwFrmAddPage>::Create(pParent, *rSet);
}
void SwFrmAddPage::Reset(const SfxItemSet *rSet )
diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx
index 54ccf0402731..6cb8e81716c1 100644
--- a/sw/source/ui/frmdlg/wrap.cxx
+++ b/sw/source/ui/frmdlg/wrap.cxx
@@ -157,7 +157,7 @@ void SwWrapTabPage::dispose()
VclPtr<SfxTabPage> SwWrapTabPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return VclPtr<SfxTabPage>(new SwWrapTabPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwWrapTabPage>::Create(pParent, *rSet);
}
void SwWrapTabPage::Reset(const SfxItemSet *rSet)
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index a0c803642668..95140fd09cdd 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3864,7 +3864,7 @@ SwEntryBrowseBox::SwEntryBrowseBox(vcl::Window* pParent, VclBuilderContainer* pB
BrowserMode::AUTO_VSCROLL|
BrowserMode::HIDECURSOR )
, aCellEdit(VclPtr<Edit>::Create(&GetDataWindow(), 0))
- , aCellCheckBox(new ::svt::CheckBoxControl(&GetDataWindow()))
+ , aCellCheckBox(VclPtr<::svt::CheckBoxControl>::Create(&GetDataWindow()))
, nCurrentRow(0)
, bModified(false)
{
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index 5703e6d7b354..797ba4e6d35b 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -423,7 +423,7 @@ SwFootNoteOptionPage::~SwFootNoteOptionPage()
VclPtr<SfxTabPage> SwFootNoteOptionPage::Create(vcl::Window *pParent, const SfxItemSet *rSet )
{
- return VclPtr<SfxTabPage>(new SwFootNoteOptionPage( pParent, *rSet ), SAL_NO_ACQUIRE);
+ return VclPtr<SwFootNoteOptionPage>::Create( pParent, *rSet );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/impfnote.hxx b/sw/source/ui/misc/impfnote.hxx
index 8d291d0c6794..c7390af9449d 100644
--- a/sw/source/ui/misc/impfnote.hxx
+++ b/sw/source/ui/misc/impfnote.hxx
@@ -81,6 +81,7 @@ public:
class SwFootNoteOptionPage : public SwEndNoteOptionPage
{
+ friend class VclPtr<SwFootNoteOptionPage>;
SwFootNoteOptionPage( vcl::Window *pParent, const SfxItemSet &rSet );
virtual ~SwFootNoteOptionPage();
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 49ac9ab8964a..11698c348e1c 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -153,7 +153,7 @@ void SwFootNotePage::dispose()
VclPtr<SfxTabPage> SwFootNotePage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return VclPtr<SfxTabPage>(new SwFootNotePage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwFootNotePage>::Create(pParent, *rSet);
}
void SwFootNotePage::Reset(const SfxItemSet *rSet)
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index f725eba0734d..ef7823c3b61d 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -182,7 +182,7 @@ void SwTextGridPage::dispose()
VclPtr<SfxTabPage> SwTextGridPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
{
- return VclPtr<SfxTabPage>(new SwTextGridPage(pParent, *rSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwTextGridPage>::Create(pParent, *rSet);
}
bool SwTextGridPage::FillItemSet(SfxItemSet *rSet)
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index d27f981bf812..6283bbdccead 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1372,7 +1372,7 @@ void SwTextFlowPage::dispose()
VclPtr<SfxTabPage> SwTextFlowPage::Create( vcl::Window* pParent,
const SfxItemSet* rAttrSet)
{
- return VclPtr<SfxTabPage>(new SwTextFlowPage(pParent, *rAttrSet), SAL_NO_ACQUIRE);
+ return VclPtr<SwTextFlowPage>::Create(pParent, *rAttrSet);
}
bool SwTextFlowPage::FillItemSet( SfxItemSet* rSet )
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 1d7cf89f7d28..87123fde207a 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -356,8 +356,8 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, AddHdl)
if( !bFormatInserted )
{
- bOk = RET_CANCEL == MessageDialog(this, aStrInvalidFormat, VCL_MESSAGE_ERROR, VCL_BUTTONS_OK_CANCEL)
- .Execute();
+ bOk = RET_CANCEL == ScopedVclPtr<MessageDialog>::Create(this, aStrInvalidFormat, VCL_MESSAGE_ERROR, VCL_BUTTONS_OK_CANCEL)
+ ->Execute();
}
}
else
@@ -456,8 +456,8 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl)
if( !bFormatRenamed )
{
- bOk = RET_CANCEL == MessageDialog(this, aStrInvalidFormat, VCL_MESSAGE_ERROR, VCL_BUTTONS_OK_CANCEL)
- .Execute();
+ bOk = RET_CANCEL == ScopedVclPtr<MessageDialog>::Create(this, aStrInvalidFormat, VCL_MESSAGE_ERROR, VCL_BUTTONS_OK_CANCEL)
+ ->Execute();
}
}
else
diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
index 08050057add8..01dbd79bcc86 100644
--- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx
@@ -391,8 +391,8 @@ The code below would only be part of the solution.
if(m_pSpellState->m_xStartRange.is())
{
LockFocusNotification( true );
- sal_uInt16 nRet = MessageDialog(GetWindow(), SW_RES(STR_QUERY_SPELL_CONTINUE),
- VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute();
+ sal_uInt16 nRet = ScopedVclPtr<MessageDialog>::Create(GetWindow(), SW_RES(STR_QUERY_SPELL_CONTINUE),
+ VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)->Execute();
if(RET_YES == nRet)
{
SwUnoInternalPaM aPam(*pWrtShell->GetDoc());
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx
index 6c5a5cdea0b9..9ce682af86dd 100644
--- a/sw/source/uibase/docvw/AnnotationWin.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin.cxx
@@ -221,7 +221,7 @@ VclPtr<MenuButton> SwAnnotationWin::CreateMenuButton()
aRewriter.AddRule(UndoArg1,GetAuthor());
aText = aRewriter.Apply(aText);
mpButtonPopup->SetItemText(FN_DELETE_NOTE_AUTHOR,aText);
- VclPtr<MenuButton> pMenuButton( new AnnotationMenuButton( *this ), SAL_NO_ACQUIRE );
+ VclPtrInstance<AnnotationMenuButton> pMenuButton( *this );
pMenuButton->SetPopupMenu( mpButtonPopup );
pMenuButton->Show();
return pMenuButton;
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index eb8278469e8d..bcc3650c11bf 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -130,6 +130,7 @@ public:
class SwStdFontTabPage : public SfxTabPage
{
+ friend class VclPtr<SwStdFontTabPage>;
VclPtr<FixedText> pLabelFT;
VclPtr<ComboBox> pStandardBox;
diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx
index 49f1974b8c3e..223fe3851f7a 100644
--- a/sw/source/uibase/inc/pgfnote.hxx
+++ b/sw/source/uibase/inc/pgfnote.hxx
@@ -31,6 +31,7 @@
// footnote settings TabPage
class SwFootNotePage: public SfxTabPage
{
+ friend class VclPtr<SwFootNotePage>;
static const sal_uInt16 aPageRg[];
SwFootNotePage(vcl::Window *pParent, const SfxItemSet &rSet);
public:
diff --git a/sw/source/uibase/sidebar/PageColumnControl.cxx b/sw/source/uibase/sidebar/PageColumnControl.cxx
index 2c37741b69f0..d1a675e29900 100644
--- a/sw/source/uibase/sidebar/PageColumnControl.cxx
+++ b/sw/source/uibase/sidebar/PageColumnControl.cxx
@@ -37,7 +37,7 @@ PageColumnControl::PageColumnControl(
const sal_uInt16 nColumnType,
const bool bLandscape )
: svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_COLUMN) )
- , mpColumnValueSet( new svx::sidebar::ValueSetWithTextControl( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_COLUMN) ) )
+ , mpColumnValueSet( VclPtr<svx::sidebar::ValueSetWithTextControl>::Create( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_COLUMN) ) )
, maMoreButton( VclPtr<PushButton>::Create( this, SW_RES(CB_COLUMN_MORE) ) )
, mnColumnType( nColumnType )
, mrPagePropPanel(rPanel)
diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx
index 5a806688e75a..7d5fe569f41d 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.cxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.cxx
@@ -49,7 +49,7 @@ PageMarginControl::PageMarginControl(
const FieldUnit eFUnit,
const SfxMapUnit eUnit )
: svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_MARGIN) )
- , mpMarginValueSet( new svx::sidebar::ValueSetWithTextControl( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_MARGIN) ) )
+ , mpMarginValueSet( VclPtr<svx::sidebar::ValueSetWithTextControl>::Create( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_MARGIN) ) )
, maCustom(VclPtr<FixedText>::Create(this, SW_RES(FT_CUSTOM)))
, maLeft(VclPtr<FixedText>::Create(this, SW_RES(FT_LEFT)))
, maInner(VclPtr<FixedText>::Create(this, SW_RES(FT_INNER)))
diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx
index 1c3dc3566cd5..18da73a34ba5 100644
--- a/sw/source/uibase/sidebar/PageOrientationControl.cxx
+++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx
@@ -33,7 +33,7 @@ PageOrientationControl::PageOrientationControl(
PagePropertyPanel& rPanel,
const bool bLandscape )
: svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_ORIENTATION) )
- , mpOrientationValueSet( new svx::sidebar::ValueSetWithTextControl( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_ORIENTATION) ) )
+ , mpOrientationValueSet( VclPtr<svx::sidebar::ValueSetWithTextControl>::Create( svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_ORIENTATION) ) )
, mbLandscape( bLandscape )
, mrPagePropPanel(rPanel)
{
diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx b/sw/source/uibase/sidebar/PageSizeControl.cxx
index 48f1b0a6d6c1..621d18f9bc8c 100644
--- a/sw/source/uibase/sidebar/PageSizeControl.cxx
+++ b/sw/source/uibase/sidebar/PageSizeControl.cxx
@@ -42,7 +42,7 @@ PageSizeControl::PageSizeControl(
const bool bLandscape,
const FieldUnit eFUnit )
: svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_SIZE) )
- , mpSizeValueSet( new svx::sidebar::ValueSetWithTextControl( svx::sidebar::ValueSetWithTextControl::TEXT_TEXT, this, SW_RES(VS_SIZE) ) )
+ , mpSizeValueSet( VclPtr<svx::sidebar::ValueSetWithTextControl>::Create( svx::sidebar::ValueSetWithTextControl::TEXT_TEXT, this, SW_RES(VS_SIZE) ) )
, maMoreButton( VclPtr<PushButton>::Create( this, SW_RES(CB_SIZE_MORE) ) )
, maWidthHeightField( VclPtr<MetricField>::Create( this, SW_RES(FLD_WIDTH_HEIGHT) ) )
, mePaper( ePaper )
diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
index a0c491fe0a84..7a4dbfc2933a 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
@@ -54,7 +54,7 @@ VclPtr<vcl::Window> StylePresetsPanel::Create (vcl::Window* pParent,
if (pBindings == NULL)
throw css::lang::IllegalArgumentException("no SfxBindings given to PagePropertyPanel::Create", NULL, 2);
- return VclPtr<vcl::Window>(new StylePresetsPanel(pParent, rxFrame, pBindings), SAL_NO_ACQUIRE);
+ return VclPtr<StylePresetsPanel>::Create(pParent, rxFrame, pBindings);
}
StylePresetsPanel::StylePresetsPanel(vcl::Window* pParent,
diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.hxx b/sw/source/uibase/sidebar/StylePresetsPanel.hxx
index 047272ea87ca..5f0b97d8e7f7 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.hxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.hxx
@@ -41,6 +41,7 @@ namespace sw { namespace sidebar {
class StylePresetsPanel : public PanelLayout,
public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
+ friend class VclPtr<StylePresetsPanel>;
public:
static VclPtr<vcl::Window> Create(vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx
index 013519661a13..92dd4875d948 100644
--- a/sw/source/uibase/sidebar/SwPanelFactory.cxx
+++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx
@@ -139,7 +139,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
}
else if (rsResourceURL.endsWith("/NavigatorPanel"))
{
- VclPtr<vcl::Window> pPanel( new SwNavigationPI(pBindings, NULL, pParentWindow), SAL_NO_ACQUIRE );
+ VclPtrInstance<SwNavigationPI> pPanel(pBindings, nullptr, pParentWindow);
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
@@ -148,7 +148,7 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
}
else if (rsResourceURL.endsWith("/ManageChangesPanel"))
{
- VclPtr<vcl::Window> pPanel( new SwRedlineAcceptPanel(pParentWindow, xFrame), SAL_NO_ACQUIRE );
+ VclPtrInstance<SwRedlineAcceptPanel> pPanel(pParentWindow, xFrame);
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx
index 9bedd354bf49..40ea7ec4da40 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -477,7 +477,7 @@ VclPtr<vcl::Window> ThemePanel::Create (vcl::Window* pParent,
if (pBindings == NULL)
throw css::lang::IllegalArgumentException("no SfxBindings given to PagePropertyPanel::Create", NULL, 2);
- return VclPtr<vcl::Window>(new ThemePanel(pParent, rxFrame, pBindings), SAL_NO_ACQUIRE);
+ return VclPtr<ThemePanel>::Create(pParent, rxFrame, pBindings);
}
ThemePanel::ThemePanel(vcl::Window* pParent,
diff --git a/sw/source/uibase/sidebar/ThemePanel.hxx b/sw/source/uibase/sidebar/ThemePanel.hxx
index a14ac51de4ae..fa958cc82c5a 100644
--- a/sw/source/uibase/sidebar/ThemePanel.hxx
+++ b/sw/source/uibase/sidebar/ThemePanel.hxx
@@ -41,6 +41,7 @@ namespace sw { namespace sidebar {
class ThemePanel : public PanelLayout,
public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
+ friend class VclPtr<ThemePanel>;
public:
static VclPtr<vcl::Window> Create(vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 144030b20242..6a337a29786e 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -711,7 +711,7 @@ void SwPagePreview::Execute( SfxRequest &rReq )
}
else
- SwPreviewZoomDlg( *pViewWin ).Execute();
+ ScopedVclPtrInstance<SwPreviewZoomDlg>( *pViewWin )->Execute();
}
break;
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 051081b5210c..2f19e1faf113 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -426,8 +426,7 @@ void SwNavHelpToolBox::MouseButtonDown(const MouseEvent &rEvt)
void SwNavigationPI::CreateNavigationTool(const Rectangle& rRect, bool bSetFocus, vcl::Window *pParent)
{
Reference< XFrame > xFrame = GetCreateView()->GetViewFrame()->GetFrame().GetFrameInterface();
- SwScrollNaviPopup* pPopup = new
- SwScrollNaviPopup(FN_SCROLL_NAVIGATION, xFrame, pParent);
+ VclPtrInstance<SwScrollNaviPopup> pPopup(FN_SCROLL_NAVIGATION, xFrame, pParent);
Rectangle aRect(rRect);
Point aT1 = aRect.TopLeft();
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index edf624a0f4bd..82ad2b84b3d5 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -937,9 +937,9 @@ vcl::Window* VCLXToolkit::ImplCreateWindow( VCLXWindow** ppNewComp,
{
// Modal/Modeless nur durch Show/Execute
if ( (pParent == NULL ) && ( rDescriptor.ParentIndex == -1 ) )
- pNewWindow = new toolkit::ScrollableWrapper<Dialog>( nullptr, nWinBits, Dialog::InitFlag::NoParent );
+ pNewWindow = VclPtr<toolkit::ScrollableWrapper<Dialog>>::Create( nullptr, nWinBits, Dialog::InitFlag::NoParent );
else
- pNewWindow = new toolkit::ScrollableWrapper<Dialog>( pParent, nWinBits );
+ pNewWindow = VclPtr<toolkit::ScrollableWrapper<Dialog>>::Create( pParent, nWinBits );
// #i70217# Don't always create a new component object. It's possible that VCL has called
// GetComponentInterface( sal_True ) in the Dialog ctor itself (see Window::IsTopWindow() )
// which creates a component object.
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 64d08c4f2559..51bab758eb33 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1325,7 +1325,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
WinBits nBits = WB_CLIPCHILDREN|WB_MOVEABLE|WB_3DLOOK|WB_CLOSEABLE;
if (extractResizable(rMap))
nBits |= WB_SIZEABLE;
- xWindow = VclPtr<MessageDialog>(new MessageDialog(pParent, nBits), SAL_NO_ACQUIRE);
+ xWindow = VclPtr<MessageDialog>::Create(pParent, nBits);
}
else if (name == "GtkBox")
{
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 9673a3c617f1..14bc8bd959e0 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -331,8 +331,8 @@ bool DigitalSignaturesDialog::canAddRemove()
//It the user presses 'Add' or 'Remove' several times then, then the warning
//is shown every time until the user presses 'OK'. From then on, the warning
//is not displayed anymore as long as the signatures dialog is alive.
- if (MessageDialog(
- NULL, XMLSEC_RES(STR_XMLSECDLG_QUERY_REMOVEDOCSIGNBEFORESIGN), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO).Execute() == RET_NO)
+ if (ScopedVclPtr<MessageDialog>::Create(
+ nullptr, XMLSEC_RES(STR_XMLSECDLG_QUERY_REMOVEDOCSIGNBEFORESIGN), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)->Execute() == RET_NO)
ret = false;
else
m_bWarningShowSignMacro = true;