[Libreoffice-commits] core.git: basctl/source chart2/source cui/source dbaccess/source desktop/source extensions/source formula/source include/vcl sc/source sd/source sfx2/source starmath/source svtools/source svx/source sw/source vcl/source

Michael Meeks michael.meeks at collabora.com
Mon May 11 07:07:57 PDT 2015


 basctl/source/basicide/bastype2.cxx                        |    2 -
 basctl/source/basicide/moduldl2.cxx                        |    2 -
 basctl/source/basicide/moduldlg.cxx                        |    4 ---
 chart2/source/controller/dialogs/tp_DataSourceControls.cxx |    2 -
 cui/source/customize/acccfg.cxx                            |    2 -
 cui/source/customize/cfgutil.cxx                           |    4 +--
 cui/source/customize/macropg.cxx                           |    2 -
 cui/source/customize/selector.cxx                          |    4 +--
 cui/source/dialogs/SpellDialog.cxx                         |    2 -
 cui/source/dialogs/colorpicker.cxx                         |    6 ++---
 cui/source/dialogs/cuigrfflt.cxx                           |    2 -
 cui/source/dialogs/hlmarkwn.cxx                            |    2 -
 cui/source/options/optcolor.cxx                            |    2 -
 cui/source/tabpages/autocdlg.cxx                           |    2 -
 cui/source/tabpages/backgrnd.cxx                           |    2 -
 cui/source/tabpages/grfpage.cxx                            |    2 -
 dbaccess/source/ui/control/curledit.cxx                    |    2 -
 dbaccess/source/ui/control/tabletree.cxx                   |    2 -
 dbaccess/source/ui/dlg/indexfieldscontrol.cxx              |    2 -
 desktop/source/deployment/gui/dp_gui_dialog2.cxx           |    2 -
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx        |    2 -
 desktop/source/deployment/gui/license_dialog.cxx           |    2 -
 extensions/source/propctrlr/taborder.cxx                   |    3 --
 extensions/source/scanner/sanedlg.cxx                      |    2 -
 formula/source/ui/dlg/funcutl.cxx                          |    2 -
 include/vcl/builderfactory.hxx                             |    7 +++---
 sc/source/ui/cctrl/editfield.cxx                           |    2 -
 sc/source/ui/condformat/condformatdlg.cxx                  |    2 -
 sc/source/ui/dbgui/pvfundlg.cxx                            |    2 -
 sc/source/ui/dbgui/validate.cxx                            |    2 -
 sc/source/ui/miscdlgs/tabbgcolordlg.cxx                    |    2 -
 sc/source/ui/pagedlg/tphfedit.cxx                          |    2 -
 sd/source/filter/html/htmlattr.cxx                         |    2 -
 sd/source/ui/dlg/RemoteDialogClientBox.cxx                 |    2 -
 sd/source/ui/dlg/dlgassim.cxx                              |    2 -
 sd/source/ui/dlg/dlgctrls.cxx                              |    2 -
 sd/source/ui/dlg/docprev.cxx                               |    2 -
 sd/source/ui/dlg/sdtreelb.cxx                              |    2 -
 sd/source/ui/table/TableDesignPane.cxx                     |    2 -
 sfx2/source/appl/newhelp.cxx                               |   10 ++++----
 sfx2/source/control/templateremoteview.cxx                 |    2 -
 sfx2/source/doc/new.cxx                                    |    2 -
 starmath/source/dialog.cxx                                 |    6 ++---
 svtools/source/contnr/fileview.cxx                         |    4 ---
 svtools/source/contnr/svtabbx.cxx                          |    2 -
 svtools/source/contnr/treelistbox.cxx                      |    2 -
 svtools/source/control/ctrlbox.cxx                         |   10 ++++----
 svtools/source/control/inettbc.cxx                         |    2 -
 svtools/source/control/urlcontrol.cxx                      |    2 -
 svtools/source/control/valueset.cxx                        |    2 -
 svx/source/dialog/checklbx.cxx                             |    2 -
 svx/source/dialog/connctrl.cxx                             |    2 -
 svx/source/dialog/dlgctrl.cxx                              |   12 +++++-----
 svx/source/dialog/fntctrl.cxx                              |    3 --
 svx/source/dialog/fontlb.cxx                               |    2 -
 svx/source/dialog/frmdirlbox.cxx                           |    2 -
 svx/source/dialog/frmsel.cxx                               |    2 -
 svx/source/dialog/graphctl.cxx                             |    2 -
 svx/source/dialog/langbox.cxx                              |    4 +--
 svx/source/dialog/measctrl.cxx                             |    2 -
 svx/source/dialog/relfld.cxx                               |   15 +++++--------
 svx/source/dialog/txencbox.cxx                             |    7 ------
 svx/source/gallery2/galctrl.cxx                            |    2 -
 svx/source/tbxctrls/SvxColorValueSet.cxx                   |    2 -
 sw/source/ui/config/optload.cxx                            |    4 +--
 sw/source/ui/dbui/createaddresslistdialog.cxx              |    2 -
 sw/source/ui/dbui/mmaddressblockpage.cxx                   |    4 +--
 sw/source/ui/fldui/FldRefTreeListBox.cxx                   |    2 -
 sw/source/ui/fldui/fldvar.cxx                              |    3 --
 sw/source/ui/index/cnttab.cxx                              |    2 -
 sw/source/ui/table/tautofmt.cxx                            |    2 -
 sw/source/uibase/cctrl/actctrl.cxx                         |    2 -
 sw/source/uibase/dbui/dbtree.cxx                           |    2 -
 sw/source/uibase/dbui/mailmergehelper.cxx                  |    2 -
 sw/source/uibase/misc/numberingtypelistbox.cxx             |    2 -
 sw/source/uibase/utlui/condedit.cxx                        |    2 -
 sw/source/uibase/utlui/numfmtlb.cxx                        |    2 -
 vcl/source/window/builder.cxx                              |    2 -
 vcl/source/window/printdlg.cxx                             |    4 +--
 79 files changed, 110 insertions(+), 124 deletions(-)

