[Libreoffice-commits] core.git: Branch 'feature/vclptr' - sw/inc sw/source

Noel Grandin noel at peralex.com
Fri Apr 17 06:57:45 PDT 2015


 sw/inc/postithelper.hxx                          |    4 
 sw/source/core/doc/DocumentDeviceManager.cxx     |    8 -
 sw/source/core/fields/postithelper.cxx           |    4 
 sw/source/core/layout/virtoutp.cxx               |    2 
 sw/source/core/view/viewsh.cxx                   |    2 
 sw/source/core/view/vprint.cxx                   |    2 
 sw/source/ui/chrdlg/chardlg.cxx                  |    2 
 sw/source/ui/chrdlg/drpcps.cxx                   |    2 
 sw/source/ui/chrdlg/numpara.cxx                  |    2 
 sw/source/ui/chrdlg/swuiccoll.cxx                |    2 
 sw/source/ui/config/mailconfigpage.cxx           |    2 
 sw/source/ui/config/optcomp.cxx                  |    2 
 sw/source/ui/config/optload.cxx                  |    4 
 sw/source/ui/config/optpage.cxx                  |   18 +-
 sw/source/ui/dbui/addresslistdialog.cxx          |    8 -
 sw/source/ui/dbui/createaddresslistdialog.cxx    |   10 -
 sw/source/ui/dbui/customizeaddresslistdialog.cxx |    4 
 sw/source/ui/dbui/mailmergewizard.cxx            |   16 +-
 sw/source/ui/dbui/mmaddressblockpage.cxx         |   18 +-
 sw/source/ui/dbui/mmgreetingspage.cxx            |    4 
 sw/source/ui/dbui/mmoutputpage.cxx               |   12 -
 sw/source/ui/dbui/mmoutputtypepage.cxx           |    2 
 sw/source/ui/dbui/selectdbtabledialog.cxx        |    2 
 sw/source/ui/dialog/ascfldlg.cxx                 |    2 
 sw/source/ui/dialog/docstdlg.cxx                 |    2 
 sw/source/ui/dialog/swdlgfact.cxx                |  143 +++++++++++------------
 sw/source/ui/dialog/uiregionsw.cxx               |    6 
 sw/source/ui/envelp/envfmt.cxx                   |    2 
 sw/source/ui/envelp/envfmt.hxx                   |    3 
 sw/source/ui/envelp/envlop1.cxx                  |    2 
 sw/source/ui/envelp/envprt.cxx                   |    2 
 sw/source/ui/envelp/envprt.hxx                   |    3 
 sw/source/ui/envelp/label1.cxx                   |    8 -
 sw/source/ui/envelp/labfmt.cxx                   |    2 
 sw/source/ui/envelp/labfmt.hxx                   |    3 
 sw/source/ui/envelp/labprt.cxx                   |    2 
 sw/source/ui/envelp/labprt.hxx                   |    3 
 sw/source/ui/envelp/swuilabimp.hxx               |   12 -
 sw/source/uibase/inc/drpcps.hxx                  |    3 
 sw/source/uibase/inc/envlop.hxx                  |    3 
 sw/source/uibase/inc/numpara.hxx                 |    4 
 sw/source/uibase/inc/optpage.hxx                 |   25 +---
 sw/source/uibase/inc/swuiccoll.hxx               |    2 
 43 files changed, 177 insertions(+), 187 deletions(-)

New commits:
commit 5cf00154ca1e5013ceba59103ad706a3492ea70b
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Apr 17 15:54:21 2015 +0200

    sw: convert new to ::Create.
    
    Change-Id: I3783ee5c3eca2ecb4490a16032edad7e6ebe3460

diff --git a/sw/inc/postithelper.hxx b/sw/inc/postithelper.hxx
index cf1f7c0..e8fa575 100644
--- a/sw/inc/postithelper.hxx
+++ b/sw/inc/postithelper.hxx
@@ -114,7 +114,7 @@ public:
     virtual bool UseElement() = 0;
     virtual const SwFmtFld& GetFmtFld() const = 0;
     virtual const SfxBroadcaster* GetBroadCaster() const = 0;
-    virtual sw::sidebarwindows::SwSidebarWin* GetSidebarWindow( SwEditWin& rEditWin,
+    virtual VclPtr<sw::sidebarwindows::SwSidebarWin> GetSidebarWindow( SwEditWin& rEditWin,
                                                                 WinBits nBits,
                                                                 SwPostItMgr& aMgr,
                                                                 SwPostItBits aBits) = 0;
@@ -146,7 +146,7 @@ public:
     {
         return dynamic_cast<const SfxBroadcaster *> (&mrFmtFld);
     }
-    virtual sw::sidebarwindows::SwSidebarWin* GetSidebarWindow(
+    virtual VclPtr<sw::sidebarwindows::SwSidebarWin> GetSidebarWindow(
         SwEditWin& rEditWin,
         WinBits nBits,
         SwPostItMgr& aMgr,
diff --git a/sw/source/core/doc/DocumentDeviceManager.cxx b/sw/source/core/doc/DocumentDeviceManager.cxx
index b8b0438..59ebd29 100644
--- a/sw/source/core/doc/DocumentDeviceManager.cxx
+++ b/sw/source/core/doc/DocumentDeviceManager.cxx
@@ -212,7 +212,7 @@ void DocumentDeviceManager::setJobsetup(/*[in]*/ const JobSetup &rJobSetup )
                         SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
                         SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
                         0 );
-        SfxPrinter *p = new SfxPrinter( pSet, rJobSetup );
+        VclPtr<SfxPrinter> p = VclPtr<SfxPrinter>::Create( pSet, rJobSetup );
         if ( bCheckPageDescs )
             setPrinter( p, true, true );
         else
@@ -261,9 +261,9 @@ DocumentDeviceManager::~DocumentDeviceManager()
 VirtualDevice& DocumentDeviceManager::CreateVirtualDevice_() const
 {
 #ifdef IOS
-    VirtualDevice* pNewVir = new VirtualDevice( 8 );
+    VclPtr<VirtualDevice> pNewVir = VclPtr<VirtualDevice>::Create( 8 );
 #else
-    VirtualDevice* pNewVir = new VirtualDevice( 1 );
+    VclPtr<VirtualDevice> pNewVir = VclPtr<VirtualDevice>::Create( 1 );
 #endif
 
     pNewVir->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 );
@@ -297,7 +297,7 @@ SfxPrinter& DocumentDeviceManager::CreatePrinter_() const
                     SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
                     0 );
 
-    SfxPrinter* pNewPrt = new SfxPrinter( pSet );
+    VclPtr<SfxPrinter> pNewPrt = VclPtr<SfxPrinter>::Create( pSet );
     const_cast<DocumentDeviceManager*>(this)->setPrinter( pNewPrt, true, true );
     return *mpPrt.get();
 }
diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx
index fdce899..6a8f53e 100644
--- a/sw/source/core/fields/postithelper.cxx
+++ b/sw/source/core/fields/postithelper.cxx
@@ -143,13 +143,13 @@ bool SwAnnotationItem::UseElement()
     return mrFmtFld.IsFldInDoc();
 }
 
