diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-05-11 14:02:42 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-05-11 15:12:08 +0100 |
commit | 9f016bd69422bdfb4cf7c4f5e57356eb98db2d8c (patch) | |
tree | c32e463b68bad8cfc1ab9f69792b8c10071515bf | |
parent | e7473c692cad4c19f1d9eadd2547df4a50875baf (diff) |
Switch VclBuilder constructors to use VclPtr.
Change-Id: Id35a86eb52bbde6ca09a5e61a0b1a79b23be8faf
79 files changed, 110 insertions, 124 deletions
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index 27f35d57c12f..633ded977259 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -202,7 +202,7 @@ VCL_BUILDER_DECL_FACTORY(TreeListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new TreeListBox(pParent, nWinBits); + return VclPtr<TreeListBox>::Create(pParent, nWinBits); } TreeListBox::~TreeListBox () diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 32c9280ddffd..433a6379ff60 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -152,7 +152,7 @@ VCL_BUILDER_DECL_FACTORY(CheckBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new CheckBox(pParent, nWinBits); + return VclPtr<CheckBox>::Create(pParent, nWinBits); } CheckBox::~CheckBox() diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 712c66c6eef4..493f280efb04 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -47,8 +47,6 @@ using namespace ::com::sun::star::resource; // ExtTreeListBox - - ExtTreeListBox::ExtTreeListBox(vcl::Window* pParent, WinBits nStyle) : TreeListBox(pParent, nStyle) { @@ -60,7 +58,7 @@ VCL_BUILDER_DECL_FACTORY(ExtTreeListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new ExtTreeListBox(pParent, nWinBits); + return VclPtr<ExtTreeListBox>::Create(pParent, nWinBits); } bool ExtTreeListBox::EditingEntry( SvTreeListEntry* pEntry, Selection& ) diff --git a/chart2/source/controller/dialogs/tp_DataSourceControls.cxx b/chart2/source/controller/dialogs/tp_DataSourceControls.cxx index 55eb08494239..da8ef1bfdff1 100644 --- a/chart2/source/controller/dialogs/tp_DataSourceControls.cxx +++ b/chart2/source/controller/dialogs/tp_DataSourceControls.cxx @@ -42,7 +42,7 @@ VCL_BUILDER_DECL_FACTORY(SeriesListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SeriesListBox(pParent, nWinStyle); + return VclPtr<SeriesListBox>::Create(pParent, nWinStyle); } SvTreeListEntry* SeriesListBox::CreateEntry() const diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index 42e2f98090df..bce7891417d6 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -661,7 +661,7 @@ VCL_BUILDER_DECL_FACTORY(SfxAccCfgTabListBox) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new SfxAccCfgTabListBox_Impl(pParent, nWinBits); + return VclPtr<SfxAccCfgTabListBox_Impl>::Create(pParent, nWinBits); } void SfxAccCfgTabListBox_Impl::InitEntry(SvTreeListEntry* pEntry, diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index c74e0e78e44b..c5d3cdf4c803 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -266,7 +266,7 @@ VCL_BUILDER_DECL_FACTORY(SfxConfigFunctionListBox) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new SfxConfigFunctionListBox(pParent, nWinBits); + return VclPtr<SfxConfigFunctionListBox>::Create(pParent, nWinBits); } SfxConfigFunctionListBox::~SfxConfigFunctionListBox() @@ -408,7 +408,7 @@ VCL_BUILDER_DECL_FACTORY(SfxConfigGroupListBox) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new SfxConfigGroupListBox(pParent, nWinBits); + return VclPtr<SfxConfigGroupListBox>::Create(pParent, nWinBits); } SfxConfigGroupListBox::~SfxConfigGroupListBox() diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index c50b487a200a..ae805ba27919 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -161,7 +161,7 @@ VCL_BUILDER_DECL_FACTORY(MacroEventListBox) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new MacroEventListBox(pParent, nWinBits); + return VclPtr<MacroEventListBox>::Create(pParent, nWinBits); } Size MacroEventListBox::GetOptimalSize() const diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx index ce1cbcabcde4..f941d9ce82cc 100644 --- a/cui/source/customize/selector.cxx +++ b/cui/source/customize/selector.cxx @@ -95,7 +95,7 @@ VCL_BUILDER_DECL_FACTORY(SvxConfigFunctionListBox) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new SvxConfigFunctionListBox(pParent, nWinBits); + return VclPtr<SvxConfigFunctionListBox>::Create(pParent, nWinBits); } SvxConfigFunctionListBox::~SvxConfigFunctionListBox() @@ -228,7 +228,7 @@ VCL_BUILDER_DECL_FACTORY(SvxConfigGroupListBox) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new SvxConfigGroupListBox(pParent, nWinBits); + return VclPtr<SvxConfigGroupListBox>::Create(pParent, nWinBits); } SvxConfigGroupListBox::~SvxConfigGroupListBox() diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index a27774cc717b..a20bb6e14f5a 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -1222,7 +1222,7 @@ SentenceEditWindow_Impl::SentenceEditWindow_Impl(vcl::Window * pParent, WinBits VCL_BUILDER_DECL_FACTORY(SentenceEditWindow) { (void)rMap; - return new SentenceEditWindow_Impl(pParent, WB_BORDER|WB_VSCROLL|WB_IGNORETAB); + return VclPtr<SentenceEditWindow_Impl>::Create(pParent, WB_BORDER|WB_VSCROLL|WB_IGNORETAB); } diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index ee90eb7e17d3..cf487f1b0ebf 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -280,7 +280,7 @@ VCL_BUILDER_DECL_FACTORY(ColorPreviewControl) if (!sBorder.isEmpty()) nBits |= WB_BORDER; - return new ColorPreviewControl(pParent, nBits); + return VclPtr<ColorPreviewControl>::Create(pParent, nBits); } void ColorPreviewControl::SetColor( const Color& rCol ) @@ -376,7 +376,7 @@ VCL_BUILDER_DECL_FACTORY(ColorFieldControl) if (!sBorder.isEmpty()) nBits |= WB_BORDER; - return new ColorFieldControl(pParent, nBits); + return VclPtr<ColorFieldControl>::Create(pParent, nBits); } Size ColorFieldControl::GetOptimalSize() const @@ -769,7 +769,7 @@ VCL_BUILDER_DECL_FACTORY(ColorSliderControl) if (!sBorder.isEmpty()) nBits |= WB_BORDER; - return new ColorSliderControl(pParent, nBits); + return VclPtr<ColorSliderControl>::Create(pParent, nBits); } void ColorSliderControl::UpdateBitmap() diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 2edac2d05d81..fdba7520c79a 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -45,7 +45,7 @@ VCL_BUILDER_DECL_FACTORY(GraphicPreviewWindow) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new GraphicPreviewWindow(pParent, nWinBits); + return VclPtr<GraphicPreviewWindow>::Create(pParent, nWinBits); } Size GraphicPreviewWindow::GetOptimalSize() const diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx index b65bf8c4522b..6572fcb0b1bf 100644 --- a/cui/source/dialogs/hlmarkwn.cxx +++ b/cui/source/dialogs/hlmarkwn.cxx @@ -90,7 +90,7 @@ VCL_BUILDER_DECL_FACTORY(SvxHlmarkTreeLBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SvxHlmarkTreeLBox(pParent, nWinStyle); + return VclPtr<SvxHlmarkTreeLBox>::Create(pParent, nWinStyle); } Size SvxHlmarkTreeLBox::GetOptimalSize() const diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index 65064c34c4a8..cdef298a0475 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -931,7 +931,7 @@ void ColorConfigCtrl_Impl::dispose() VCL_BUILDER_DECL_FACTORY(ColorConfigCtrl) { (void)rMap; - return new ColorConfigCtrl_Impl(pParent); + return VclPtr<ColorConfigCtrl_Impl>::Create(pParent); } void ColorConfigCtrl_Impl::Update () diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 259a28f05fb3..1f4943c1b3ae 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -2463,7 +2463,7 @@ VCL_BUILDER_DECL_FACTORY(AutoCompleteMultiListBox) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new OfaAutoCompleteTabPage::AutoCompleteMultiListBox(pParent, nWinBits); + return VclPtr<OfaAutoCompleteTabPage::AutoCompleteMultiListBox>::Create(pParent, nWinBits); } // class OfaSmartTagOptionsTabPage --------------------------------------------- diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 2c9998e786c0..e8aa044e55fd 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -219,7 +219,7 @@ BackgroundPreviewImpl::BackgroundPreviewImpl(vcl::Window* pParent) VCL_BUILDER_DECL_FACTORY(BackgroundPreview) { (void)rMap; - return new BackgroundPreviewImpl(pParent); + return VclPtr<BackgroundPreviewImpl>::Create(pParent); } void BackgroundPreviewImpl::setBmp(bool bBmp) diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index 15c9541611aa..42da252257c8 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -796,7 +796,7 @@ VCL_BUILDER_DECL_FACTORY(SvxCropExample) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SvxCropExample(pParent, nWinStyle); + return VclPtr<SvxCropExample>::Create(pParent, nWinStyle); } void SvxCropExample::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx index 35b58d9154ec..b5c549d87340 100644 --- a/dbaccess/source/ui/control/curledit.cxx +++ b/dbaccess/source/ui/control/curledit.cxx @@ -37,7 +37,7 @@ OConnectionURLEdit::OConnectionURLEdit(vcl::Window* _pParent, WinBits _nBits,boo VCL_BUILDER_DECL_FACTORY(ConnectionURLEdit) { (void)rMap; - return new OConnectionURLEdit(pParent, WB_BORDER, false); + return VclPtr<OConnectionURLEdit>::Create(pParent, WB_BORDER, false); } OConnectionURLEdit::~OConnectionURLEdit() diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 8b54d8d4b673..e262dee8582d 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -81,7 +81,7 @@ VCL_BUILDER_DECL_FACTORY(OTableTreeListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new OTableTreeListBox(pParent, nWinStyle); + return VclPtr<OTableTreeListBox>::Create(pParent, nWinStyle); } void OTableTreeListBox::implSetDefaultImages() diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index 50d91c8f5244..8982bc5792a3 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -106,7 +106,7 @@ namespace dbaui VCL_BUILDER_DECL_FACTORY(DbaIndexFieldsControl) { (void)rMap; - return new IndexFieldsControl (pParent, WB_BORDER | WB_NOTABSTOP); + return VclPtr<IndexFieldsControl>::Create(pParent, WB_BORDER | WB_NOTABSTOP); } IndexFieldsControl::~IndexFieldsControl() diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 37e653e1ad00..f3a4cfdcda76 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -199,7 +199,7 @@ void ExtBoxWithBtns_Impl::InitFromDialog(ExtMgrDialog *pParentDialog) VCL_BUILDER_DECL_FACTORY(ExtBoxWithBtns) { (void)rMap; - return new ExtBoxWithBtns_Impl(pParent); + return VclPtr<ExtBoxWithBtns_Impl>::Create(pParent); } diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 26b577ebab7d..a32897e8f12c 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -833,7 +833,7 @@ Size ExtensionBox_Impl::GetOptimalSize() const VCL_BUILDER_DECL_FACTORY(ExtensionBox) { (void)rMap; - return new ExtensionBox_Impl(pParent); + return VclPtr<ExtensionBox_Impl>::Create(pParent); } long ExtensionBox_Impl::PointToPos( const Point& rPos ) diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx index 141d64b2ddc7..ff682c8de596 100644 --- a/desktop/source/deployment/gui/license_dialog.cxx +++ b/desktop/source/deployment/gui/license_dialog.cxx @@ -132,7 +132,7 @@ VCL_BUILDER_DECL_FACTORY(LicenseView) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new LicenseView(pParent, nWinStyle | WB_VSCROLL); + return VclPtr<LicenseView>::Create(pParent, nWinStyle | WB_VSCROLL); } LicenseView::~LicenseView() diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx index 63ce93e4948b..8f82b773520f 100644 --- a/extensions/source/propctrlr/taborder.cxx +++ b/extensions/source/propctrlr/taborder.cxx @@ -311,10 +311,9 @@ namespace pcr OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new TabOrderListBox(pParent, nWinStyle); + return VclPtr<TabOrderListBox>::Create(pParent, nWinStyle); } - TabOrderListBox::~TabOrderListBox() { } diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index 68f774525eb3..5a3379f1bc3e 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -158,7 +158,7 @@ VCL_BUILDER_DECL_FACTORY(ScanPreview) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new ScanPreview(pParent, nWinStyle); + return VclPtr<ScanPreview>::Create(pParent, nWinStyle); } SaneDlg::SaneDlg( vcl::Window* pParent, Sane& rSane, bool bScanEnabled ) : diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx index 9355b5e1ebb1..b119122f3c96 100644 --- a/formula/source/ui/dlg/funcutl.cxx +++ b/formula/source/ui/dlg/funcutl.cxx @@ -489,7 +489,7 @@ RefEdit::RefEdit( vcl::Window* _pParent,IControlReferenceHandler* pParent, VCL_BUILDER_DECL_FACTORY(RefEdit) { (void)rMap; - return new RefEdit(pParent, NULL, WB_BORDER); + return VclPtr<RefEdit>::Create(pParent, nullptr, WB_BORDER); } RefEdit::~RefEdit() diff --git a/include/vcl/builderfactory.hxx b/include/vcl/builderfactory.hxx index b50a557f4065..473e4516d227 100644 --- a/include/vcl/builderfactory.hxx +++ b/include/vcl/builderfactory.hxx @@ -10,24 +10,25 @@ #ifndef INCLUDED_VCL_BUILDER_FACTORY_HXX #define INCLUDED_VCL_BUILDER_FACTORY_HXX +#include <vcl/vclptr.hxx> #include <vcl/builder.hxx> #define VCL_BUILDER_DECL_FACTORY(typeName) \ - extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL \ + extern "C" SAL_DLLPUBLIC_EXPORT VclPtr<vcl::Window> SAL_CALL \ make##typeName(vcl::Window *pParent, VclBuilder::stringmap &rMap) #define VCL_BUILDER_FACTORY(typeName) \ VCL_BUILDER_DECL_FACTORY(typeName) \ { \ (void)rMap; \ - return new typeName(pParent); \ + return VclPtr<typeName>::Create(pParent); \ } #define VCL_BUILDER_FACTORY_ARGS(typeName,arg1) \ VCL_BUILDER_DECL_FACTORY(typeName) \ { \ (void)rMap; \ - return new typeName(pParent,arg1); \ + return VclPtr<typeName>::Create(pParent,arg1); \ } #endif diff --git a/sc/source/ui/cctrl/editfield.cxx b/sc/source/ui/cctrl/editfield.cxx index 78650e663c85..864bfc0fddbf 100644 --- a/sc/source/ui/cctrl/editfield.cxx +++ b/sc/source/ui/cctrl/editfield.cxx @@ -49,7 +49,7 @@ ScDoubleField::ScDoubleField( vcl::Window* pParent, WinBits nStyle ) : VCL_BUILDER_DECL_FACTORY(ScDoubleField) { VclBuilder::ensureDefaultWidthChars(rMap); - return new ScDoubleField(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK); + return VclPtr<ScDoubleField>::Create(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK); } bool ScDoubleField::GetValue( double& rfValue ) const diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 0e2cbf5738d5..2ec29d676811 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -151,7 +151,7 @@ VCL_BUILDER_DECL_FACTORY(ScCondFormatList) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new ScCondFormatList(pParent, nWinBits); + return VclPtr<ScCondFormatList>::Create(pParent, nWinBits); } Size ScCondFormatList::GetOptimalSize() const diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 8ef5c95ed950..617efcc33ed4 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -163,7 +163,7 @@ VCL_BUILDER_DECL_FACTORY(ScDPFunctionListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new ScDPFunctionListBox(pParent, nWinStyle); + return VclPtr<ScDPFunctionListBox>::Create(pParent, nWinStyle); } void ScDPFunctionListBox::SetSelection( sal_uInt16 nFuncMask ) diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 187fefdddfe3..67d435cfa301 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -940,7 +940,7 @@ bool ScValidationDlg::RemoveRefDlg( bool bRestoreModal /* = true */ ) VCL_BUILDER_DECL_FACTORY(ScRefButtonEx) { (void)rMap; - return new ScTPValidationValue::ScRefButtonEx(pParent, 0); + return VclPtr<ScTPValidationValue::ScRefButtonEx>::Create(pParent, 0); } void ScTPValidationValue::ScRefButtonEx::Click() diff --git a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx index 55aacefed994..477f5199bbb4 100644 --- a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx +++ b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx @@ -166,7 +166,7 @@ VCL_BUILDER_DECL_FACTORY(ScTabBgColorValueSet) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new ScTabBgColorDlg::ScTabBgColorValueSet(pParent, nWinBits); + return VclPtr<ScTabBgColorDlg::ScTabBgColorValueSet>::Create(pParent, nWinBits); } void ScTabBgColorDlg::ScTabBgColorValueSet::KeyInput( const KeyEvent& rKEvt ) diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 38ed89456f5d..7b1af0a6610d 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -139,7 +139,7 @@ void ScEditWindow::dispose() VCL_BUILDER_DECL_FACTORY(ScEditWindow) { (void)rMap; - return new ScEditWindow (pParent, WB_BORDER|WB_TABSTOP, Left); + return VclPtr<ScEditWindow>::Create(pParent, WB_BORDER|WB_TABSTOP, Left); } void ScEditWindow::SetNumType(SvxNumType eNumType) diff --git a/sd/source/filter/html/htmlattr.cxx b/sd/source/filter/html/htmlattr.cxx index 3f4db20ae2ed..403da9e996c9 100644 --- a/sd/source/filter/html/htmlattr.cxx +++ b/sd/source/filter/html/htmlattr.cxx @@ -35,7 +35,7 @@ VCL_BUILDER_DECL_FACTORY(SdHtmlAttrPreview) if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SdHtmlAttrPreview(pParent, nWinStyle); + return VclPtr<SdHtmlAttrPreview>::Create(pParent, nWinStyle); } SdHtmlAttrPreview::~SdHtmlAttrPreview() diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx index 4c8bcf9df530..0aca3c7fbfbd 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx @@ -115,7 +115,7 @@ VCL_BUILDER_DECL_FACTORY(ClientBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new ClientBox(pParent, nWinStyle); + return VclPtr<ClientBox>::Create(pParent, nWinStyle); } Size ClientBox::GetOptimalSize() const diff --git a/sd/source/ui/dlg/dlgassim.cxx b/sd/source/ui/dlg/dlgassim.cxx index 2c308f7a2021..b281431d3de2 100644 --- a/sd/source/ui/dlg/dlgassim.cxx +++ b/sd/source/ui/dlg/dlgassim.cxx @@ -55,7 +55,7 @@ VCL_BUILDER_DECL_FACTORY(SdPageListControl) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SdPageListControl(pParent, nWinStyle); + return VclPtr<SdPageListControl>::Create(pParent, nWinStyle); } IMPL_LINK_NOARG(SdPageListControl, CheckButtonClickHdl) diff --git a/sd/source/ui/dlg/dlgctrls.cxx b/sd/source/ui/dlg/dlgctrls.cxx index 325632103449..8eda4c4ee1e1 100644 --- a/sd/source/ui/dlg/dlgctrls.cxx +++ b/sd/source/ui/dlg/dlgctrls.cxx @@ -81,7 +81,7 @@ VCL_BUILDER_DECL_FACTORY(FadeEffectLB) if (bDropdown) nBits |= WB_DROPDOWN; - return new FadeEffectLB(pParent, nBits); + return VclPtr<FadeEffectLB>::Create(pParent, nBits); } void FadeEffectLB::applySelected( SdPage* pSlide ) const diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index e0cba089de3e..6e71e3c0412d 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -70,7 +70,7 @@ VCL_BUILDER_DECL_FACTORY(SdDocPreviewWin) if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SdDocPreviewWin(pParent, nWinStyle); + return VclPtr<SdDocPreviewWin>::Create(pParent, nWinStyle); } SdDocPreviewWin::SdDocPreviewWin( vcl::Window* pParent, const WinBits nStyle ) diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 0a3c3f4f2dec..4a1bf4b8a1d5 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -104,7 +104,7 @@ VCL_BUILDER_DECL_FACTORY(SdPageObjsTLB) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SdPageObjsTLB(pParent, nWinStyle); + return VclPtr<SdPageObjsTLB>::Create(pParent, nWinStyle); } SdPageObjsTLB::SdPageObjsTransferable::~SdPageObjsTransferable() diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index a4ecc26871b9..0d708e6a7c5c 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -372,7 +372,7 @@ VCL_BUILDER_DECL_FACTORY(TableValueSet) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new TableValueSet(pParent, nWinStyle); + return VclPtr<TableValueSet>::Create(pParent, nWinStyle); } void TableDesignWidget::updateControls() diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 3b261724f1d4..0f147606eeef 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -297,7 +297,7 @@ VCL_BUILDER_DECL_FACTORY(ContentListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new ContentListBox_Impl(pParent, nWinStyle); + return VclPtr<ContentListBox_Impl>::Create(pParent, nWinStyle); } ContentListBox_Impl::~ContentListBox_Impl() @@ -490,7 +490,7 @@ VCL_BUILDER_DECL_FACTORY(IndexBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - IndexBox_Impl* pListBox = new IndexBox_Impl(pParent, nWinBits); + VclPtrInstance<IndexBox_Impl> pListBox(pParent, nWinBits); pListBox->EnableAutoSize(true); return pListBox; } @@ -875,7 +875,7 @@ VCL_BUILDER_DECL_FACTORY(SearchBox) { (void)rMap; WinBits nWinBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE|WB_DROPDOWN; - SearchBox_Impl* pComboBox = new SearchBox_Impl(pParent, nWinBits); + VclPtrInstance<SearchBox_Impl> pComboBox(pParent, nWinBits); pComboBox->EnableAutoSize(true); return pComboBox; } @@ -910,7 +910,7 @@ VCL_BUILDER_DECL_FACTORY(SearchResultsBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - SearchResultsBox_Impl* pListBox = new SearchResultsBox_Impl(pParent, nWinBits); + VclPtrInstance<SearchResultsBox_Impl> pListBox(pParent, nWinBits); pListBox->EnableAutoSize(true); return pListBox; } @@ -1177,7 +1177,7 @@ VCL_BUILDER_DECL_FACTORY(BookmarksBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - BookmarksBox_Impl* pListBox = new BookmarksBox_Impl(pParent, nWinBits); + VclPtrInstance<BookmarksBox_Impl> pListBox(pParent, nWinBits); pListBox->EnableAutoSize(true); return pListBox; } diff --git a/sfx2/source/control/templateremoteview.cxx b/sfx2/source/control/templateremoteview.cxx index ffc0b7b3b3f1..144964595b3a 100644 --- a/sfx2/source/control/templateremoteview.cxx +++ b/sfx2/source/control/templateremoteview.cxx @@ -57,7 +57,7 @@ TemplateRemoteView::TemplateRemoteView (vcl::Window *pParent, WinBits nWinStyle, VCL_BUILDER_DECL_FACTORY(TemplateRemoteView) { (void)rMap; - return new TemplateRemoteView(pParent, WB_VSCROLL, false); + return VclPtr<TemplateRemoteView>::Create(pParent, WB_VSCROLL, false); } void TemplateRemoteView::showRootRegion() diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index c9e8a2a12ecf..ea4ca888cffe 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -119,7 +119,7 @@ void SfxPreviewWin_Impl::Paint( vcl::RenderContext& /*rRenderContext*/, const Re VCL_BUILDER_DECL_FACTORY(SfxPreviewWin) { (void)rMap; - return new SfxPreviewWin_Impl(pParent, 0); + return VclPtr<SfxPreviewWin_Impl>::Create(pParent, 0); } class SfxNewFileDialog_Impl diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 24d2ee4e00c5..f1be8febad6c 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -264,7 +264,7 @@ VCL_BUILDER_DECL_FACTORY(SmShowFont) if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SmShowFont(pParent, nWinStyle); + return VclPtr<SmShowFont>::Create(pParent, nWinStyle); } Size SmShowFont::GetOptimalSize() const @@ -1405,7 +1405,7 @@ VCL_BUILDER_DECL_FACTORY(SmShowSymbol) if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SmShowSymbol(pParent, nWinStyle); + return VclPtr<SmShowSymbol>::Create(pParent, nWinStyle); } void SmShowSymbol::Resize() @@ -1699,7 +1699,7 @@ VCL_BUILDER_DECL_FACTORY(SmShowChar) if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SmShowChar(pParent, nWinStyle); + return VclPtr<SmShowChar>::Create(pParent, nWinStyle); } void SmShowChar::Paint(vcl::RenderContext& rRenderContext, const Rectangle &rRect) diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 60e53181b427..556ea85b6a81 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1130,11 +1130,9 @@ VCL_BUILDER_DECL_FACTORY(SvtFileView) if (bDropdown) nBits |= WB_DROPDOWN; - return new SvtFileView(pParent, nBits, true, true); + return VclPtr<SvtFileView>::Create(pParent, nBits, true, true); } - - Size SvtFileView::GetOptimalSize() const { return LogicToPixel(Size(208, 50), MAP_APPFONT); diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index 0bcd09b28a19..b13079d3bfda 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -104,7 +104,7 @@ VCL_BUILDER_DECL_FACTORY(SvTabListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SvTabListBox(pParent, nWinStyle); + return VclPtr<SvTabListBox>::Create(pParent, nWinStyle); } SvTabListBox::~SvTabListBox() diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 097adedd94f0..2c113afc7adf 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -440,7 +440,7 @@ VCL_BUILDER_DECL_FACTORY(SvTreeListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SvTreeListBox(pParent, nWinStyle); + return VclPtr<SvTreeListBox>::Create(pParent, nWinStyle); } void SvTreeListBox::Clear() diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 2be6e63e770f..c7926f10357f 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -110,7 +110,7 @@ VCL_BUILDER_DECL_FACTORY(ColorListBox) WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; - ColorListBox *pListBox = new ColorListBox(pParent, nWinBits); + VclPtrInstance<ColorListBox> pListBox(pParent, nWinBits); if (bDropdown) pListBox->EnableAutoSize(true); return pListBox; @@ -742,7 +742,7 @@ VCL_BUILDER_DECL_FACTORY(LineListBox) WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; - LineListBox *pListBox = new LineListBox(pParent, nWinBits); + VclPtrInstance<LineListBox> pListBox(pParent, nWinBits); if (bDropdown) pListBox->EnableAutoSize(true); return pListBox; @@ -945,7 +945,7 @@ VCL_BUILDER_DECL_FACTORY(FontNameBox) WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; - FontNameBox *pListBox = new FontNameBox(pParent, nWinBits); + VclPtrInstance<FontNameBox> pListBox(pParent, nWinBits); if (bDropdown) pListBox->EnableAutoSize(true); return pListBox; @@ -1333,7 +1333,7 @@ VCL_BUILDER_DECL_FACTORY(FontStyleBox) WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; - FontStyleBox *pListBox = new FontStyleBox(pParent, nWinBits); + VclPtrInstance<FontStyleBox> pListBox(pParent, nWinBits); if (bDropdown) pListBox->EnableAutoSize(true); return pListBox; @@ -1529,7 +1529,7 @@ VCL_BUILDER_DECL_FACTORY(FontSizeBox) WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; - FontSizeBox* pListBox = new FontSizeBox(pParent, nWinBits); + VclPtrInstance<FontSizeBox> pListBox(pParent, nWinBits); if (bDropdown) pListBox->EnableAutoSize(true); return pListBox; diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index fe9a3ac034e8..29b7eec8c88e 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -868,7 +868,7 @@ VCL_BUILDER_DECL_FACTORY(SvtURLBox) (void)rMap; WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP| WB_DROPDOWN|WB_AUTOSIZE|WB_AUTOHSCROLL; - SvtURLBox* pListBox = new SvtURLBox(pParent, nWinBits, INetProtocol::NotValid, false); + VclPtrInstance<SvtURLBox> pListBox(pParent, nWinBits, INetProtocol::NotValid, false); pListBox->EnableAutoSize(true); return pListBox; } diff --git a/svtools/source/control/urlcontrol.cxx b/svtools/source/control/urlcontrol.cxx index 8a268d75e4c8..6edcd8ee0bfe 100644 --- a/svtools/source/control/urlcontrol.cxx +++ b/svtools/source/control/urlcontrol.cxx @@ -36,7 +36,7 @@ namespace svt (void)rMap; WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP| WB_DROPDOWN|WB_AUTOSIZE|WB_AUTOHSCROLL; - OFileURLControl* pListBox = new OFileURLControl(pParent, nWinBits); + VclPtrInstance<OFileURLControl> pListBox(pParent, nWinBits); pListBox->EnableAutoSize(true); return pListBox; } diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 28bee3593a83..070e16aca71a 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -111,7 +111,7 @@ VCL_BUILDER_DECL_FACTORY(ValueSet) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new ValueSet(pParent, nWinBits); + return VclPtr<ValueSet>::Create(pParent, nWinBits); } ValueSet::ValueSet( vcl::Window* pParent, const ResId& rResId, bool bDisableTransientChildren ) : diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx index 66527a7132fb..fb86f8c0ee46 100644 --- a/svx/source/dialog/checklbx.cxx +++ b/svx/source/dialog/checklbx.cxx @@ -37,7 +37,7 @@ VCL_BUILDER_DECL_FACTORY(SvxCheckListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SvxCheckListBox(pParent, nWinStyle); + return VclPtr<SvxCheckListBox>::Create(pParent, nWinStyle); } void SvxCheckListBox::SetNormalStaticImage(const Image& rNormalStaticImage) diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index a130f9f858fa..d24326dfe89b 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -52,7 +52,7 @@ VCL_BUILDER_DECL_FACTORY(SvxXConnectionPreview) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SvxXConnectionPreview(pParent, nWinStyle); + return VclPtr<SvxXConnectionPreview>::Create(pParent, nWinStyle); } SvxXConnectionPreview::~SvxXConnectionPreview() diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index ad7c410a690d..1019bf43b19b 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1141,7 +1141,7 @@ VCL_BUILDER_DECL_FACTORY(ColorLB) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - ColorLB *pListBox = new ColorLB(pParent, nWinBits); + VclPtrInstance<ColorLB> pListBox(pParent, nWinBits); pListBox->EnableAutoSize(true); return pListBox; } @@ -1193,7 +1193,7 @@ VCL_BUILDER_DECL_FACTORY(HatchingLB) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - HatchingLB *pListBox = new HatchingLB(pParent, nWinStyle); + VclPtrInstance<HatchingLB> pListBox(pParent, nWinStyle); pListBox->EnableAutoSize(true); return pListBox; } @@ -1286,7 +1286,7 @@ VCL_BUILDER_DECL_FACTORY(GradientLB) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - GradientLB *pListBox = new GradientLB(pParent, nWinStyle); + VclPtrInstance<GradientLB> pListBox(pParent, nWinStyle); pListBox->EnableAutoSize(true); return pListBox; } @@ -1402,7 +1402,7 @@ VCL_BUILDER_DECL_FACTORY(BitmapLB) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - BitmapLB *pListBox = new BitmapLB(pParent, nWinStyle); + VclPtrInstance<BitmapLB> pListBox(pParent, nWinStyle); pListBox->EnableAutoSize(true); return pListBox; } @@ -1575,7 +1575,7 @@ VCL_BUILDER_DECL_FACTORY(LineLB) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - LineLB *pListBox = new LineLB(pParent, nWinBits); + VclPtrInstance<LineLB> pListBox(pParent, nWinBits); pListBox->EnableAutoSize(true); return pListBox; } @@ -1673,7 +1673,7 @@ VCL_BUILDER_DECL_FACTORY(LineEndLB) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - LineEndLB *pListBox = new LineEndLB(pParent, nWinBits); + VclPtrInstance<LineEndLB> pListBox(pParent, nWinBits); pListBox->EnableAutoSize(true); return pListBox; } diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index a1bb1d4c8289..820a6d3b57c9 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -496,8 +496,7 @@ VCL_BUILDER_DECL_FACTORY(SvxFontPrevWindow) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - SvxFontPrevWindow *pWindow = new SvxFontPrevWindow(pParent, nWinStyle); - return pWindow; + return VclPtr<SvxFontPrevWindow>::Create(pParent, nWinStyle); } SvxFontPrevWindow::~SvxFontPrevWindow() diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx index 625bbd37f7ac..59f8a598880c 100644 --- a/svx/source/dialog/fontlb.cxx +++ b/svx/source/dialog/fontlb.cxx @@ -95,7 +95,7 @@ VCL_BUILDER_DECL_FACTORY(SvxFontListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SvxFontListBox(pParent, nWinStyle); + return VclPtr<SvxFontListBox>::Create(pParent, nWinStyle); } void SvxFontListBox::InsertFontEntry( const OUString& rString, const vcl::Font& rFont, const Color* pColor ) diff --git a/svx/source/dialog/frmdirlbox.cxx b/svx/source/dialog/frmdirlbox.cxx index ef87c9f98c10..237d8e58e19a 100644 --- a/svx/source/dialog/frmdirlbox.cxx +++ b/svx/source/dialog/frmdirlbox.cxx @@ -45,7 +45,7 @@ FrameDirectionListBox::FrameDirectionListBox( vcl::Window* pParent, WinBits nBit VCL_BUILDER_DECL_FACTORY(FrameDirectionListBox) { (void)rMap; - FrameDirectionListBox* pListBox = new FrameDirectionListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP); + VclPtrInstance<FrameDirectionListBox> pListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP); pListBox->EnableAutoSize(true); return pListBox; } diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index 567bc36b9e13..50a09fe5bc91 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -799,7 +799,7 @@ FrameSelector::~FrameSelector() VCL_BUILDER_DECL_FACTORY(SvxFrameSelector) { (void)rMap; - return new FrameSelector(pParent); + return VclPtr<FrameSelector>::Create(pParent); } void FrameSelector::Initialize( FrameSelFlags nFlags ) diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index f1b3a9e51717..ab5369939dbf 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -80,7 +80,7 @@ VCL_BUILDER_DECL_FACTORY(GraphCtrl) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new GraphCtrl(pParent, nWinStyle); + return VclPtr<GraphCtrl>::Create(pParent, nWinStyle); } GraphCtrl::~GraphCtrl() diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 9311c53b9207..d61862794f66 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -111,7 +111,7 @@ VCL_BUILDER_DECL_FACTORY(SvxLanguageBox) nBits |= WB_DROPDOWN; else nBits |= WB_BORDER; - SvxLanguageBox *pLanguageBox = new SvxLanguageBox(pParent, nBits); + VclPtrInstance<SvxLanguageBox> pLanguageBox(pParent, nBits); pLanguageBox->EnableAutoSize(true); return pLanguageBox; } @@ -124,7 +124,7 @@ VCL_BUILDER_DECL_FACTORY(SvxLanguageComboBox) nBits |= WB_DROPDOWN; else nBits |= WB_BORDER; - SvxLanguageComboBox *pLanguageBox = new SvxLanguageComboBox(pParent, nBits); + VclPtrInstance<SvxLanguageComboBox> pLanguageBox(pParent, nBits); pLanguageBox->EnableAutoSize(true); return pLanguageBox; } diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx index a9c3a9e3f70c..e07b932e2169 100644 --- a/svx/source/dialog/measctrl.cxx +++ b/svx/source/dialog/measctrl.cxx @@ -68,7 +68,7 @@ VCL_BUILDER_DECL_FACTORY(SvxXMeasurePreview) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SvxXMeasurePreview(pParent, nWinStyle); + return VclPtr<SvxXMeasurePreview>::Create(pParent, nWinStyle); } Size SvxXMeasurePreview::GetOptimalSize() const diff --git a/svx/source/dialog/relfld.cxx b/svx/source/dialog/relfld.cxx index 6e177aa02cb2..de7734408b0b 100644 --- a/svx/source/dialog/relfld.cxx +++ b/svx/source/dialog/relfld.cxx @@ -18,9 +18,7 @@ */ #include "svx/relfld.hxx" -#include "vcl/builder.hxx" - - +#include "vcl/builderfactory.hxx" SvxRelativeField::SvxRelativeField( vcl::Window *const pParent, WinBits const nBits, FieldUnit const eUnit) @@ -39,17 +37,16 @@ SvxRelativeField::SvxRelativeField( SetMax( 9999 ); } -extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL -makeSvxRelativeField(vcl::Window *const pParent, VclBuilder::stringmap & rMap) +VCL_BUILDER_DECL_FACTORY(SvxRelativeField) { OString const custom(VclBuilder::extractCustomProperty(rMap)); FieldUnit const eUnit(VclBuilder::detectUnit(custom)); - SvxRelativeField *const pRet = new SvxRelativeField(pParent, - WB_BORDER | WB_SPIN | WB_REPEAT | WB_LEFT | WB_GROUP, eUnit); - return pRet; + return VclPtr<SvxRelativeField>::Create(pParent, + WB_BORDER | WB_SPIN | WB_REPEAT | + WB_LEFT | WB_GROUP, + eUnit); } - void SvxRelativeField::Modify() { MetricField::Modify(); diff --git a/svx/source/dialog/txencbox.cxx b/svx/source/dialog/txencbox.cxx index c038a5d365d2..8cf6dcc5d3f9 100644 --- a/svx/source/dialog/txencbox.cxx +++ b/svx/source/dialog/txencbox.cxx @@ -48,15 +48,12 @@ VCL_BUILDER_DECL_FACTORY(SvxTextEncodingBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - SvxTextEncodingBox *pListBox = new SvxTextEncodingBox(pParent, nWinBits); + VclPtrInstance<SvxTextEncodingBox> pListBox(pParent, nWinBits); if (bDropdown) pListBox->EnableAutoSize(true); - return pListBox; } - - SvxTextEncodingBox::~SvxTextEncodingBox() { disposeOnce(); @@ -68,8 +65,6 @@ void SvxTextEncodingBox::dispose() ListBox::dispose(); } - - sal_Int32 SvxTextEncodingBox::EncodingToPos_Impl( rtl_TextEncoding nEnc ) const { sal_Int32 nCount = GetEntryCount(); diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index ba1d4b9a899a..3a45e8571608 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -54,7 +54,7 @@ VCL_BUILDER_DECL_FACTORY(GalleryPreview) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new GalleryPreview(pParent, nWinBits); + return VclPtr<GalleryPreview>::Create(pParent, nWinBits); } Size GalleryPreview::GetOptimalSize() const diff --git a/svx/source/tbxctrls/SvxColorValueSet.cxx b/svx/source/tbxctrls/SvxColorValueSet.cxx index ef448a40720a..cec4efc10128 100644 --- a/svx/source/tbxctrls/SvxColorValueSet.cxx +++ b/svx/source/tbxctrls/SvxColorValueSet.cxx @@ -37,7 +37,7 @@ VCL_BUILDER_DECL_FACTORY(SvxColorValueSet) if (!sBorder.isEmpty()) nWinBits |= WB_BORDER; - return new SvxColorValueSet(pParent, nWinBits); + return VclPtr<SvxColorValueSet>::Create(pParent, nWinBits); } sal_uInt32 SvxColorValueSet::getMaxRowCount() diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 424760646e80..8efc4a547827 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -394,7 +394,7 @@ VCL_BUILDER_DECL_FACTORY(SwCaptionPreview) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nBits |= WB_BORDER; - return new SwCaptionPreview(pParent, nBits); + return VclPtr<SwCaptionPreview>::Create(pParent, nBits); } void SwCaptionPreview::Init() @@ -940,7 +940,7 @@ VCL_BUILDER_DECL_FACTORY(CaptionComboBox) bool bDropdown = VclBuilder::extractDropdown(rMap); if (bDropdown) nBits |= WB_DROPDOWN; - CaptionComboBox* pComboBox = new CaptionComboBox(pParent, nBits); + VclPtrInstance<CaptionComboBox> pComboBox(pParent, nBits); pComboBox->EnableAutoSize(true); return pComboBox; } diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index a9c122664ca4..dffdc5977e1d 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -111,7 +111,7 @@ SwAddressControl_Impl::SwAddressControl_Impl(vcl::Window* pParent, WinBits nBits VCL_BUILDER_DECL_FACTORY(SwAddressControlImpl) { (void)rMap; - return new SwAddressControl_Impl(pParent, WB_BORDER | WB_DIALOGCONTROL); + return VclPtr<SwAddressControl_Impl>::Create(pParent, WB_BORDER | WB_DIALOGCONTROL); } SwAddressControl_Impl::~SwAddressControl_Impl() diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 2c25df2e318d..0beb28e1abde 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -1292,7 +1292,7 @@ VCL_BUILDER_DECL_FACTORY(DDListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new DDListBox(pParent, nWinStyle); + return VclPtr<DDListBox>::Create(pParent, nWinStyle); } void DDListBox::SetAddressDialog(SwCustomizeAddressBlockDialog *pParent) @@ -1354,7 +1354,7 @@ VCL_BUILDER_DECL_FACTORY(AddressMultiLineEdit) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new AddressMultiLineEdit(pParent, nWinStyle); + return VclPtr<AddressMultiLineEdit>::Create(pParent, nWinStyle); } void AddressMultiLineEdit::SetAddressDialog(SwCustomizeAddressBlockDialog *pParent) diff --git a/sw/source/ui/fldui/FldRefTreeListBox.cxx b/sw/source/ui/fldui/FldRefTreeListBox.cxx index c84b5c45e73b..313b42bbf0e2 100644 --- a/sw/source/ui/fldui/FldRefTreeListBox.cxx +++ b/sw/source/ui/fldui/FldRefTreeListBox.cxx @@ -34,7 +34,7 @@ VCL_BUILDER_DECL_FACTORY(SwFldRefTreeListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SwFldRefTreeListBox(pParent, nWinStyle); + return VclPtr<SwFldRefTreeListBox>::Create(pParent, nWinStyle); } void SwFldRefTreeListBox::RequestHelp( const HelpEvent& rHEvt ) diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index 8da46a400a26..9528c1870025 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -1276,9 +1276,8 @@ VCL_BUILDER_DECL_FACTORY(SelectionListBox) if (!sBorder.isEmpty()) nBits |= WB_BORDER; - SelectionListBox* pListBox = new SelectionListBox(pParent, nBits|WB_SIMPLEMODE); + VclPtrInstance<SelectionListBox> pListBox(pParent, nBits|WB_SIMPLEMODE); pListBox->EnableAutoSize(true); - return pListBox; } diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 2bac0f544ae7..f9f3e029f7f7 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1765,7 +1765,7 @@ VCL_BUILDER_DECL_FACTORY(SwIdxTreeListBox) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SwIdxTreeListBox(pParent, nWinStyle); + return VclPtr<SwIdxTreeListBox>::Create(pParent, nWinStyle); } void SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt ) diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 3332023cd12f..439057f1215b 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -539,7 +539,7 @@ VCL_BUILDER_DECL_FACTORY(AutoFmtPreview) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new AutoFmtPreview(pParent, nWinStyle); + return VclPtr<AutoFmtPreview>::Create(pParent, nWinStyle); } void AutoFmtPreview::Resize() diff --git a/sw/source/uibase/cctrl/actctrl.cxx b/sw/source/uibase/cctrl/actctrl.cxx index 119dbb39c3af..107048c61967 100644 --- a/sw/source/uibase/cctrl/actctrl.cxx +++ b/sw/source/uibase/cctrl/actctrl.cxx @@ -65,7 +65,7 @@ void ReturnActionEdit::KeyInput( const KeyEvent& rEvt) VCL_BUILDER_DECL_FACTORY(ReturnActionEdit) { VclBuilder::ensureDefaultWidthChars(rMap); - return new ReturnActionEdit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK); + return VclPtr<ReturnActionEdit>::Create(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx index 0e9fa0d0f28e..13729c613a60 100644 --- a/sw/source/uibase/dbui/dbtree.cxx +++ b/sw/source/uibase/dbui/dbtree.cxx @@ -186,7 +186,7 @@ VCL_BUILDER_DECL_FACTORY(SwDBTreeList) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nStyle |= WB_BORDER; - return new SwDBTreeList(pParent, nStyle); + return VclPtr<SwDBTreeList>::Create(pParent, nStyle); } Size SwDBTreeList::GetOptimalSize() const diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index d827f70e472f..1fcdfd52e634 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -213,7 +213,7 @@ VCL_BUILDER_DECL_FACTORY(SwAddressPreview) OString sBorder = VclBuilder::extractCustomProperty(rMap); if (!sBorder.isEmpty()) nWinStyle |= WB_BORDER; - return new SwAddressPreview(pParent, nWinStyle); + return VclPtr<SwAddressPreview>::Create(pParent, nWinStyle); } void SwAddressPreview::positionScrollBar() diff --git a/sw/source/uibase/misc/numberingtypelistbox.cxx b/sw/source/uibase/misc/numberingtypelistbox.cxx index 30b6b05a6640..4e0c96137829 100644 --- a/sw/source/uibase/misc/numberingtypelistbox.cxx +++ b/sw/source/uibase/misc/numberingtypelistbox.cxx @@ -58,7 +58,7 @@ bool SwNumberingTypeListBox::set_property(const OString &rKey, const OString &rV VCL_BUILDER_DECL_FACTORY(SwNumberingTypeListBox) { (void)rMap; - SwNumberingTypeListBox *pListBox = new SwNumberingTypeListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP); + VclPtrInstance<SwNumberingTypeListBox> pListBox(pParent, WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_TABSTOP); pListBox->EnableAutoSize(true); return pListBox; } diff --git a/sw/source/uibase/utlui/condedit.cxx b/sw/source/uibase/utlui/condedit.cxx index 907ac1f4d5e0..9bda327890dd 100644 --- a/sw/source/uibase/utlui/condedit.cxx +++ b/sw/source/uibase/utlui/condedit.cxx @@ -37,7 +37,7 @@ ConditionEdit::ConditionEdit(vcl::Window* pParent, WinBits nStyle) VCL_BUILDER_DECL_FACTORY(ConditionEdit) { VclBuilder::ensureDefaultWidthChars(rMap); - return new ConditionEdit(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK); + return VclPtr<ConditionEdit>::Create(pParent, WB_LEFT|WB_VCENTER|WB_BORDER|WB_3DLOOK); } // Drop possible, respectively format known? diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx index 32bab7f225b7..adafb24a2c7a 100644 --- a/sw/source/uibase/utlui/numfmtlb.cxx +++ b/sw/source/uibase/utlui/numfmtlb.cxx @@ -80,7 +80,7 @@ VCL_BUILDER_DECL_FACTORY(NumFormatListBox) else nBits |= WB_BORDER; - NumFormatListBox* pListBox = new NumFormatListBox(pParent, nBits|WB_SIMPLEMODE); + VclPtrInstance<NumFormatListBox> pListBox(pParent, nBits|WB_SIMPLEMODE); if (bDropdown) pListBox->EnableAutoSize(true); diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index d687b60a8940..d8f01cd5d1c3 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1757,7 +1757,7 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & customMakeWidget pFunction = reinterpret_cast<customMakeWidget>(osl_getFunctionSymbol((oslModule) RTLD_DEFAULT, sFunction.pData)); #endif if (pFunction) - xWindow = VclPtr<vcl::Window>(pFunction(pParent, rMap), SAL_NO_ACQUIRE); + xWindow = pFunction(pParent, rMap); } } SAL_WARN_IF(!xWindow, "vcl.layout", "probably need to implement " << name.getStr() << " or add a make" << name.getStr() << " function"); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index ecc8d7afd487..af64afae18ce 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -55,13 +55,13 @@ using namespace com::sun::star::beans; VCL_BUILDER_DECL_FACTORY(PrintPreviewWindow) { (void)rMap; - return new PrintDialog::PrintPreviewWindow(pParent); + return VclPtr<PrintDialog::PrintPreviewWindow>::Create(pParent); } VCL_BUILDER_DECL_FACTORY(ShowNupOrderWindow) { (void)rMap; - return new PrintDialog::ShowNupOrderWindow(pParent); + return VclPtr<PrintDialog::ShowNupOrderWindow>::Create(pParent); } PrintDialog::PrintPreviewWindow::PrintPreviewWindow( vcl::Window* i_pParent ) |