New commits:
commit 9f016bd69422bdfb4cf7c4f5e57356eb98db2d8c
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Mon May 11 14:02:42 2015 +0100

    Switch VclBuilder constructors to use VclPtr.
    
    Change-Id: Id35a86eb52bbde6ca09a5e61a0b1a79b23be8faf

diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index 27f35d5..633ded9 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 32c9280d..433a637 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 712c66c..493f280 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 55eb084..da8ef1bf 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 42e2f98..bce7891 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 c74e0e7..c5d3cdf 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 c50b487..ae805ba 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 ce1cbca..f941d9c 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 a27774c..a20bb6e 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 ee90eb7..cf487f1 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 2edac2d..fdba752 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 b65bf8c..6572fcb 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 65064c3..cdef298 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 259a28f..1f4943c 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 2c9998e..e8aa044 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 15c9541..42da252 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 35b58d9..b5c549d 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 8b54d8d..e262dee 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 50d91c8..8982bc5 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 37e653e..f3a4cfd 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 26b577e..a32897e 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 141d64b..ff682c8 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 63ce93e..8f82b77 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 68f7745..5a3379f 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 9355b5e..b119122 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 b50a557..473e451 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 78650e6..864bfc0 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 0e2cbf5..2ec29d6 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 8ef5c95..617efcc 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 187fefd..67d435c 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 55aacef..477f519 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 38ed894..7b1af0a 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 3f4db20..403da9e 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 4c8bcf9..0aca3c7 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 2c308f7..b281431 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 3256321..8eda4c4 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 e0cba08..6e71e3c 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 0a3c3f4..4a1bf4b 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 a4ecc26..0d708e6 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 3b26172..0f14760 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 ffc0b7b..1449645 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 c9e8a2a..ea4ca88 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 24d2ee4..f1be8fe 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 60e5318..556ea85 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 0bcd09b..b13079d 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 097aded..2c113af 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 2be6e63..c7926f1 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 fe9a3ac..29b7eec 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 8a268d7..6edcd8e 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 28bee35..070e16a 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 66527a7..fb86f8c 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 a130f9f..d24326d 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 ad7c410..1019bf4 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 a1bb1d4..820a6d3 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 625bbd3..59f8a59 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 ef87c9f..237d8e5 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 567bc36..50a09fe 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 f1b3a9e..ab53699 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 9311c53..d618627 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 a9c3a9e..e07b932 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 6e177aa..de77344 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 c038a5d..8cf6dcc 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 ba1d4b9..3a45e85 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 ef448a4..cec4efc 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 4247606..8efc4a5 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 a9c1226..dffdc59 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 2c25df2..0beb28e 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 c84b5c4..313b42b 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 8da46a4..9528c18 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 2bac0f5..f9f3e02 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 3332023..439057f 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 119dbb3..107048c 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 0e9fa0d..13729c6 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 d827f70..1fcdfd5 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 30b6b05..4e0c961 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 907ac1f..9bda327 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 32bab7f..adafb24 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 d687b60..d8f01cd 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 ecc8d7a..af64afa 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 )


More information about the Libreoffice-commits mailing list