-sw::sidebarwindows::SwSidebarWin* SwAnnotationItem::GetSidebarWindow(
+VclPtr<sw::sidebarwindows::SwSidebarWin> SwAnnotationItem::GetSidebarWindow(
                                                             SwEditWin& rEditWin,
                                                             WinBits nBits,
                                                             SwPostItMgr& aMgr,
                                                             SwPostItBits aBits)
 {
-    return new sw::annotation::SwAnnotationWin( rEditWin, nBits,
+    return VclPtr<sw::annotation::SwAnnotationWin>::Create( rEditWin, nBits,
                                                 aMgr, aBits,
                                                 *this,
                                                 &mrFmtFld );
diff --git a/sw/source/core/layout/virtoutp.cxx b/sw/source/core/layout/virtoutp.cxx
index dceabf0..d8ea404 100644
--- a/sw/source/core/layout/virtoutp.cxx
+++ b/sw/source/core/layout/virtoutp.cxx
@@ -119,7 +119,7 @@ bool SwLayVout::DoesFit( const Size &rNew )
         return true;
     if( !pVirDev )
     {
-        pVirDev = new VirtualDevice();
+        pVirDev = VclPtr<VirtualDevice>::Create();
         pVirDev->SetLineColor();
         if( pOut )
         {
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index f39d145..b329697 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -333,7 +333,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
                     {
                         //create virtual device and set.
                         if ( !pVout )
-                            pVout = new VirtualDevice( *GetOut() );
+                            pVout = VclPtr<VirtualDevice>::Create( *GetOut() );
                         MapMode aMapMode( GetOut()->GetMapMode() );
                         pVout->SetMapMode( aMapMode );
 
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index 80ba9ce16..4bc1c062 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -331,7 +331,7 @@ SwDoc * SwViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
     //! Make a copy of it since it gets destroyed with the temporary document
     //! used for PDF export
     if (pPrt)
-        pPrtDoc->getIDocumentDeviceAccess().setPrinter( new SfxPrinter(*pPrt), true, true );
+        pPrtDoc->getIDocumentDeviceAccess().setPrinter( VclPtr<SfxPrinter>::Create(*pPrt), true, true );
 
     const SfxItemPool& rPool = GetAttrPool();
     for( sal_uInt16 nWh = POOLATTR_BEGIN; nWh < POOLATTR_END; ++nWh )
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index a1836d6..01e76c7 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -298,7 +298,7 @@ bool SwCharURLPage::FillItemSet(SfxItemSet* rSet)
 SfxTabPage* SwCharURLPage::Create(  vcl::Window* pParent,
                         const SfxItemSet* rAttrSet )
 {
-    return ( new SwCharURLPage( pParent, *rAttrSet ) );
+    return VclPtr<SwCharURLPage>::Create( pParent, *rAttrSet );
 }
 
 IMPL_LINK_NOARG(SwCharURLPage, InsertFileHdl)
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index d0ba0a4..d8534b6 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -608,7 +608,7 @@ int  SwDropCapsPage::DeactivatePage(SfxItemSet * _pSet)
 SfxTabPage*  SwDropCapsPage::Create(vcl::Window *pParent,
     const SfxItemSet *rSet)
 {
-    return new SwDropCapsPage(pParent, *rSet);
+    return VclPtr<SwDropCapsPage>::Create(pParent, *rSet);
 }
 
 bool  SwDropCapsPage::FillItemSet(SfxItemSet *rSet)
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index e16fa6d..2f60612 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -126,7 +126,7 @@ void SwParagraphNumTabPage::dispose()
 SfxTabPage* SwParagraphNumTabPage::Create(  vcl::Window* pParent,
                                 const SfxItemSet* rSet )
 {
-    return new SwParagraphNumTabPage(pParent, *rSet);
+    return VclPtr<SwParagraphNumTabPage>::Create(pParent, *rSet);
 }
 
 bool    SwParagraphNumTabPage::FillItemSet( SfxItemSet* rSet )
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index 7794952..0da72c2 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -155,7 +155,7 @@ int SwCondCollPage::DeactivatePage(SfxItemSet * _pSet)
 
 SfxTabPage* SwCondCollPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
 {
-    return new SwCondCollPage(pParent, *rSet);
+    return VclPtr<SwCondCollPage>::Create(pParent, *rSet);
 }
 
 bool SwCondCollPage::FillItemSet(SfxItemSet *rSet)
diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index ab6fe8a..6290542 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -159,7 +159,7 @@ void SwMailConfigPage::dispose()
 
 SfxTabPage*  SwMailConfigPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet)
 {
-    return new SwMailConfigPage(pParent, *rAttrSet);
+    return VclPtr<SwMailConfigPage>::Create(pParent, *rAttrSet);
 }
 
 bool SwMailConfigPage::FillItemSet( SfxItemSet* /*rSet*/ )
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 655114e..526f587 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -412,7 +412,7 @@ void SwCompatibilityOptPage::WriteOptions()
 
 SfxTabPage* SwCompatibilityOptPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
 {
-    return new SwCompatibilityOptPage( pParent, *rAttrSet );
+    return VclPtr<SwCompatibilityOptPage>::Create( pParent, *rAttrSet );
 }
 
 bool SwCompatibilityOptPage::FillItemSet( SfxItemSet*  )
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 090f496..518252b 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -152,7 +152,7 @@ void SwLoadOptPage::dispose()
 SfxTabPage* SwLoadOptPage::Create( vcl::Window* pParent,
                                 const SfxItemSet* rAttrSet )
 {
-    return new SwLoadOptPage(pParent, *rAttrSet );
+    return VclPtr<SwLoadOptPage>::Create(pParent, *rAttrSet );
 }
 
 IMPL_LINK_NOARG(SwLoadOptPage, StandardizedPageCountCheckHdl)
@@ -572,7 +572,7 @@ void SwCaptionOptPage::dispose()
 SfxTabPage* SwCaptionOptPage::Create( vcl::Window* pParent,
                                 const SfxItemSet* rAttrSet )
 {
-    return new SwCaptionOptPage(pParent, *rAttrSet );
+    return VclPtr<SwCaptionOptPage>::Create(pParent, *rAttrSet );
 }
 
 bool SwCaptionOptPage::FillItemSet( SfxItemSet*  )
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 236fa93..fa096c3 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -187,7 +187,7 @@ void SwContentOptPage::dispose()
 SfxTabPage* SwContentOptPage::Create( vcl::Window* pParent,
                                 const SfxItemSet* rAttrSet)
 {
-    return new SwContentOptPage(pParent, *rAttrSet);
+    return VclPtr<SwContentOptPage>::Create(pParent, *rAttrSet);
 }
 
 static void lcl_SelectMetricLB(ListBox* rMetric, sal_uInt16 nSID, const SfxItemSet& rSet)
@@ -418,7 +418,7 @@ void SwAddPrinterTabPage::SetPreview(bool bPrev)
 SfxTabPage* SwAddPrinterTabPage::Create( vcl::Window* pParent,
                                        const SfxItemSet* rAttrSet )
 {
-    return ( new SwAddPrinterTabPage( pParent, *rAttrSet ) );
+    return VclPtr<SwAddPrinterTabPage>::Create( pParent, *rAttrSet );
 }
 
 bool    SwAddPrinterTabPage::FillItemSet( SfxItemSet* rCoreSet )
@@ -656,7 +656,7 @@ void SwStdFontTabPage::dispose()
 SfxTabPage* SwStdFontTabPage::Create( vcl::Window* pParent,
                                 const SfxItemSet* rAttrSet )
 {
-    return new SwStdFontTabPage(pParent, *rAttrSet);
+    return VclPtr<SwStdFontTabPage>::Create(pParent, *rAttrSet);
 }
 
 static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
@@ -844,7 +844,7 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet)
                     SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
                     SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
                     0 );
-        pPrt = new SfxPrinter(pPrinterSet);
+        pPrt = VclPtr<SfxPrinter>::Create(pPrinterSet);
     }
     delete pFontList;
     pFontList = new FontList( pPrt );
@@ -1180,7 +1180,7 @@ void SwTableOptionsTabPage::dispose()
 SfxTabPage* SwTableOptionsTabPage::Create( vcl::Window* pParent,
                                 const SfxItemSet* rAttrSet )
 {
-    return new SwTableOptionsTabPage(pParent, *rAttrSet );
+    return VclPtr<SwTableOptionsTabPage>::Create(pParent, *rAttrSet );
 }
 
 bool SwTableOptionsTabPage::FillItemSet( SfxItemSet* )
@@ -1440,7 +1440,7 @@ void SwShdwCrsrOptionsTabPage::dispose()
 
 SfxTabPage* SwShdwCrsrOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet )
 {
-    return new SwShdwCrsrOptionsTabPage( pParent, *rSet );
+    return VclPtr<SwShdwCrsrOptionsTabPage>::Create( pParent, *rSet );
 }
 
 void SwShdwCrsrOptionsTabPage::PageCreated( const SfxAllItemSet& aSet )
@@ -1871,7 +1871,7 @@ void SwRedlineOptionsTabPage::dispose()
 
 SfxTabPage* SwRedlineOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rSet)
 {
-    return new SwRedlineOptionsTabPage( pParent, *rSet );
+    return VclPtr<SwRedlineOptionsTabPage>::Create( pParent, *rSet );
 }
 
 bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
@@ -2385,7 +2385,7 @@ void SwCompareOptionsTabPage::dispose()
 
 SfxTabPage* SwCompareOptionsTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet )
 {
-    return new SwCompareOptionsTabPage( pParent, *rAttrSet );
+    return VclPtr<SwCompareOptionsTabPage>::Create( pParent, *rAttrSet );
 }
 
 bool SwCompareOptionsTabPage::FillItemSet( SfxItemSet* )
@@ -2539,7 +2539,7 @@ void SwTestTabPage::dispose()
 SfxTabPage* SwTestTabPage::Create( vcl::Window* pParent,
                                        const SfxItemSet* rAttrSet )
 {
-    return new SwTestTabPage(pParent, *rAttrSet);
+    return VclPtr<SwTestTabPage>::Create(pParent, *rAttrSet);
 }
 
 bool    SwTestTabPage::FillItemSet( SfxItemSet* rCoreSet )
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index 1490417..e69a4ea 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -199,7 +199,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
     Size aSize = pHeaderTreeContainer->LogicToPixel(Size(182 , 102), MAP_APPFONT);
     pHeaderTreeContainer->set_width_request(aSize.Width());
     pHeaderTreeContainer->set_height_request(aSize.Height());
-    m_pListLB = new SwAddrSourceLB(*pHeaderTreeContainer);
+    m_pListLB = VclPtr<SwAddrSourceLB>::Create(*pHeaderTreeContainer);
 
     m_pListLB->InsertHeaderEntry(m_sName + "\t" + m_sTable);
     m_pListLB->setColSizes();
@@ -359,7 +359,8 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton)
 {
     OUString sInputURL;
     VclPtr<SwCreateAddressListDialog> pDlg(
-            new SwCreateAddressListDialog(
+            VclPtr<SwCreateAddressListDialog>::Create(
+
                     pButton,
                     sInputURL,
                     m_pAddressPage->GetWizard()->GetConfigItem()));
@@ -458,7 +459,8 @@ IMPL_LINK(SwAddressListDialog, EditHdl_Impl, PushButton*, pButton)
         pUserData->xConnection.clear();
             // will automatically close if it was the las reference
         VclPtr<SwCreateAddressListDialog> pDlg(
-                new SwCreateAddressListDialog(
+                VclPtr<SwCreateAddressListDialog>::Create(
+
                         pButton,
                         pUserData->sURL,
                         m_pAddressPage->GetWizard()->GetConfigItem()));
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 6dbd308..1d8a631 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -86,8 +86,8 @@ public:
 
 SwAddressControl_Impl::SwAddressControl_Impl(vcl::Window* pParent, WinBits nBits ) :
     Control(pParent, nBits),
-    m_pScrollBar(new ScrollBar(this)),
-    m_pWindow(new vcl::Window(this, WB_DIALOGCONTROL)),
+    m_pScrollBar(VclPtr<ScrollBar>::Create(this)),
+    m_pWindow(VclPtr<vcl::Window>::Create(this, WB_DIALOGCONTROL)),
     m_pData(0),
     m_nLineHeight(0),
     m_nCurrentDataSet(0),
@@ -181,8 +181,8 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
                 aHeaderIter != m_pData->aDBColumnHeaders.end();
                 ++aHeaderIter, nEDYPos += m_nLineHeight, nFTYPos += m_nLineHeight, nLines++)
     {
-        FixedText* pNewFT = new FixedText(m_pWindow, WB_RIGHT);
-        Edit* pNewED = new Edit(m_pWindow, WB_BORDER);
+        VclPtr<FixedText> pNewFT = VclPtr<FixedText>::Create(m_pWindow, WB_RIGHT);
+        VclPtr<Edit> pNewED = VclPtr<Edit>::Create(m_pWindow, WB_BORDER);
         //set nLines a position identifier - used in the ModifyHdl
         pNewED->SetData(reinterpret_cast<void*>(nLines));
         pNewED->SetGetFocusHdl(aFocusLink);
@@ -561,7 +561,7 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, FindHdl_Impl)
 {
     if(!m_pFindDlg)
     {
-        m_pFindDlg = new SwFindEntryDialog(this);
+        m_pFindDlg = VclPtr<SwFindEntryDialog>::Create(this);
         ListBox& rColumnBox = m_pFindDlg->GetFieldsListBox();
         ::std::vector< OUString >::iterator  aHeaderIter;
         for(aHeaderIter = m_pCSVData->aDBColumnHeaders.begin();
diff --git a/sw/source/ui/dbui/customizeaddresslistdialog.cxx b/sw/source/ui/dbui/customizeaddresslistdialog.cxx
index 5ea0665..aba225a 100644
--- a/sw/source/ui/dbui/customizeaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/customizeaddresslistdialog.cxx
@@ -90,9 +90,9 @@ IMPL_LINK(SwCustomizeAddressListDialog, AddRenameHdl_Impl, PushButton*, pButton)
 
     VclPtr<SwAddRenameEntryDialog> pDlg;
     if (bRename)
-        pDlg = new SwRenameEntryDialog(pButton, m_pNewData->aDBColumnHeaders);
+        pDlg = VclPtr<SwRenameEntryDialog>::Create(pButton, m_pNewData->aDBColumnHeaders);
     else
-        pDlg = new SwAddEntryDialog(pButton, m_pNewData->aDBColumnHeaders);
+        pDlg = VclPtr<SwAddEntryDialog>::Create(pButton, m_pNewData->aDBColumnHeaders);
     if(bRename)
     {
         OUString aTemp = m_pFieldsLB->GetEntry(nPos);
diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx
index 9a577c4..2c7ef8b 100644
--- a/sw/source/ui/dbui/mailmergewizard.cxx
+++ b/sw/source/ui/dbui/mailmergewizard.cxx
@@ -106,14 +106,14 @@ OWizardPage*    SwMailMergeWizard::createPage(WizardState _nState)
     OWizardPage* pRet = 0;
     switch(_nState)
     {
-        case MM_DOCUMENTSELECTPAGE : pRet = new SwMailMergeDocSelectPage(this);     break;
-        case MM_OUTPUTTYPETPAGE : pRet = new SwMailMergeOutputTypePage(this);       break;
-        case MM_ADDRESSBLOCKPAGE  : pRet = new SwMailMergeAddressBlockPage(this);     break;
-        case MM_GREETINGSPAGE     : pRet = new SwMailMergeGreetingsPage(this);      break;
-        case MM_LAYOUTPAGE        : pRet = new SwMailMergeLayoutPage(this);     break;
-        case MM_PREPAREMERGEPAGE  : pRet = new SwMailMergePrepareMergePage(this);   break;
-        case MM_MERGEPAGE         : pRet = new SwMailMergeMergePage(this);          break;
-        case MM_OUTPUTPAGE       :  pRet = new SwMailMergeOutputPage(this);         break;
+        case MM_DOCUMENTSELECTPAGE : pRet = VclPtr<SwMailMergeDocSelectPage>::Create(this);     break;
+        case MM_OUTPUTTYPETPAGE : pRet = VclPtr<SwMailMergeOutputTypePage>::Create(this);       break;
+        case MM_ADDRESSBLOCKPAGE  : pRet = VclPtr<SwMailMergeAddressBlockPage>::Create(this);     break;
+        case MM_GREETINGSPAGE     : pRet = VclPtr<SwMailMergeGreetingsPage>::Create(this);      break;
+        case MM_LAYOUTPAGE        : pRet = VclPtr<SwMailMergeLayoutPage>::Create(this);     break;
+        case MM_PREPAREMERGEPAGE  : pRet = VclPtr<SwMailMergePrepareMergePage>::Create(this);   break;
+        case MM_MERGEPAGE         : pRet = VclPtr<SwMailMergeMergePage>::Create(this);          break;
+        case MM_OUTPUTPAGE       :  pRet = VclPtr<SwMailMergeOutputPage>::Create(this);         break;
     }
     OSL_ENSURE(pRet, "no page created in ::createPage");
     return pRet;
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 9d632f1..aaf8d8e 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -190,7 +190,7 @@ IMPL_LINK_NOARG(SwMailMergeAddressBlockPage, AddressListHdl_Impl)
 IMPL_LINK(SwMailMergeAddressBlockPage, SettingsHdl_Impl, PushButton*, pButton)
 {
     VclPtr<SwSelectAddressBlockDialog> pDlg(
-                new SwSelectAddressBlockDialog(pButton, m_pWizard->GetConfigItem()));
+                VclPtr<SwSelectAddressBlockDialog>::Create(pButton, m_pWizard->GetConfigItem()));
     SwMailMergeConfigItem& rConfig = m_pWizard->GetConfigItem();
     pDlg->SetAddressBlocks(rConfig.GetAddressBlocks(), m_pSettingsWIN->GetSelectedAddress());
     pDlg->SetSettings(rConfig.IsIncludeCountry(), rConfig.GetExcludeCountry());
@@ -220,7 +220,7 @@ IMPL_LINK(SwMailMergeAddressBlockPage, AssignHdl_Impl, PushButton*, pButton)
     const sal_uInt16 nSel = m_pSettingsWIN->GetSelectedAddress();
     const uno::Sequence< OUString> aBlocks = rConfigItem.GetAddressBlocks();
     VclPtr<SwAssignFieldsDialog> pDlg(
-            new SwAssignFieldsDialog(pButton, m_pWizard->GetConfigItem(), aBlocks[nSel], true));
+            VclPtr<SwAssignFieldsDialog>::Create(pButton, m_pWizard->GetConfigItem(), aBlocks[nSel], true));
     if(RET_OK == pDlg->Execute())
     {
         //preview update
@@ -454,7 +454,7 @@ IMPL_LINK(SwSelectAddressBlockDialog, NewCustomizeHdl_Impl, PushButton*, pButton
         SwCustomizeAddressBlockDialog::ADDRESSBLOCK_EDIT :
         SwCustomizeAddressBlockDialog::ADDRESSBLOCK_NEW;
     VclPtr<SwCustomizeAddressBlockDialog> pDlg(
-        new SwCustomizeAddressBlockDialog(pButton,m_rConfig,nType));
+        VclPtr<SwCustomizeAddressBlockDialog>::Create(pButton,m_rConfig,nType));
     if(bCustomize)
     {
         pDlg->SetAddress(m_aAddressBlocks[m_pPreview->GetSelectedAddress()]);
@@ -852,9 +852,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSwAssignFieldsControl(
 
 SwAssignFieldsControl::SwAssignFieldsControl(vcl::Window* pParent, WinBits nBits) :
     Control(pParent, nBits | WB_DIALOGCONTROL | WB_TABSTOP | WB_DIALOGCONTROL),
-    m_aVScroll(new ScrollBar(this)),
-    m_aHeaderHB(new HeaderBar(this, WB_BUTTONSTYLE | WB_BOTTOMBORDER)),
-    m_aWindow(new vcl::Window(this, WB_BORDER | WB_DIALOGCONTROL)),
+    m_aVScroll(VclPtr<ScrollBar>::Create(this)),
+    m_aHeaderHB(VclPtr<HeaderBar>::Create(this, WB_BUTTONSTYLE | WB_BOTTOMBORDER)),
+    m_aWindow(VclPtr<vcl::Window>::Create(this, WB_BORDER | WB_DIALOGCONTROL)),
     m_rConfigItem(NULL),
     m_nLBStartTopPos(0),
     m_nYOffset(0),
@@ -906,9 +906,9 @@ void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem)
     for(sal_uInt32 i = 0; i < rHeaders.Count(); ++i)
     {
         const OUString rHeader = rHeaders.GetString( i );
-        FixedText* pNewText = new FixedText(m_aWindow.get(), WB_VCENTER);
+        VclPtr<FixedText> pNewText = VclPtr<FixedText>::Create(m_aWindow.get(), WB_VCENTER);
         pNewText->SetText("<" + rHeader + ">");
-        ListBox* pNewLB = new ListBox(m_aWindow.get(), WB_DROPDOWN | WB_VCENTER | WB_TABSTOP);
+        VclPtr<ListBox> pNewLB = VclPtr<ListBox>::Create(m_aWindow.get(), WB_DROPDOWN | WB_VCENTER | WB_TABSTOP);
         pNewText->set_mnemonic_widget(pNewLB);
         pNewLB->InsertEntry(SW_RESSTR(SW_STR_NONE));
         pNewLB->SelectEntryPos(0);
@@ -922,7 +922,7 @@ void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem)
 
         for(sal_Int32 nField = 0; nField < aFields.getLength(); ++nField)
             pNewLB->InsertEntry(pFields[nField]);
-        FixedText* pNewPreview = new FixedText(m_aWindow.get(), WB_VCENTER);
+        VclPtr<FixedText> pNewPreview = VclPtr<FixedText>::Create(m_aWindow.get(), WB_VCENTER);
         pNewText->SetSizePixel(Size(nControlWidth - 6, nControlHeight));
         pNewLB->SetSizePixel(Size(nControlWidth - 6, nControlHeight));
         pNewPreview->SetSizePixel(Size(aOutputSize.Width() - 2 * nControlWidth, nControlHeight));
diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index 30c8db4..717b1e1 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -107,7 +107,7 @@ IMPL_LINK_NOARG(SwGreetingsHandler, IndividualHdl_Impl)
 IMPL_LINK(SwGreetingsHandler, GreetingHdl_Impl, PushButton*, pButton)
 {
     VclPtr<SwCustomizeAddressBlockDialog> pDlg(
-            new SwCustomizeAddressBlockDialog(pButton, m_pWizard->GetConfigItem(),
+            VclPtr<SwCustomizeAddressBlockDialog>::Create(pButton, m_pWizard->GetConfigItem(),
                         pButton == m_pMalePB ?
                         SwCustomizeAddressBlockDialog::GREETING_MALE :
                         SwCustomizeAddressBlockDialog::GREETING_FEMALE ));
@@ -134,7 +134,7 @@ IMPL_LINK(SwMailMergeGreetingsPage, AssignHdl_Impl, PushButton*, pButton)
 {
     const OUString sPreview(m_pFemaleLB->GetSelectEntry() + "\n" + m_pMaleLB->GetSelectEntry());
     VclPtr<SwAssignFieldsDialog> pDlg(
-            new SwAssignFieldsDialog(pButton, m_pWizard->GetConfigItem(), sPreview, false));
+            VclPtr<SwAssignFieldsDialog>::Create(pButton, m_pWizard->GetConfigItem(), sPreview, false));
     if(RET_OK == pDlg->Execute())
     {
         UpdatePreview();
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 4382250..5a51db1 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -838,10 +838,10 @@ IMPL_LINK(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox*, pBox)
                 if ((pDocumentPrinter->GetName() == pInfo->GetPrinterName()) &&
                     (pDocumentPrinter->GetDriverName() == pInfo->GetDriver()))
                 {
-                    m_pTempPrinter = new Printer(pDocumentPrinter->GetJobSetup());
+                    m_pTempPrinter = VclPtr<Printer>::Create(pDocumentPrinter->GetJobSetup());
                 }
                 else
-                    m_pTempPrinter = new Printer( *pInfo );
+                    m_pTempPrinter = VclPtr<Printer>::Create( *pInfo );
             }
             else
             {
@@ -849,12 +849,12 @@ IMPL_LINK(SwMailMergeOutputPage, PrinterChangeHdl_Impl, ListBox*, pBox)
                      (m_pTempPrinter->GetDriverName() != pInfo->GetDriver()) )
                 {
                     m_pTempPrinter.disposeAndClear();
-                    m_pTempPrinter = new Printer( *pInfo );
+                    m_pTempPrinter = VclPtr<Printer>::Create( *pInfo );
                 }
             }
         }
         else if( ! m_pTempPrinter )
-            m_pTempPrinter = new Printer();
+            m_pTempPrinter = VclPtr<Printer>::Create();
 
         m_pPrinterSettingsPB->Enable( m_pTempPrinter->HasSupport( SUPPORT_SETUPDIALOG ) );
     }
@@ -960,7 +960,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox*, pBox)
 
 IMPL_LINK(SwMailMergeOutputPage, SendAsHdl_Impl, PushButton*, pButton)
 {
-    SwMailBodyDialog* pDlg = new SwMailBodyDialog(pButton, m_pWizard);
+    VclPtr<SwMailBodyDialog> pDlg = VclPtr<SwMailBodyDialog>::Create(pButton, m_pWizard);
     pDlg->SetBody(m_sBody);
     if(RET_OK == pDlg->Execute())
     {
@@ -1145,7 +1145,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
     xStore->storeToURL( sTargetTempURL, aValues   );
 
     //create the send dialog
-    SwSendMailDialog* pDlg = new SwSendMailDialog( pButton, rConfigItem );
+    VclPtr<SwSendMailDialog> pDlg = VclPtr<SwSendMailDialog>::Create( pButton, rConfigItem );
     pDlg->SetDocumentCount( nEnd );
     pDlg->ShowDialog();
     //help to force painting the dialog
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index 33363a0..0e0fa32 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -275,7 +275,7 @@ SwSendMailDialog::SwSendMailDialog(vcl::Window *pParent, SwMailMergeConfigItem&
     Size aSize = m_pContainer->LogicToPixel(Size(226, 80), MAP_APPFONT);
     m_pContainer->set_width_request(aSize.Width());
     m_pContainer->set_height_request(aSize.Height());
-    m_pStatus = new SvSimpleTable(*m_pContainer);
+    m_pStatus = VclPtr<SvSimpleTable>::Create(*m_pContainer);
     m_pStatusHB = &(m_pStatus->GetTheHeaderBar());
 
     m_nStatusHeight = m_pContainer->get_height_request();
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index 5cf71f0..43cab8c 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -105,7 +105,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(vcl::Window* pParent,
     Size aSize = pHeaderTreeContainer->LogicToPixel(Size(238 , 50), MAP_APPFONT);
     pHeaderTreeContainer->set_width_request(aSize.Width());
     pHeaderTreeContainer->set_height_request(aSize.Height());
-    m_pTable = new SwAddressTable(*pHeaderTreeContainer);
+    m_pTable = VclPtr<SwAddressTable>::Create(*pHeaderTreeContainer);
     long aStaticTabs[]= { 2, 0, 0 };
     m_pTable->SetTabs( aStaticTabs );
     m_pTable->InsertHeaderItem(1, m_sName, HIB_LEFT | HIB_VCENTER);
diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx
index fa41047..4a15865 100644
--- a/sw/source/ui/dialog/ascfldlg.cxx
+++ b/sw/source/ui/dialog/ascfldlg.cxx
@@ -181,7 +181,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh,
                             SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
                             SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
                             0 );
-                pPrt = new SfxPrinter( pSet );
+                pPrt = VclPtr<SfxPrinter>::Create( pSet );
                 bDelPrinter = true;
             }
 
diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx
index 5277c49..3477d25 100644
--- a/sw/source/ui/dialog/docstdlg.cxx
+++ b/sw/source/ui/dialog/docstdlg.cxx
@@ -38,7 +38,7 @@
 
 SfxTabPage *  SwDocStatPage::Create(vcl::Window *pParent, const SfxItemSet *rSet)
 {
-    return new SwDocStatPage(pParent, *rSet);
+    return VclPtr<SwDocStatPage>::Create(pParent, *rSet);
 }
 
 SwDocStatPage::SwDocStatPage(vcl::Window *pParent, const SfxItemSet &rSet)
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 68fa68a..ebc76da 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -643,7 +643,7 @@ sal_uInt16 AbstractMailMergeWizard_Impl::GetRestartPage() const
 
 AbstractSwInsertAbstractDlg * SwAbstractDialogFactory_Impl::CreateSwInsertAbstractDlg(vcl::Window* pParent)
 {
-    SwInsertAbstractDlg* pDlg = new SwInsertAbstractDlg( pParent);
+    VclPtr<SwInsertAbstractDlg> pDlg = VclPtr<SwInsertAbstractDlg>::Create( pParent);
     return new AbstractSwInsertAbstractDlg_Impl(pDlg);
 }
 
@@ -657,16 +657,16 @@ SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSfxDialog( vcl::Window* p
     switch ( nResId )
     {
         case RC_DLG_ADDR :
-            pDlg = new SwAddrDlg( pParent, rSet );
+            pDlg = VclPtr<SwAddrDlg>::Create( pParent, rSet );
             break;
         case DLG_SWDROPCAPS :
-            pDlg = new SwDropCapsDlg( pParent, rSet );
+            pDlg = VclPtr<SwDropCapsDlg>::Create( pParent, rSet );
             break;
         case RC_SWDLG_BACKGROUND :
-            pDlg = new SwBackgroundDlg( pParent, rSet );
+            pDlg = VclPtr<SwBackgroundDlg>::Create( pParent, rSet );
             break;
         case RC_DLG_SWNUMFMTDLG :
-            pDlg = new SwNumFmtDlg( pParent, rSet );
+            pDlg = VclPtr<SwNumFmtDlg>::Create( pParent, rSet );
             break;
         default:
             break;
@@ -681,7 +681,7 @@ AbstractSwAsciiFilterDlg* SwAbstractDialogFactory_Impl::CreateSwAsciiFilterDlg(
                                                                                SwDocShell& rDocSh,
                                                                                 SvStream* pStream )
 {
-    SwAsciiFilterDlg* pDlg = new SwAsciiFilterDlg( pParent, rDocSh, pStream );
+    VclPtr<SwAsciiFilterDlg> pDlg = VclPtr<SwAsciiFilterDlg>::Create( pParent, rDocSh, pStream );
     return new AbstractSwAsciiFilterDlg_Impl( pDlg );
 }
 
@@ -694,7 +694,7 @@ VclAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg( vcl:
     switch ( nResId )
     {
         case DLG_INSERT_BOOKMARK :
-            pDlg = new SwInsertBookmarkDlg( pParent, rSh, rReq );
+            pDlg = VclPtr<SwInsertBookmarkDlg>::Create( pParent, rSh, rReq );
             break;
 
         default:
@@ -709,44 +709,43 @@ VclAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg( vcl:
 AbstractSwBreakDlg * SwAbstractDialogFactory_Impl::CreateSwBreakDlg(vcl::Window *pParent,
                                                                      SwWrtShell &rSh)
 {
-    SwBreakDlg* pDlg = new SwBreakDlg(pParent, rSh);
+    VclPtr<SwBreakDlg> pDlg = VclPtr<SwBreakDlg>::Create(pParent, rSh);
     return new AbstractSwBreakDlg_Impl(pDlg);
 }
 
 VclAbstractDialog   * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView& rVw)
 {
-    Dialog* pDlg = new SwChangeDBDlg(rVw);
+    VclPtr<Dialog> pDlg = VclPtr<SwChangeDBDlg>::Create(rVw);
     return new VclAbstractDialog_Impl(pDlg);
 }
 
 SfxAbstractTabDialog *  SwAbstractDialogFactory_Impl::CreateSwCharDlg(vcl::Window* pParent, SwView& pVw,
     const SfxItemSet& rCoreSet, sal_uInt8 nDialogMode, const OUString* pFmtStr)
 {
-
-    SfxTabDialog* pDlg = new SwCharDlg(pParent, pVw, rCoreSet, nDialogMode, pFmtStr);
+    VclPtr<SfxTabDialog> pDlg = VclPtr<SwCharDlg>::Create(pParent, pVw, rCoreSet, nDialogMode, pFmtStr);
     return new AbstractTabDialog_Impl(pDlg);
 }
 
 AbstractSwConvertTableDlg* SwAbstractDialogFactory_Impl::CreateSwConvertTableDlg(SwView& rView, bool bToTable)
 {
-    SwConvertTableDlg* pDlg = new SwConvertTableDlg(rView, bToTable);
+    VclPtr<SwConvertTableDlg> pDlg = VclPtr<SwConvertTableDlg>::Create(rView, bToTable);
     return new AbstractSwConvertTableDlg_Impl(pDlg);
 }
 
 VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwCaptionDialog ( vcl::Window *pParent, SwView &rV,int nResId)
 {
-    Dialog* pDlg=NULL;
+    VclPtr<Dialog> pDlg;
     switch ( nResId )
     {
         case DLG_CAPTION :
-            pDlg = new SwCaptionDialog( pParent, rV );
+            pDlg = VclPtr<SwCaptionDialog>::Create( pParent, rV );
             break;
 
         default:
             break;
     }
 
-    if ( pDlg )
+    if ( pDlg.get() )
         return new VclAbstractDialog_Impl( pDlg );
     return 0;
 }
@@ -756,20 +755,20 @@ AbstractSwInsertDBColAutoPilot* SwAbstractDialogFactory_Impl::CreateSwInsertDBCo
         uno::Reference<sdbcx::XColumnsSupplier> xColSupp,
         const SwDBData& rData)
 {
-    SwInsertDBColAutoPilot* pDlg = new SwInsertDBColAutoPilot( rView, rxSource, xColSupp, rData );
+    VclPtr<SwInsertDBColAutoPilot> pDlg = VclPtr<SwInsertDBColAutoPilot>::Create( rView, rxSource, xColSupp, rData );
     return new AbstractSwInsertDBColAutoPilot_Impl( pDlg );
 }
 
 SfxAbstractTabDialog *  SwAbstractDialogFactory_Impl::CreateSwFootNoteOptionDlg(vcl::Window *pParent, SwWrtShell &rSh)
 {
-    SfxTabDialog* pDlg = new SwFootNoteOptionDlg( pParent, rSh );
+    VclPtr<SfxTabDialog> pDlg = VclPtr<SwFootNoteOptionDlg>::Create( pParent, rSh );
     return new AbstractTabDialog_Impl( pDlg );
 }
 
 AbstractDropDownFieldDialog *  SwAbstractDialogFactory_Impl::CreateDropDownFieldDialog(vcl::Window *pParent,
     SwWrtShell &rSh, SwField* pField, bool bNextButton)
 {
-    sw::DropDownFieldDialog* pDlg = new sw::DropDownFieldDialog(pParent, rSh, pField, bNextButton);
+    VclPtr<sw::DropDownFieldDialog> pDlg = VclPtr<sw::DropDownFieldDialog>::Create(pParent, rSh, pField, bNextButton);
     return new AbstractDropDownFieldDialog_Impl( pDlg );
 }
 
@@ -777,14 +776,14 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwEnvDlg ( vcl::Window
                                                                  SwWrtShell* pWrtSh, Printer* pPrt,
                                                                  bool bInsert )
 {
-    SfxTabDialog* pDlg = new SwEnvDlg( pParent, rSet, pWrtSh,pPrt, bInsert  );
+    VclPtr<SfxTabDialog> pDlg = VclPtr<SwEnvDlg>::Create( pParent, rSet, pWrtSh,pPrt, bInsert  );
     return new AbstractTabDialog_Impl( pDlg );
 }
 
 AbstractSwLabDlg* SwAbstractDialogFactory_Impl::CreateSwLabDlg(vcl::Window* pParent, const SfxItemSet& rSet,
                                                      SwDBManager* pDBManager, bool bLabel)
 {
-    SwLabDlg* pDlg = new SwLabDlg(pParent, rSet, pDBManager, bLabel);
+    VclPtr<SwLabDlg> pDlg = VclPtr<SwLabDlg>::Create(pParent, rSet, pDBManager, bLabel);
     return new AbstractSwLabDlg_Impl(pDlg);
 }
 
@@ -800,120 +799,120 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwParaDlg ( vcl::Windo
                                                     bool bDraw ,
                                                     const OString& sDefPage)
 {
-    SfxTabDialog* pDlg = new SwParaDlg( pParent, rVw, rCoreSet,nDialogMode, pCollName, bDraw, sDefPage );
+    VclPtr<SfxTabDialog> pDlg = VclPtr<SwParaDlg>::Create( pParent, rVw, rCoreSet,nDialogMode, pCollName, bDraw, sDefPage );
     return new AbstractTabDialog_Impl( pDlg );
 }
 
 VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclAbstractDialog ( vcl::Window *pParent, SwWrtShell &rSh, int nResId )
 {
-    Dialog* pDlg=NULL;
+    VclPtr<Dialog> pDlg;
     switch ( nResId )
     {
         case DLG_ROW_HEIGHT :
-            pDlg = new SwTableHeightDlg( pParent, rSh);
+            pDlg = VclPtr<SwTableHeightDlg>::Create( pParent, rSh);
             break;
         case DLG_SORTING :
-            pDlg = new SwSortDlg( pParent, rSh);
+            pDlg = VclPtr<SwSortDlg>::Create( pParent, rSh);
             break;
         case DLG_COLUMN :
-            pDlg = new SwColumnDlg( pParent, rSh );
+            pDlg = VclPtr<SwColumnDlg>::Create( pParent, rSh );
             break;
         case DLG_EDIT_AUTHMARK :
-            pDlg = new SwAuthMarkModalDlg( pParent, rSh );
+            pDlg = VclPtr<SwAuthMarkModalDlg>::Create( pParent, rSh );
             break;
         default:
             break;
     }
 
-    if ( pDlg )
+    if ( pDlg.get() )
         return new VclAbstractDialog_Impl( pDlg );
     return 0;
 }
 
 AbstractSplitTableDialog * SwAbstractDialogFactory_Impl::CreateSplitTblDialog ( vcl::Window *pParent, SwWrtShell &rSh )
 {
-    return new AbstractSplitTableDialog_Impl( new SwSplitTblDlg( pParent, rSh) );
+    return new AbstractSplitTableDialog_Impl( VclPtr<SwSplitTblDlg>::Create( pParent, rSh) );
 }
 
 AbstractSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg(vcl::Window * pParent, const OUString &rShortName)
 {
-    SwSelGlossaryDlg* pDlg = new SwSelGlossaryDlg(pParent, rShortName);
+    VclPtr<SwSelGlossaryDlg> pDlg = VclPtr<SwSelGlossaryDlg>::Create(pParent, rShortName);
     return new AbstractSwSelGlossaryDlg_Impl(pDlg);
 }
 
 AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg(vcl::Window* pParent,
     SwWrtShell* pShell, bool bSetAutoFmt, const SwTableAutoFmt* pSelFmt)
 {
-    SwAutoFormatDlg* pDlg = new SwAutoFormatDlg(pParent, pShell, bSetAutoFmt, pSelFmt);
+    VclPtr<SwAutoFormatDlg> pDlg = VclPtr<SwAutoFormatDlg>::Create(pParent, pShell, bSetAutoFmt, pSelFmt);
     return new AbstractSwAutoFormatDlg_Impl(pDlg);
 }
 
 SfxAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwBorderDlg(vcl::Window* pParent, SfxItemSet& rSet, sal_uInt16 nType, int nResId )
 {
-    SfxModalDialog* pDlg=NULL;
+    VclPtr<SfxModalDialog> pDlg;
     switch ( nResId )
     {
         case RC_DLG_SWBORDERDLG :
-            pDlg = new SwBorderDlg( pParent, rSet, nType );
+            pDlg = VclPtr<SwBorderDlg>::Create( pParent, rSet, nType );
             break;
         default:
             break;
     }
 
-    if ( pDlg )
+    if ( pDlg.get() )
         return new SwAbstractSfxDialog_Impl( pDlg );
     return 0;
 }
 
 SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwWrapDlg ( vcl::Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, bool bDrawMode, int nResId )
 {
-    SfxModalDialog* pDlg=NULL;
+    VclPtr<SfxModalDialog> pDlg;
     switch ( nResId )
     {
         case RC_DLG_SWWRAPDLG :
-            pDlg = new SwWrapDlg( pParent, rSet, pSh, bDrawMode );
+            pDlg = VclPtr<SwWrapDlg>::Create( pParent, rSet, pSh, bDrawMode );
             break;
         default:
             break;
     }
 
-    if ( pDlg )
+    if ( pDlg.get() )
         return new SwAbstractSfxDialog_Impl( pDlg );
     return 0;
 }
 
 VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg(vcl::Window *pParent, SwTableFUNC &rFnc)
 {
-    Dialog* pDlg = new SwTableWidthDlg(pParent, rFnc);
+    VclPtr<Dialog> pDlg = VclPtr<SwTableWidthDlg>::Create(pParent, rFnc);
     return new VclAbstractDialog_Impl( pDlg );
 }
 
 SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTableTabDlg(vcl::Window* pParent, SfxItemPool& Pool,
     const SfxItemSet* pItemSet, SwWrtShell* pSh)
 {
-    SfxTabDialog* pDlg = new SwTableTabDlg(pParent, Pool, pItemSet, pSh);
+    VclPtr<SfxTabDialog> pDlg = VclPtr<SwTableTabDlg>::Create(pParent, Pool, pItemSet, pSh);
     return new AbstractTabDialog_Impl(pDlg);
 }
 
 AbstractSwFldDlg * SwAbstractDialogFactory_Impl::CreateSwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pParent)
 {
-    SwFldDlg* pDlg = new SwFldDlg(pB, pCW, pParent);
+    VclPtr<SwFldDlg> pDlg = VclPtr<SwFldDlg>::Create(pB, pCW, pParent);
     return new AbstractSwFldDlg_Impl(pDlg);
 }
 
 SfxAbstractDialog*   SwAbstractDialogFactory_Impl::CreateSwFldEditDlg ( SwView& rVw, int nResId )
 {
-    SfxModalDialog* pDlg=NULL;
+    VclPtr<SfxModalDialog> pDlg;
     switch ( nResId )
     {
         case RC_DLG_SWFLDEDITDLG :
-            pDlg = new SwFldEditDlg( rVw );
+            pDlg = VclPtr<SwFldEditDlg>::Create( rVw );
             break;
         default:
             break;
     }
 
-    if ( pDlg )
+    if ( pDlg.get() )
         return new SwAbstractSfxDialog_Impl( pDlg );
     return 0;
 }
@@ -922,19 +921,19 @@ AbstractSwRenameXNamedDlg * SwAbstractDialogFactory_Impl::CreateSwRenameXNamedDl
     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed,
     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess)
 {
-    SwRenameXNamedDlg* pDlg = new SwRenameXNamedDlg( pParent,xNamed, xNameAccess);
+    VclPtr<SwRenameXNamedDlg> pDlg = VclPtr<SwRenameXNamedDlg>::Create( pParent,xNamed, xNameAccess);
     return new AbstractSwRenameXNamedDlg_Impl( pDlg );
 }
 
 AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRedlineAcceptDlg(vcl::Window *pParent)
 {
-    SwModalRedlineAcceptDlg* pDlg = new SwModalRedlineAcceptDlg( pParent );
+    VclPtr<SwModalRedlineAcceptDlg> pDlg = VclPtr<SwModalRedlineAcceptDlg>::Create( pParent );
     return new AbstractSwModalRedlineAcceptDlg_Impl( pDlg );
 }
 
 VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTblMergeDialog(vcl::Window* pParent, bool& rWithPrev)
 {
-    Dialog* pDlg = new SwMergeTblDlg( pParent, rWithPrev );
+    VclPtr<Dialog> pDlg = VclPtr<SwMergeTblDlg>::Create( pParent, rWithPrev );
     return new VclAbstractDialog_Impl( pDlg );
 }
 
@@ -946,7 +945,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrmTabDialog(const OUS
                                                 const OString&  sDefPage,
                                                 const OUString* pFmtStr )
 {
-    SfxTabDialog* pDlg = new SwFrmDlg(pFrame, pParent, rCoreSet, bNewFrm, rDialogType, bFmt, sDefPage, pFmtStr);
+    VclPtr<SfxTabDialog> pDlg = VclPtr<SwFrmDlg>::Create(pFrame, pParent, rCoreSet, bNewFrm, rDialogType, bFmt, sDefPage, pFmtStr);
     return new AbstractTabDialog_Impl(pDlg);
 }
 
@@ -958,7 +957,7 @@ SfxAbstractApplyTabDialog* SwAbstractDialogFactory_Impl::CreateTemplateDialog(
                                                 SwWrtShell*         pActShell,
                                                 bool                bNew )
 {
-    SfxTabDialog* pDlg = new SwTemplateDlg( pParent, rBase, nRegion, sPage, pActShell, bNew );
+    VclPtr<SfxTabDialog> pDlg = VclPtr<SwTemplateDlg>::Create( pParent, rBase, nRegion, sPage, pActShell, bNew );
     return new AbstractApplyTabDialog_Impl( pDlg );
 }
 
@@ -966,46 +965,46 @@ AbstractGlossaryDlg* SwAbstractDialogFactory_Impl::CreateGlossaryDlg(SfxViewFram
                                                 SwGlossaryHdl* pGlosHdl,
                                                 SwWrtShell *pWrtShell)
 {
-    SwGlossaryDlg* pDlg = new SwGlossaryDlg(pViewFrame, pGlosHdl, pWrtShell);
+    VclPtr<SwGlossaryDlg> pDlg = VclPtr<SwGlossaryDlg>::Create(pViewFrame, pGlosHdl, pWrtShell);
     return new AbstractGlossaryDlg_Impl( pDlg );
 }
 
 AbstractFldInputDlg* SwAbstractDialogFactory_Impl::CreateFldInputDlg(vcl::Window *pParent,
     SwWrtShell &rSh, SwField* pField, bool bNextButton)
 {
-    SwFldInputDlg* pDlg = new SwFldInputDlg( pParent, rSh, pField, bNextButton );
+    VclPtr<SwFldInputDlg> pDlg = VclPtr<SwFldInputDlg>::Create( pParent, rSh, pField, bNextButton );
     return new AbstractFldInputDlg_Impl( pDlg );
 }
 
 AbstractInsFootNoteDlg* SwAbstractDialogFactory_Impl::CreateInsFootNoteDlg(
     vcl::Window * pParent, SwWrtShell &rSh, bool bEd )
 {
-    SwInsFootNoteDlg* pDlg = new SwInsFootNoteDlg(pParent, rSh, bEd);
+    VclPtr<SwInsFootNoteDlg> pDlg = VclPtr<SwInsFootNoteDlg>::Create(pParent, rSh, bEd);
     return new AbstractInsFootNoteDlg_Impl( pDlg );
 }
 
 VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTitlePageDlg ( vcl::Window *pParent )
 {
-    Dialog* pDlg = new SwTitlePageDlg( pParent );
+    VclPtr<Dialog> pDlg = VclPtr<SwTitlePageDlg>::Create( pParent );
     return new VclAbstractDialog_Impl( pDlg );
 }
 
 VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog(SwView& rView)
 {
-    Dialog* pDlg = new SwLineNumberingDlg( &rView );
+    VclPtr<Dialog> pDlg = VclPtr<SwLineNumberingDlg>::Create( &rView );
     return new VclAbstractDialog_Impl( pDlg );
 }
 
 AbstractInsTableDlg * SwAbstractDialogFactory_Impl::CreateInsTableDlg(SwView& rView)
 {
-    SwInsTableDlg* pDlg = new SwInsTableDlg(rView);
+    VclPtr<SwInsTableDlg> pDlg = VclPtr<SwInsTableDlg>::Create(rView);
     return new AbstractInsTableDlg_Impl( pDlg );
 }
 
 AbstractJavaEditDialog * SwAbstractDialogFactory_Impl::CreateJavaEditDialog(
     vcl::Window* pParent, SwWrtShell* pWrtSh)
 {
-    SwJavaEditDialog* pDlg = new SwJavaEditDialog(pParent, pWrtSh);
+    VclPtr<SwJavaEditDialog> pDlg = VclPtr<SwJavaEditDialog>::Create(pParent, pWrtSh);
     return new AbstractJavaEditDialog_Impl( pDlg );
 }
 
@@ -1017,35 +1016,35 @@ AbstractMailMergeDlg * SwAbstractDialogFactory_Impl::CreateMailMergeDlg( int nRe
                                                 const uno::Reference< sdbc::XConnection>& xConnection,
                                                 uno::Sequence< uno::Any >* pSelection )
 {
-    SwMailMergeDlg* pDlg=NULL;
+    VclPtr<SwMailMergeDlg> pDlg;
     switch ( nResId )
     {
         case DLG_MAILMERGE :
-            pDlg = new SwMailMergeDlg( pParent, rSh, rSourceName, rTblName, nCommandType, xConnection, pSelection );
+            pDlg = VclPtr<SwMailMergeDlg>::Create( pParent, rSh, rSourceName, rTblName, nCommandType, xConnection, pSelection );
             break;
         default:
             break;
     }
-    if ( pDlg )
+    if ( pDlg.get() )
         return new AbstractMailMergeDlg_Impl( pDlg );
     return 0;
 }
 
 AbstractMailMergeCreateFromDlg * SwAbstractDialogFactory_Impl::CreateMailMergeCreateFromDlg(vcl::Window* pParent)
 {
-    SwMailMergeCreateFromDlg* pDlg = new SwMailMergeCreateFromDlg(pParent);
+    VclPtr<SwMailMergeCreateFromDlg> pDlg = VclPtr<SwMailMergeCreateFromDlg>::Create(pParent);
     return new AbstractMailMergeCreateFromDlg_Impl(pDlg);
 }
 
 AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent)
 {
-    SwMailMergeFieldConnectionsDlg* pDlg = new SwMailMergeFieldConnectionsDlg( pParent );
+    VclPtr<SwMailMergeFieldConnectionsDlg> pDlg = VclPtr<SwMailMergeFieldConnectionsDlg>::Create( pParent );
     return new AbstractMailMergeFieldConnectionsDlg_Impl( pDlg );
 }
 
 VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg(vcl::Window* pParent, SwTOXMgr &rTOXMgr)
 {
-    Dialog* pDlg = new SwMultiTOXMarkDlg(pParent, rTOXMgr);
+    VclPtr<Dialog> pDlg = VclPtr<SwMultiTOXMarkDlg>::Create(pParent, rTOXMgr);
     return new VclAbstractDialog_Impl(pDlg);
 }
 
@@ -1054,20 +1053,20 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTabDialog( int nResI
                                                 const SfxItemSet* pSwItemSet,
                                                 SwWrtShell & rWrtSh )
 {
-    SfxTabDialog* pDlg=NULL;
+    VclPtr<SfxTabDialog> pDlg;
     switch ( nResId )
     {
         case DLG_SVXTEST_NUM_BULLET :
-            pDlg = new SwSvxNumBulletTabDialog( pParent, pSwItemSet, rWrtSh );
+            pDlg = VclPtr<SwSvxNumBulletTabDialog>::Create( pParent, pSwItemSet, rWrtSh );
             break;
         case DLG_TAB_OUTLINE :
-            pDlg = new SwOutlineTabDialog( pParent, pSwItemSet, rWrtSh );
+            pDlg = VclPtr<SwOutlineTabDialog>::Create( pParent, pSwItemSet, rWrtSh );
             break;
 
         default:
             break;
     }
-    if ( pDlg )
+    if ( pDlg.get() )
         return new AbstractTabDialog_Impl( pDlg );
     return 0;
 }
@@ -1078,20 +1077,20 @@ AbstractMultiTOXTabDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXTabDialo
                                                 SwTOXBase* pCurTOX, sal_uInt16 nToxType,
                                                 bool bGlobal)
 {
-    SwMultiTOXTabDialog* pDlg = new SwMultiTOXTabDialog( pParent, rSet, rShell, pCurTOX, nToxType, bGlobal );
+    VclPtr<SwMultiTOXTabDialog> pDlg = VclPtr<SwMultiTOXTabDialog>::Create( pParent, rSet, rShell, pCurTOX, nToxType, bGlobal );
     return new AbstractMultiTOXTabDialog_Impl( pDlg );
 }
 
 AbstractEditRegionDlg * SwAbstractDialogFactory_Impl::CreateEditRegionDlg(vcl::Window* pParent, SwWrtShell& rWrtSh)
 {
-    SwEditRegionDlg* pDlg = new SwEditRegionDlg( pParent, rWrtSh );
+    VclPtr<SwEditRegionDlg> pDlg = VclPtr<SwEditRegionDlg>::Create( pParent, rWrtSh );
     return new AbstractEditRegionDlg_Impl( pDlg );
 }
 
 AbstractInsertSectionTabDialog * SwAbstractDialogFactory_Impl::CreateInsertSectionTabDialog(
                                                     vcl::Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh)
 {
-    SwInsertSectionTabDialog* pDlg = new SwInsertSectionTabDialog(pParent, rSet, rSh);
+    VclPtr<SwInsertSectionTabDialog> pDlg = VclPtr<SwInsertSectionTabDialog>::Create(pParent, rSet, rSh);
     return new AbstractInsertSectionTabDialog_Impl(pDlg);
 }
 
@@ -1102,7 +1101,7 @@ AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateIndexMarkFloatDlg(
                                                        SfxChildWinInfo* pInfo,
                                                        bool bNew )
 {
-    SwIndexMarkFloatDlg* pDlg = new SwIndexMarkFloatDlg(pBindings, pChild, pParent, pInfo, bNew);
+    VclPtr<SwIndexMarkFloatDlg> pDlg = VclPtr<SwIndexMarkFloatDlg>::Create(pBindings, pChild, pParent, pInfo, bNew);
     return new AbstractIndexMarkFloatDlg_Impl(pDlg);
 }
 
@@ -1113,7 +1112,7 @@ AbstractMarkFloatDlg * SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg(
                                                        SfxChildWinInfo* pInfo,
                                                        bool bNew)
 {
-    SwAuthMarkFloatDlg* pDlg = new SwAuthMarkFloatDlg( pBindings, pChild, pParent, pInfo, bNew );
+    VclPtr<SwAuthMarkFloatDlg> pDlg = VclPtr<SwAuthMarkFloatDlg>::Create( pBindings, pChild, pParent, pInfo, bNew );
     return new AbstractAuthMarkFloatDlg_Impl( pDlg );
 }
 
@@ -1123,21 +1122,21 @@ AbstractSwWordCountFloatDlg * SwAbstractDialogFactory_Impl::CreateSwWordCountDia
                                                                               vcl::Window *pParent,
                                                                               SfxChildWinInfo* pInfo)
 {
-    SwWordCountFloatDlg* pDlg = new SwWordCountFloatDlg( pBindings, pChild, pParent, pInfo );
+    VclPtr<SwWordCountFloatDlg> pDlg = VclPtr<SwWordCountFloatDlg>::Create( pBindings, pChild, pParent, pInfo );
     return new AbstractSwWordCountFloatDlg_Impl( pDlg );
 }
 
 VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg(
                                                 vcl::Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark )
 {
-    Dialog* pDlg = new SwIndexMarkModalDlg( pParent, rSh, pCurTOXMark );
+    VclPtr<Dialog> pDlg = VclPtr<SwIndexMarkModalDlg>::Create( pParent, rSh, pCurTOXMark );
     return new VclAbstractDialog_Impl( pDlg );
 }
 
 AbstractMailMergeWizard*    SwAbstractDialogFactory_Impl::CreateMailMergeWizard(
                                     SwView& rView, SwMailMergeConfigItem& rConfigItem)
 {
-    return new AbstractMailMergeWizard_Impl( new SwMailMergeWizard(rView, rConfigItem));
+    return new AbstractMailMergeWizard_Impl( VclPtr<SwMailMergeWizard>::Create(rView, rConfigItem));
 }
 
 GlossaryGetCurrGroup    SwAbstractDialogFactory_Impl::GetGlossaryCurrGroupFunc()
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 73a396c..199183e 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1689,7 +1689,7 @@ void SwInsertSectionTabPage::Reset( const SfxItemSet* )
 SfxTabPage* SwInsertSectionTabPage::Create( vcl::Window* pParent,
                                 const SfxItemSet* rAttrSet)
 {
-    return new SwInsertSectionTabPage(pParent, *rAttrSet);
+    return VclPtr<SwInsertSectionTabPage>::Create(pParent, *rAttrSet);
 }
 
 IMPL_LINK( SwInsertSectionTabPage, ChangeHideHdl, CheckBox *, pBox )
@@ -2055,7 +2055,7 @@ void SwSectionFtnEndTabPage::Reset( const SfxItemSet* rSet )
 SfxTabPage* SwSectionFtnEndTabPage::Create( vcl::Window* pParent,
                                 const SfxItemSet* rAttrSet)
 {
-    return new SwSectionFtnEndTabPage(pParent, *rAttrSet);
+    return VclPtr<SwSectionFtnEndTabPage>::Create(pParent, *rAttrSet);
 }
 
 IMPL_LINK( SwSectionFtnEndTabPage, FootEndHdl, CheckBox *, pBox )
@@ -2225,7 +2225,7 @@ void SwSectionIndentTabPage::Reset( const SfxItemSet* rSet)
 
 SfxTabPage*  SwSectionIndentTabPage::Create( vcl::Window* pParent, const SfxItemSet* rAttrSet)
 {
-    return new SwSectionIndentTabPage(pParent, *rAttrSet);
+    return VclPtr<SwSectionIndentTabPage>::Create(pParent, *rAttrSet);
 }
 
 void SwSectionIndentTabPage::SetWrtShell(SwWrtShell& rSh)
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index b8ec0bd..2288a06 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -463,7 +463,7 @@ void SwEnvFmtPage::SetMinMax()
 
 SfxTabPage* SwEnvFmtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
 {
-    return new SwEnvFmtPage(pParent, *rSet);
+    return VclPtr<SwEnvFmtPage>::Create(pParent, *rSet);
 }
 
 void SwEnvFmtPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx
index 6a0b096..f8a4e31 100644
--- a/sw/source/ui/envelp/envfmt.hxx
+++ b/sw/source/ui/envelp/envfmt.hxx
@@ -43,8 +43,6 @@ class SwEnvFmtPage : public SfxTabPage
 
     std::vector<sal_uInt16>  aIDs;
 
-    SwEnvFmtPage(vcl::Window* pParent, const SfxItemSet& rSet);
-
     DECL_LINK( ModifyHdl, Edit * );
     DECL_LINK( EditHdl, MenuButton * );
     DECL_LINK(FormatHdl, void *);
@@ -59,6 +57,7 @@ class SwEnvFmtPage : public SfxTabPage
     using TabPage::DeactivatePage;
 
 public:
+    SwEnvFmtPage(vcl::Window* pParent, const SfxItemSet& rSet);
     virtual ~SwEnvFmtPage();
     virtual void dispose() SAL_OVERRIDE;
 
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx
index 3566307..2d9f861 100644
--- a/sw/source/ui/envelp/envlop1.cxx
+++ b/sw/source/ui/envelp/envlop1.cxx
@@ -325,7 +325,7 @@ void SwEnvPage::InitDatabaseBox()
 
 SfxTabPage* SwEnvPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
 {
-    return new SwEnvPage(pParent, *rSet);
+    return VclPtr<SwEnvPage>::Create(pParent, *rSet);
 }
 
 void SwEnvPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/envprt.cxx b/sw/source/ui/envelp/envprt.cxx
index b6b8a3f..42b65bc 100644
--- a/sw/source/ui/envelp/envprt.cxx
+++ b/sw/source/ui/envelp/envprt.cxx
@@ -146,7 +146,7 @@ IMPL_LINK_NOARG(SwEnvPrtPage, AlignHdl)
 
 SfxTabPage* SwEnvPrtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
 {
-    return new SwEnvPrtPage(pParent, *rSet);
+    return VclPtr<SwEnvPrtPage>::Create(pParent, *rSet);
 }
 
 void SwEnvPrtPage::ActivatePage(const SfxItemSet&)
diff --git a/sw/source/ui/envelp/envprt.hxx b/sw/source/ui/envelp/envprt.hxx
index ba57573..a819832 100644
--- a/sw/source/ui/envelp/envprt.hxx
+++ b/sw/source/ui/envelp/envprt.hxx
@@ -47,8 +47,6 @@ class SwEnvPrtPage : public SfxTabPage
 
     VclPtr<Printer>     pPrt;
 
-    SwEnvPrtPage(vcl::Window* pParent, const SfxItemSet& rSet);
-
     DECL_LINK(ClickHdl, void *);
     DECL_LINK(AlignHdl, void *);
     DECL_LINK( ButtonHdl, Button * );
@@ -59,6 +57,7 @@ class SwEnvPrtPage : public SfxTabPage
     using TabPage::DeactivatePage;
 
 public:
+    SwEnvPrtPage(vcl::Window* pParent, const SfxItemSet& rSet);
     virtual ~SwEnvPrtPage();
     virtual void dispose() SAL_OVERRIDE;
 
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index cfffa1f..dfd415e 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -490,7 +490,7 @@ void SwLabPage::InitDatabaseBox()
 
 SfxTabPage* SwLabPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
 {
-    return new SwLabPage(pParent, *rSet);
+    return VclPtr<SwLabPage>::Create(pParent, *rSet);
 }
 
 void SwLabPage::ActivatePage(const SfxItemSet& rSet)
@@ -635,7 +635,7 @@ void SwVisitingCardPage::dispose()
 
 SfxTabPage* SwVisitingCardPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
 {
-    return new SwVisitingCardPage(pParent, *rSet);
+    return VclPtr<SwVisitingCardPage>::Create(pParent, *rSet);
 }
 
 void SwVisitingCardPage::ActivatePage(const SfxItemSet& rSet)
@@ -796,7 +796,7 @@ void SwPrivateDataPage::dispose()
 
 SfxTabPage* SwPrivateDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
 {
-    return new SwPrivateDataPage(pParent, *rSet);
+    return VclPtr<SwPrivateDataPage>::Create(pParent, *rSet);
 }
 
 void SwPrivateDataPage::ActivatePage(const SfxItemSet& rSet)
@@ -909,7 +909,7 @@ void SwBusinessDataPage::dispose()
 
 SfxTabPage* SwBusinessDataPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
 {
-    return new SwBusinessDataPage(pParent, *rSet);
+    return VclPtr<SwBusinessDataPage>::Create(pParent, *rSet);
 }
 
 void SwBusinessDataPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index 7ff48c7..95ac892 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -487,7 +487,7 @@ void SwLabFmtPage::ChangeMinMax()
 
 SfxTabPage* SwLabFmtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
 {
-    return new SwLabFmtPage(pParent, *rSet);
+    return VclPtr<SwLabFmtPage>::Create(pParent, *rSet);
 }
 
 void SwLabFmtPage::ActivatePage(const SfxItemSet& rSet)
diff --git a/sw/source/ui/envelp/labfmt.hxx b/sw/source/ui/envelp/labfmt.hxx
index 1606ccd..4fbad48 100644
--- a/sw/source/ui/envelp/labfmt.hxx
+++ b/sw/source/ui/envelp/labfmt.hxx
@@ -89,8 +89,6 @@ class SwLabFmtPage : public SfxTabPage
 
     SwLabItem    aItem;
 
-     SwLabFmtPage(vcl::Window* pParent, const SfxItemSet& rSet);
-
     DECL_LINK(ModifyHdl, void *);
     DECL_LINK(PreviewHdl, void *);
     DECL_LINK( LoseFocusHdl, Control * );
@@ -102,6 +100,7 @@ class SwLabFmtPage : public SfxTabPage
     using TabPage::DeactivatePage;
 
 public:
+    SwLabFmtPage(vcl::Window* pParent, const SfxItemSet& rSet);
     virtual ~SwLabFmtPage();
     virtual void dispose() SAL_OVERRIDE;
 
diff --git a/sw/source/ui/envelp/labprt.cxx b/sw/source/ui/envelp/labprt.cxx
index 4fd81fe..9c62af3 100644
--- a/sw/source/ui/envelp/labprt.cxx
+++ b/sw/source/ui/envelp/labprt.cxx
@@ -110,7 +110,7 @@ IMPL_LINK( SwLabPrtPage, CountHdl, Button *, pButton )
 
 SfxTabPage* SwLabPrtPage::Create(vcl::Window* pParent, const SfxItemSet* rSet)
 {
-    return new SwLabPrtPage( pParent, *rSet );
+    return VclPtr<SwLabPrtPage>::Create( pParent, *rSet );
 }
 
 void SwLabPrtPage::ActivatePage( const SfxItemSet& rSet )
diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx
index 123ffe0..99b1649 100644
--- a/sw/source/ui/envelp/labprt.hxx
+++ b/sw/source/ui/envelp/labprt.hxx
@@ -44,8 +44,6 @@ class SwLabPrtPage : public SfxTabPage
     VclPtr<FixedText>    m_pPrinterInfo;
     VclPtr<PushButton>   m_pPrtSetup;
 
-     SwLabPrtPage(vcl::Window* pParent, const SfxItemSet& rSet);
-
     DECL_LINK( CountHdl, Button * );
 
     SwLabDlg* GetParentSwLabDlg() {return static_cast<SwLabDlg*>(GetParentDialog());}
@@ -54,6 +52,7 @@ class SwLabPrtPage : public SfxTabPage
     using TabPage::DeactivatePage;
 
 public:
+    SwLabPrtPage(vcl::Window* pParent, const SfxItemSet& rSet);
     virtual ~SwLabPrtPage();
     virtual void dispose() SAL_OVERRIDE;
 
diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx
index f6ca588..a7ca3ea 100644
--- a/sw/source/ui/envelp/swuilabimp.hxx
+++ b/sw/source/ui/envelp/swuilabimp.hxx
@@ -47,8 +47,6 @@ class SwLabPage : public SfxTabPage
 
     bool        m_bLabel;
 
-    SwLabPage(vcl::Window* pParent, const SfxItemSet& rSet);
-
     DECL_LINK(AddrHdl, void *);
     DECL_LINK( DatabaseHdl, ListBox *pListBox );
     DECL_LINK(FieldHdl, void *);
@@ -63,6 +61,8 @@ class SwLabPage : public SfxTabPage
     using TabPage::DeactivatePage;
 
 public:
+    SwLabPage(vcl::Window* pParent, const SfxItemSet& rSet);
+
     virtual ~SwLabPage();
     virtual void dispose() SAL_OVERRIDE;
 
@@ -110,7 +110,6 @@ class SwVisitingCardPage : public SfxTabPage
                                     const OUString* pNames,
                                     const OUString* pValues );
 
-    SwVisitingCardPage(vcl::Window* pParent, const SfxItemSet& rSet);
     virtual ~SwVisitingCardPage();
     virtual void dispose() SAL_OVERRIDE;
 
@@ -118,6 +117,7 @@ class SwVisitingCardPage : public SfxTabPage
     using TabPage::DeactivatePage;
 
 public:
+    SwVisitingCardPage(vcl::Window* pParent, const SfxItemSet& rSet);
 
     static SfxTabPage* Create(vcl::Window* pParent, const SfxItemSet* rSet);
 
@@ -150,12 +150,11 @@ class SwPrivateDataPage : public SfxTabPage
     VclPtr<Edit> m_pHomePageED;
     VclPtr<Edit> m_pMailED;
 
-    SwPrivateDataPage(vcl::Window* pParent, const SfxItemSet& rSet);
-
     using TabPage::ActivatePage;
     using TabPage::DeactivatePage;
 
 public:
+    SwPrivateDataPage(vcl::Window* pParent, const SfxItemSet& rSet);
     virtual ~SwPrivateDataPage();
     virtual void dispose() SAL_OVERRIDE;
 
@@ -188,12 +187,11 @@ class SwBusinessDataPage : public SfxTabPage
     VclPtr<Edit> m_pHomePageED;
     VclPtr<Edit> m_pMailED;
 
-    SwBusinessDataPage(vcl::Window* pParent, const SfxItemSet& rSet);
-
     using TabPage::ActivatePage;
     using TabPage::DeactivatePage;
 
 public:
+    SwBusinessDataPage(vcl::Window* pParent, const SfxItemSet& rSet);
     virtual ~SwBusinessDataPage();
     virtual void dispose() SAL_OVERRIDE;
 
diff --git a/sw/source/uibase/inc/drpcps.hxx b/sw/source/uibase/inc/drpcps.hxx
index 2cfb11f..3657ecb 100644
--- a/sw/source/uibase/inc/drpcps.hxx
+++ b/sw/source/uibase/inc/drpcps.hxx
@@ -66,8 +66,6 @@ friend class SwDropCapsPict;
 
     SwWrtShell &rSh;
 
-    SwDropCapsPage(vcl::Window *pParent, const SfxItemSet &rSet);
-
     virtual int     DeactivatePage(SfxItemSet *pSet) SAL_OVERRIDE;
     void    FillSet( SfxItemSet &rSet );
 
@@ -82,6 +80,7 @@ friend class SwDropCapsPict;
     static const sal_uInt16 aPageRg[];
 
 public:
+    SwDropCapsPage(vcl::Window *pParent, const SfxItemSet &rSet);
     virtual ~SwDropCapsPage();
     virtual void dispose() SAL_OVERRIDE;
 
diff --git a/sw/source/uibase/inc/envlop.hxx b/sw/source/uibase/inc/envlop.hxx
index 134c84a..f87db92 100644
--- a/sw/source/uibase/inc/envlop.hxx
+++ b/sw/source/uibase/inc/envlop.hxx
@@ -90,8 +90,6 @@ class SwEnvPage : public SfxTabPage
     SwWrtShell*   pSh;
     OUString      sActDBName;
 
-     SwEnvPage(vcl::Window* pParent, const SfxItemSet& rSet);
-
     DECL_LINK( DatabaseHdl, ListBox * );
     DECL_LINK(FieldHdl, void *);
     DECL_LINK(SenderHdl, void *);
@@ -104,6 +102,7 @@ class SwEnvPage : public SfxTabPage
     using SfxTabPage::DeactivatePage;
 
 public:
+    SwEnvPage(vcl::Window* pParent, const SfxItemSet& rSet);
     virtual ~SwEnvPage();
     virtual void dispose() SAL_OVERRIDE;
 
diff --git a/sw/source/uibase/inc/numpara.hxx b/sw/source/uibase/inc/numpara.hxx
index f17660d..60e4ff2 100644
--- a/sw/source/uibase/inc/numpara.hxx
+++ b/sw/source/uibase/inc/numpara.hxx
@@ -62,14 +62,14 @@ class SwParagraphNumTabPage : public SfxTabPage
     static const sal_uInt16 aPageRg[];
 
 protected:
-        SwParagraphNumTabPage(vcl::Window* pParent, const SfxItemSet& rSet );
     void aCountParaFL();
     bool    ExecuteEditNumStyle_Impl( sal_uInt16 nId, const OUString& rStr, const OUString& rRefStr,
                           sal_uInt16 nFamily, sal_uInt16 nMask = 0,
                           const sal_uInt16* pModifier = NULL );
 
 public:
-        virtual ~SwParagraphNumTabPage();
+    SwParagraphNumTabPage(vcl::Window* pParent, const SfxItemSet& rSet );
+    virtual ~SwParagraphNumTabPage();
     virtual void        dispose() SAL_OVERRIDE;
 
     static SfxTabPage*  Create( vcl::Window* pParent,
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index 28f3c33..e324ab7 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -115,9 +115,9 @@ class SwAddPrinterTabPage : public SfxTabPage
                 DECL_LINK(AutoClickHdl, void *);
                 DECL_LINK(SelectHdl, void *);
 
-                SwAddPrinterTabPage( vcl::Window* pParent,
-                                           const SfxItemSet& rSet );
 public:
+    SwAddPrinterTabPage( vcl::Window* pParent,
+                         const SfxItemSet& rSet );
     virtual ~SwAddPrinterTabPage();
     virtual void dispose() SAL_OVERRIDE;
 
@@ -188,12 +188,12 @@ class SwStdFontTabPage : public SfxTabPage
     DECL_LINK( ModifyHeightHdl, FontSizeBox * );
     DECL_LINK( LoseFocusHdl, ComboBox * );
 
-            SwStdFontTabPage( vcl::Window* pParent,
-                                       const SfxItemSet& rSet );
-            virtual ~SwStdFontTabPage();
+     virtual ~SwStdFontTabPage();
      virtual void       dispose() SAL_OVERRIDE;
 
 public:
+    SwStdFontTabPage( vcl::Window* pParent,
+                                       const SfxItemSet& rSet );
     static SfxTabPage*  Create( vcl::Window* pParent,
                                 const SfxItemSet* rAttrSet );
 
@@ -230,10 +230,10 @@ class SwTableOptionsTabPage : public SfxTabPage
 
     DECL_LINK(CheckBoxHdl, void *);
 
-                SwTableOptionsTabPage( vcl::Window* pParent,
-                                           const SfxItemSet& rSet );
 public:
-                virtual ~SwTableOptionsTabPage();
+    SwTableOptionsTabPage( vcl::Window* pParent,
+                                           const SfxItemSet& rSet );
+    virtual ~SwTableOptionsTabPage();
     virtual void dispose() SAL_OVERRIDE;
 
     static SfxTabPage*  Create( vcl::Window* pParent,
@@ -277,9 +277,8 @@ class SwShdwCrsrOptionsTabPage : public SfxTabPage
 
     SwWrtShell *    m_pWrtShell;
 
-    SwShdwCrsrOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
-
 public:
+    SwShdwCrsrOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
     virtual ~SwShdwCrsrOptionsTabPage();
     virtual void dispose() SAL_OVERRIDE;
 
@@ -352,8 +351,6 @@ class SwRedlineOptionsTabPage : public SfxTabPage
     OUString             sAuthor;
     OUString             sNone;
 
-    SwRedlineOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
-
     DECL_LINK( AttribHdl, ListBox *pLB );
     DECL_LINK(ChangedMaskPrevHdl, void * = 0);
     DECL_LINK( ColorHdl, ColorListBox *pColorLB );
@@ -361,6 +358,7 @@ class SwRedlineOptionsTabPage : public SfxTabPage
     void                InitFontStyle(SvxFontPrevWindow& rExampleWin);
 
 public:
+    SwRedlineOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
     virtual ~SwRedlineOptionsTabPage();
     virtual void dispose() SAL_OVERRIDE;
 
@@ -419,12 +417,11 @@ class SwCompareOptionsTabPage : public SfxTabPage
     VclPtr<NumericField> m_pLenNF;
     VclPtr<CheckBox>     m_pStoreRsidCB;
 
-    SwCompareOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
-
     DECL_LINK(ComparisonHdl, void *);
     DECL_LINK(IgnoreHdl, void *);
 
 public:
+    SwCompareOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
     virtual ~SwCompareOptionsTabPage();
     virtual void dispose() SAL_OVERRIDE;
 
diff --git a/sw/source/uibase/inc/swuiccoll.hxx b/sw/source/uibase/inc/swuiccoll.hxx
index f9b4a2e..a1bc1e1 100644
--- a/sw/source/uibase/inc/swuiccoll.hxx
+++ b/sw/source/uibase/inc/swuiccoll.hxx
@@ -47,7 +47,6 @@ class SwCondCollPage : public SfxTabPage
 
     bool                bNewTemplate;
 
-    SwCondCollPage(vcl::Window *pParent, const SfxItemSet &rSet);
     virtual ~SwCondCollPage();
     virtual void dispose() SAL_OVERRIDE;
 
@@ -63,6 +62,7 @@ class SwCondCollPage : public SfxTabPage
     static const sal_uInt16 aPageRg[];
 
 public:
+    SwCondCollPage(vcl::Window *pParent, const SfxItemSet &rSet);
 
     static SfxTabPage *Create(vcl::Window *pParent, const SfxItemSet *rSet);
     static const sal_uInt16* GetRanges() { return aPageRg; }


More information about the Libreoffice-commits mailing list