[Libreoffice-commits] core.git: Branch 'feature/vclptr' - include/svtools svtools/source

Noel Grandin noel at peralex.com
Fri Apr 17 08:20:26 PDT 2015


 include/svtools/brwbox.hxx                    |    2 +-
 include/svtools/calendar.hxx                  |    2 +-
 include/svtools/editbrowsebox.hxx             |    2 +-
 include/svtools/toolbarmenu.hxx               |    2 +-
 svtools/source/brwbox/brwbox1.cxx             |   10 +++++-----
 svtools/source/brwbox/brwbox2.cxx             |    2 +-
 svtools/source/brwbox/ebbcontrols.cxx         |    2 +-
 svtools/source/brwbox/editbrowsebox.cxx       |    6 +++---
 svtools/source/contnr/DocumentInfoPreview.cxx |    2 +-
 svtools/source/contnr/fileview.cxx            |    4 ++--
 svtools/source/contnr/imivctl1.cxx            |   11 ++++++-----
 svtools/source/contnr/simptabl.cxx            |    2 +-
 svtools/source/contnr/svimpbox.cxx            |    6 +++---
 svtools/source/contnr/treelistbox.cxx         |    4 ++--
 svtools/source/control/calendar.cxx           |   12 ++++++------
 svtools/source/control/filectrl.cxx           |    4 ++--
 svtools/source/control/roadmap.cxx            |    4 ++--
 svtools/source/control/ruler.cxx              |    2 +-
 svtools/source/control/scrwin.cxx             |    6 +++---
 svtools/source/control/tabbar.cxx             |   12 ++++++------
 svtools/source/control/toolbarmenu.cxx        |    4 ++--
 svtools/source/control/valueset.cxx           |    6 +++---
 svtools/source/dialogs/prnsetup.cxx           |    8 ++++----
 svtools/source/dialogs/roadmapwizard.cxx      |    2 +-
 svtools/source/dialogs/wizardmachine.cxx      |   10 +++++-----
 svtools/source/hatchwindow/hatchwindow.cxx    |    2 +-
 svtools/source/misc/ehdl.cxx                  |    8 ++++----
 svtools/source/table/tablecontrol_impl.cxx    |    7 ++++---
 svtools/source/toolpanel/drawerlayouter.cxx   |    2 +-
 svtools/source/toolpanel/paneltabbar.cxx      |    6 +++---
 svtools/source/toolpanel/tablayouter.cxx      |    2 +-
 svtools/source/toolpanel/toolpaneldeck.cxx    |    2 +-
 svtools/source/toolpanel/toolpaneldrawer.cxx  |    6 +++---
 svtools/source/uno/treecontrolpeer.cxx        |    2 +-
 svtools/source/uno/unoiface.cxx               |   16 ++++++++--------
 svtools/source/uno/wizard/wizardshell.cxx     |    2 +-
 36 files changed, 92 insertions(+), 90 deletions(-)

New commits:
commit 3f5733216541c5b1e9d86861812a7a857703740c
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Apr 17 17:16:46 2015 +0200

    svtools: convert new to ::Create.
    
    Change-Id: I1f46485d23c57b2ca212ba1c349b07f22265bc89

diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx
index b7d9004..86cde1a 100644
--- a/include/svtools/brwbox.hxx
+++ b/include/svtools/brwbox.hxx
@@ -394,7 +394,7 @@ protected:
     void            DoHideCursor( const char *pWhoLog );
     short           GetCursorHideCount() const;
 
-    virtual BrowserHeader*  CreateHeaderBar( BrowseBox* pParent );
+    virtual VclPtr<BrowserHeader> CreateHeaderBar( BrowseBox* pParent );
 
     // HACK(virtual create is not called in Ctor)
     void            SetHeaderBar( BrowserHeader* );
diff --git a/include/svtools/calendar.hxx b/include/svtools/calendar.hxx
index 189be3a..48173a3 100644
--- a/include/svtools/calendar.hxx
+++ b/include/svtools/calendar.hxx
@@ -423,7 +423,7 @@ public:
     void        Select();
 
     virtual bool        ShowDropDown( bool bShow ) SAL_OVERRIDE;
-    Calendar*   CreateCalendar( vcl::Window* pParent );
+    VclPtr<Calendar>    CreateCalendar( vcl::Window* pParent );
     Calendar*           GetCalendar();
 
     void                SetDefaultDate( const Date& rDate ) { maDefaultDate = rDate; }
diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx
index af9ad5a..a62f2b4 100644
--- a/include/svtools/editbrowsebox.hxx
+++ b/include/svtools/editbrowsebox.hxx
@@ -505,7 +505,7 @@ namespace svt
     protected:
         BrowserHeader*  GetHeaderBar() const {return pHeader;}
 
-        virtual BrowserHeader* CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE;
+        virtual VclPtr<BrowserHeader> CreateHeaderBar(BrowseBox* pParent) SAL_OVERRIDE;
 
         // if you want to have an own header ...
         virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent);
diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx
index 598dec3..7c679ac 100644
--- a/include/svtools/toolbarmenu.hxx
+++ b/include/svtools/toolbarmenu.hxx
@@ -69,7 +69,7 @@ public:
     void            appendSeparator();
 
     /** creates an empty ValueSet that is initialized and can be inserted with appendEntry. */
-    ValueSet*       createEmptyValueSetControl();
+    VclPtr<ValueSet> createEmptyValueSetControl();
 
     void            checkEntry( int nEntryId, bool bCheck = true );
 
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 7153322..b13cc7c 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -128,7 +128,7 @@ BrowseBox::BrowseBox( vcl::Window* pParent, const ResId& rId, BrowserMode nMode
     :Control( pParent, rId )
     ,DragSourceHelper( this )
     ,DropTargetHelper( this )
-    ,aHScroll( new ScrollBar(this, WinBits(WB_HSCROLL)) )
+    ,aHScroll( VclPtr<ScrollBar>::Create(this, WinBits(WB_HSCROLL)) )
 {
     ConstructImpl(nMode);
 }
@@ -2284,9 +2284,9 @@ void BrowseBox::SetMode( BrowserMode nMode )
         WB_VSCROLL | ( ( nMode & BROWSER_THUMBDRAGGING ) ? WB_DRAG : 0 );
     pVScroll = VclPtr<ScrollBar>(
                 ( nMode & BROWSER_TRACKING_TIPS ) == BROWSER_TRACKING_TIPS
-                ? new BrowserScrollBar( this, nVScrollWinBits,
+                ? VclPtr<BrowserScrollBar>::Create( this, nVScrollWinBits,
                                         static_cast<BrowserDataWin*>( pDataWin.get() ) )
-                : new ScrollBar( this, nVScrollWinBits ),
+                : VclPtr<ScrollBar>::Create( this, nVScrollWinBits ),
                 SAL_NO_ACQUIRE);
     pVScroll->SetLineSize( 1 );
     pVScroll->SetPageSize(1);
@@ -2397,9 +2397,9 @@ long BrowseBox::GetDataRowHeight() const
 
 
 
-BrowserHeader* BrowseBox::CreateHeaderBar( BrowseBox* pParent )
+VclPtr<BrowserHeader> BrowseBox::CreateHeaderBar( BrowseBox* pParent )
 {
-    BrowserHeader* pNewBar = new BrowserHeader( pParent );
+    VclPtr<BrowserHeader> pNewBar = VclPtr<BrowserHeader>::Create( pParent );
     pNewBar->SetStartDragHdl( LINK( this, BrowseBox, StartDragHdl ) );
     return pNewBar;
 }
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 745308f..e371f5c 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -1251,7 +1251,7 @@ void BrowseBox::UpdateScrollbars()
     if ( nActualCorderWidth )
     {
         if ( !getDataWindow()->pCornerWin )
-            getDataWindow()->pCornerWin = new ScrollBarBox( this, 0 );
+            getDataWindow()->pCornerWin = VclPtr<ScrollBarBox>::Create( this, 0 );
         getDataWindow()->pCornerWin->SetPosSizePixel(
             Point( GetOutputSizePixel().Width() - nActualCorderWidth, aHScroll->GetPosPixel().Y() ),
             Size( nActualCorderWidth, nCornerSize ) );
diff --git a/svtools/source/brwbox/ebbcontrols.cxx b/svtools/source/brwbox/ebbcontrols.cxx
index 395f351..111f6c8 100644
--- a/svtools/source/brwbox/ebbcontrols.cxx
+++ b/svtools/source/brwbox/ebbcontrols.cxx
@@ -238,7 +238,7 @@ namespace svt
 
         EnableChildTransparentMode();
 
-        pBox = new TriStateBox(this,WB_CENTER|WB_VCENTER);
+        pBox = VclPtr<TriStateBox>::Create(this,WB_CENTER|WB_VCENTER);
         pBox->SetLegacyNoTextAlign( true );
         pBox->EnableChildTransparentMode();
         pBox->SetPaintTransparent( true );
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index 2aa8d6e..96fa071 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -127,7 +127,7 @@ namespace svt
 
         ImplInitSettings(true, true, true);
 
-        pCheckBoxPaint = new CheckBoxControl(&GetDataWindow());
+        pCheckBoxPaint = VclPtr<CheckBoxControl>::Create(&GetDataWindow());
         pCheckBoxPaint->SetPaintTransparent( true );
         pCheckBoxPaint->SetBackground();
     }
@@ -210,7 +210,7 @@ namespace svt
     }
 
 
-    BrowserHeader* EditBrowseBox::CreateHeaderBar(BrowseBox* pParent)
+    VclPtr<BrowserHeader> EditBrowseBox::CreateHeaderBar(BrowseBox* pParent)
     {
         pHeader = imp_CreateHeaderBar(pParent);
         if (!IsUpdateMode())
@@ -221,7 +221,7 @@ namespace svt
 
     VclPtr<BrowserHeader> EditBrowseBox::imp_CreateHeaderBar(BrowseBox* pParent)
     {
-        return new EditBrowserHeader(pParent);
+        return VclPtr<EditBrowserHeader>::Create(pParent);
     }
 
 
diff --git a/svtools/source/contnr/DocumentInfoPreview.cxx b/svtools/source/contnr/DocumentInfoPreview.cxx
index 7a2be8f..8efa8de 100644
--- a/svtools/source/contnr/DocumentInfoPreview.cxx
+++ b/svtools/source/contnr/DocumentInfoPreview.cxx
@@ -45,7 +45,7 @@ namespace svtools {
 
 ODocumentInfoPreview::ODocumentInfoPreview(vcl::Window * pParent, WinBits nBits):
     Window(pParent, WB_DIALOGCONTROL),
-    m_pEditWin( new ExtMultiLineEdit(this, nBits) ),
+    m_pEditWin( VclPtr<ExtMultiLineEdit>::Create(this, nBits) ),
     m_xInfoTable(new SvtDocInfoTable_Impl),
     m_aLanguageTag(SvtPathOptions().GetLanguageTag()) // detect application language
 {
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 3e781c1..3ad5e52 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -583,7 +583,7 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( vcl::Window* pParentWin,
     mbShowHeader        ( (nFlags & FILEVIEW_SHOW_NONE) == 0 )
 {
     Size aBoxSize = pParentWin->GetSizePixel();
-    mpHeaderBar = new HeaderBar( pParentWin, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
+    mpHeaderBar = VclPtr<HeaderBar>::Create( pParentWin, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
     mpHeaderBar->SetPosSizePixel( Point( 0, 0 ), mpHeaderBar->CalcWindowSizePixel() );
 
     HeaderBarItemBits nBits = ( HIB_LEFT | HIB_VCENTER | HIB_CLICKABLE );
@@ -1581,7 +1581,7 @@ SvtFileView_Impl::SvtFileView_Impl( SvtFileView* pAntiImpl, Reference < XCommand
 
 {
     maAllFilter = "*.*";
-    mpView = new ViewTabListBox_Impl( mpAntiImpl, this, nFlags );
+    mpView = VclPtr<ViewTabListBox_Impl>::Create( mpAntiImpl, this, nFlags );
     mpView->EnableCellFocus();
 }
 
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 0361ab1..8c3df1b 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -91,9 +91,9 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl(
     WinBits nWinStyle
 ) :
     aEntries( this ),
-    aVerSBar( new ScrollBar(pCurView, WB_DRAG | WB_VSCROLL) ),
-    aHorSBar( new ScrollBar(pCurView, WB_DRAG | WB_HSCROLL) ),
-    aScrBarBox( new ScrollBarBox(pCurView) ),
+    aVerSBar( VclPtr<ScrollBar>::Create(pCurView, WB_DRAG | WB_VSCROLL) ),
+    aHorSBar( VclPtr<ScrollBar>::Create(pCurView, WB_DRAG | WB_HSCROLL) ),
+    aScrBarBox( VclPtr<ScrollBarBox>::Create(pCurView) ),
     aImageSize( 32, 32 ),
     pColumns( 0 )
 {
@@ -1684,7 +1684,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntryVirtOutDev( SvxIconChoiceCtrlEntry* pEntr
 {
     if( !pEntryPaintDev )
     {
-        pEntryPaintDev = new VirtualDevice( *pView );
+        pEntryPaintDev = VclPtr<VirtualDevice>::Create( *pView );
         pEntryPaintDev->SetFont( pView->GetFont() );
         pEntryPaintDev->SetLineColor();
         //pEntryPaintDev->SetBackground( pView->GetBackground() );
@@ -3138,7 +3138,8 @@ void SvxIconChoiceCtrl_Impl::EditEntry( SvxIconChoiceCtrlEntry* pEntry )
     aPos = pView->GetPixelPos( aPos );
     aRect.SetPos( aPos );
     pView->HideFocus();
-    pEdit = new IcnViewEdit_Impl(
+    pEdit = VclPtr<IcnViewEdit_Impl>::Create(
+
         pView,
         aRect.TopLeft(),
         aRect.GetSize(),
diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx
index 3b1eb00..6d1684a 100644
--- a/svtools/source/contnr/simptabl.cxx
+++ b/svtools/source/contnr/simptabl.cxx
@@ -92,7 +92,7 @@ void SvSimpleTableContainer::GetFocus()
 SvSimpleTable::SvSimpleTable(SvSimpleTableContainer& rParent, WinBits nBits):
         SvHeaderTabListBox(&rParent, nBits | WB_CLIPCHILDREN | WB_HSCROLL | WB_TABSTOP),
         m_rParentTableContainer(rParent),
-        aHeaderBar(new HeaderBar(&rParent,WB_BUTTONSTYLE | WB_BORDER | WB_TABSTOP)),
+        aHeaderBar(VclPtr<HeaderBar>::Create(&rParent,WB_BUTTONSTYLE | WB_BORDER | WB_TABSTOP)),
         nHeaderItemId(1),
         bPaintFlag(true),
         aCollator(*(IntlWrapper( Application::GetSettings().GetLanguageTag() ).getCaseCollator()))
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index fe38597..d43449a 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -47,9 +47,9 @@ Image*  SvImpLBox::s_pDefExpanded       = NULL;
 sal_Int32 SvImpLBox::s_nImageRefCount   = 0;
 
 SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinStyle)
-    : aVerSBar(new ScrollBar(pLBView, WB_DRAG | WB_VSCROLL))
-    , aHorSBar(new ScrollBar(pLBView, WB_DRAG | WB_HSCROLL))
-    , aScrBarBox(new ScrollBarBox(pLBView))
+    : aVerSBar(VclPtr<ScrollBar>::Create(pLBView, WB_DRAG | WB_VSCROLL))
+    , aHorSBar(VclPtr<ScrollBar>::Create(pLBView, WB_DRAG | WB_HSCROLL))
+    , aScrBarBox(VclPtr<ScrollBarBox>::Create(pLBView))
     , aOutputSize(0, 0)
     , aSelEng(pLBView, (FunctionSet*)0)
     , aFctSet(this, &aSelEng, pLBView)
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 1091438..5d57ad2 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -131,9 +131,9 @@ SvInplaceEdit2::SvInplaceEdit2
 {
 
     if( bMulti )
-        pEdit = new MyMultiEdit_Impl( pParent, this );
+        pEdit = VclPtr<MyMultiEdit_Impl>::Create( pParent, this );
     else
-        pEdit = new MyEdit_Impl( pParent, this );
+        pEdit = VclPtr<MyEdit_Impl>::Create( pParent, this );
 
     vcl::Font aFont( pParent->GetFont() );
     aFont.SetTransparent( false );
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index 50ebc4e..89566f3 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -2244,7 +2244,7 @@ PushButton* ImplCFieldFloatWin::EnableTodayBtn( bool bEnable )
     {
         if ( !mpTodayBtn )
         {
-            mpTodayBtn = new PushButton( this, WB_NOPOINTERFOCUS );
+            mpTodayBtn = VclPtr<PushButton>::Create( this, WB_NOPOINTERFOCUS );
             OUString aTodayText(SVT_RESSTR(STR_SVT_CALENDAR_TODAY));
             mpTodayBtn->SetText( aTodayText );
             Size aSize;
@@ -2272,7 +2272,7 @@ PushButton* ImplCFieldFloatWin::EnableNoneBtn( bool bEnable )
     {
         if ( !mpNoneBtn )
         {
-            mpNoneBtn = new PushButton( this, WB_NOPOINTERFOCUS );
+            mpNoneBtn = VclPtr<PushButton>::Create( this, WB_NOPOINTERFOCUS );
             OUString aNoneText(SVT_RESSTR(STR_SVT_CALENDAR_NONE));
             mpNoneBtn->SetText( aNoneText );
             Size aSize;
@@ -2339,7 +2339,7 @@ void ImplCFieldFloatWin::ArrangeButtons()
     {
         if ( !mpFixedLine )
         {
-            mpFixedLine = new FixedLine( this );
+            mpFixedLine = VclPtr<FixedLine>::Create( this );
             mpFixedLine->Show();
         }
         long nLineWidth = aOutSize.Width()-(CALFIELD_BORDERLINE_X*2);
@@ -2517,9 +2517,9 @@ bool CalendarField::ShowDropDown( bool bShow )
 
 
 
-Calendar* CalendarField::CreateCalendar( vcl::Window* pParent )
+VclPtr<Calendar> CalendarField::CreateCalendar( vcl::Window* pParent )
 {
-    return new Calendar( pParent, mnCalendarStyle | WB_TABSTOP );
+    return VclPtr<Calendar>::Create( pParent, mnCalendarStyle | WB_TABSTOP );
 }
 
 
@@ -2528,7 +2528,7 @@ Calendar* CalendarField::GetCalendar()
 {
     if ( !mpFloatWin )
     {
-        mpFloatWin = new ImplCFieldFloatWin( this );
+        mpFloatWin = VclPtr<ImplCFieldFloatWin>::Create( this );
         mpFloatWin->SetPopupModeEndHdl( LINK( this, CalendarField, ImplPopupModeEndHdl ) );
         mpCalendar = CreateCalendar( mpFloatWin );
         mpCalendar->SetPosPixel( Point() );
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
index 164ab86..fce8ff0 100644
--- a/svtools/source/control/filectrl.cxx
+++ b/svtools/source/control/filectrl.cxx
@@ -36,8 +36,8 @@ using namespace ::com::sun::star::ui;
 
 FileControl::FileControl( vcl::Window* pParent, WinBits nStyle, FileControlMode nFlags ) :
     Window( pParent, nStyle|WB_DIALOGCONTROL ),
-    maEdit( new Edit(this, (nStyle&(~WB_BORDER))|WB_NOTABSTOP) ),
-    maButton( new PushButton( this, (nStyle&(~WB_BORDER))|WB_NOLIGHTBORDER|WB_NOPOINTERFOCUS|WB_NOTABSTOP ) ),
+    maEdit( VclPtr<Edit>::Create(this, (nStyle&(~WB_BORDER))|WB_NOTABSTOP) ),
+    maButton( VclPtr<PushButton>::Create( this, (nStyle&(~WB_BORDER))|WB_NOLIGHTBORDER|WB_NOPOINTERFOCUS|WB_NOTABSTOP ) ),
     maButtonText( SVT_RESSTR(STR_FILECTRL_BUTTONTEXT) ),
     mnFlags( nFlags ),
     mnInternalFlags( FILECTRL_ORIGINALBUTTONTEXT )
diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx
index f062a12..3d15ae3 100644
--- a/svtools/source/control/roadmap.cxx
+++ b/svtools/source/control/roadmap.cxx
@@ -681,10 +681,10 @@ namespace svt
     RoadmapItem::RoadmapItem( ORoadmap& _rParent, const Size& _rItemPlayground )
         :m_aItemPlayground( _rItemPlayground )
     {
-        mpID = new IDLabel( &_rParent, WB_WORDBREAK );
+        mpID = VclPtr<IDLabel>::Create( &_rParent, WB_WORDBREAK );
         mpID->SetTextColor( mpID->GetSettings().GetStyleSettings().GetFieldTextColor( ) );
         mpID->Show();
-        mpDescription = new HyperLabel( &_rParent, WB_NOTABSTOP | WB_WORDBREAK );
+        mpDescription = VclPtr<HyperLabel>::Create( &_rParent, WB_NOTABSTOP | WB_WORDBREAK );
         mpDescription->Show();
     }
 
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 5e45e59..78e75a7 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -290,7 +290,7 @@ void Ruler::ImplInit( WinBits nWinBits )
 
 Ruler::Ruler( vcl::Window* pParent, WinBits nWinStyle ) :
     Window( pParent, nWinStyle & WB_3DLOOK ),
-    maVirDev( new VirtualDevice(*this) ),
+    maVirDev( VclPtr<VirtualDevice>::Create(*this) ),
     maMapMode( MAP_100TH_MM ),
     mpSaveData(new ImplRulerData),
     mpData(NULL),
diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx
index 7c5739a..b29f4b0 100644
--- a/svtools/source/control/scrwin.cxx
+++ b/svtools/source/control/scrwin.cxx
@@ -43,9 +43,9 @@ void ScrollableWindow::ImpInitialize( ScrollableWindowFlags nFlags )
 ScrollableWindow::ScrollableWindow( vcl::Window* pParent, WinBits nBits,
                                     ScrollableWindowFlags nFlags ) :
     Window( pParent, WinBits(nBits|WB_CLIPCHILDREN) ),
-    aVScroll( new ScrollBar(this, WinBits(WB_VSCROLL | WB_DRAG)) ),
-    aHScroll( new ScrollBar(this, WinBits(WB_HSCROLL | WB_DRAG)) ),
-    aCornerWin( new ScrollBarBox(this) )
+    aVScroll( VclPtr<ScrollBar>::Create(this, WinBits(WB_VSCROLL | WB_DRAG)) ),
+    aHScroll( VclPtr<ScrollBar>::Create(this, WinBits(WB_HSCROLL | WB_DRAG)) ),
+    aCornerWin( VclPtr<ScrollBarBox>::Create(this) )
 {
     ImpInitialize( nFlags );
 }
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 4a65042..10cb8c3 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -655,7 +655,7 @@ void TabBar::ImplInitControls()
     {
         if (!mpImpl->mpSizer)
         {
-            mpImpl->mpSizer.reset(new ImplTabSizer( this, mnWinStyle & (WB_DRAG | WB_3DLOOK)));
+            mpImpl->mpSizer.reset(VclPtr<ImplTabSizer>::Create( this, mnWinStyle & (WB_DRAG | WB_3DLOOK)));
         }
         mpImpl->mpSizer->Show();
     }
@@ -668,7 +668,7 @@ void TabBar::ImplInitControls()
     {
         if (!mpImpl->mpPrevButton)
         {
-            mpImpl->mpPrevButton.reset(new ImplTabButton(this, WB_REPEAT));
+            mpImpl->mpPrevButton.reset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
             mpImpl->mpPrevButton->SetClickHdl(aLink);
         }
         mpImpl->mpPrevButton->SetSymbol(mbMirrored ? SymbolType::NEXT : SymbolType::PREV);
@@ -676,7 +676,7 @@ void TabBar::ImplInitControls()
 
         if (!mpImpl->mpNextButton)
         {
-            mpImpl->mpNextButton.reset(new ImplTabButton(this, WB_REPEAT));
+            mpImpl->mpNextButton.reset(VclPtr<ImplTabButton>::Create(this, WB_REPEAT));
             mpImpl->mpNextButton->SetClickHdl(aLink);
         }
         mpImpl->mpNextButton->SetSymbol(mbMirrored ? SymbolType::PREV : SymbolType::NEXT);
@@ -692,7 +692,7 @@ void TabBar::ImplInitControls()
     {
         if (!mpImpl->mpFirstButton)
         {
-            mpImpl->mpFirstButton.reset(new ImplTabButton(this));
+            mpImpl->mpFirstButton.reset(VclPtr<ImplTabButton>::Create(this));
             mpImpl->mpFirstButton->SetClickHdl(aLink);
         }
         mpImpl->mpFirstButton->SetSymbol(mbMirrored ? SymbolType::LAST : SymbolType::FIRST);
@@ -700,7 +700,7 @@ void TabBar::ImplInitControls()
 
         if (!mpImpl->mpLastButton)
         {
-            mpImpl->mpLastButton.reset(new ImplTabButton(this));
+            mpImpl->mpLastButton.reset(VclPtr<ImplTabButton>::Create(this));
             mpImpl->mpLastButton->SetClickHdl(aLink);
         }
         mpImpl->mpLastButton->SetSymbol(mbMirrored ? SymbolType::FIRST : SymbolType::LAST);
@@ -2179,7 +2179,7 @@ bool TabBar::StartEditMode( sal_uInt16 nPageId )
         ImplFormat();
         Update();
 
-        mpImpl->mpEdit.reset(new TabBarEdit(this, WB_CENTER));
+        mpImpl->mpEdit.reset(VclPtr<TabBarEdit>::Create(this, WB_CENTER));
         Rectangle aRect = GetPageRect( mnEditId );
         long nX = aRect.Left();
         long nWidth = aRect.GetWidth();
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index ab3fc1f..af6805c 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -821,9 +821,9 @@ void ToolbarMenu::appendSeparator()
 
 
 /** creates an empty ValueSet that is initialized and can be inserted with appendEntry. */
-ValueSet* ToolbarMenu::createEmptyValueSetControl()
+VclPtr<ValueSet> ToolbarMenu::createEmptyValueSetControl()
 {
-    ValueSet* pSet = new ValueSet( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
+    VclPtr<ValueSet> pSet = VclPtr<ValueSet>::Create( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
     pSet->EnableFullItemMode( false );
     pSet->SetColor( GetControlBackground() );
     pSet->SetHighlightHdl( LINK( this, ToolbarMenu, HighlightHdl ) );
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 844585b..ca07369 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -96,7 +96,7 @@ void ValueSet::ImplInit()
 
 ValueSet::ValueSet( vcl::Window* pParent, WinBits nWinStyle, bool bDisableTransientChildren ) :
     Control( pParent, nWinStyle ),
-    maVirDev( new VirtualDevice(*this) ),
+    maVirDev( VclPtr<VirtualDevice>::Create(*this) ),
     maColor( COL_TRANSPARENT )
 {
     ImplInit();
@@ -116,7 +116,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeValueSet(vcl::Window *
 
 ValueSet::ValueSet( vcl::Window* pParent, const ResId& rResId, bool bDisableTransientChildren ) :
     Control( pParent, rResId ),
-    maVirDev( new VirtualDevice(*this) ),
+    maVirDev( VclPtr<VirtualDevice>::Create(*this) ),
     maColor( COL_TRANSPARENT )
 {
     ImplInit();
@@ -206,7 +206,7 @@ void ValueSet::ImplInitScrollBar()
     {
         if ( !mxScrollBar.get() )
         {
-            mxScrollBar.reset(new ScrollBar( this, WB_VSCROLL | WB_DRAG ));
+            mxScrollBar.reset(VclPtr<ScrollBar>::Create( this, WB_VSCROLL | WB_DRAG ));
             mxScrollBar->SetScrollHdl( LINK( this, ValueSet, ImplScrollHdl ) );
         }
         else
diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx
index a841a59..4cce9b9 100644
--- a/svtools/source/dialogs/prnsetup.cxx
+++ b/svtools/source/dialogs/prnsetup.cxx
@@ -65,9 +65,9 @@ Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
             {
                 if ( (pPrinter->GetName() == pInfo->GetPrinterName()) &&
                      (pPrinter->GetDriverName() == pInfo->GetDriver()) )
-                    pTempPrinter = new Printer( pPrinter->GetJobSetup() );
+                    pTempPrinter = VclPtr<Printer>::Create( pPrinter->GetJobSetup() );
                 else
-                    pTempPrinter = new Printer( *pInfo );
+                    pTempPrinter = VclPtr<Printer>::Create( *pInfo );
             }
             else
             {
@@ -75,7 +75,7 @@ Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
                      (pTempPrinter->GetDriverName() != pInfo->GetDriver()) )
                 {
                     pTempPrinter.disposeAndClear();
-                    pTempPrinter = new Printer( *pInfo );
+                    pTempPrinter = VclPtr<Printer>::Create( *pInfo );
                 }
             }
 
@@ -306,7 +306,7 @@ IMPL_LINK_NOARG(PrinterSetupDialog, ImplStatusHdl)
 IMPL_LINK_NOARG(PrinterSetupDialog, ImplPropertiesHdl)
 {
     if ( !mpTempPrinter )
-        mpTempPrinter = new Printer( mpPrinter->GetJobSetup() );
+        mpTempPrinter = VclPtr<Printer>::Create( mpPrinter->GetJobSetup() );
     mpTempPrinter->Setup( this );
 
     return 0;
diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx
index 87c63f0..0926d40 100644
--- a/svtools/source/dialogs/roadmapwizard.cxx
+++ b/svtools/source/dialogs/roadmapwizard.cxx
@@ -132,7 +132,7 @@ namespace svt
         SetLeftAlignedButtonCount( 1 );
         SetEmptyViewMargin();
 
-        m_pImpl->pRoadmap = new ORoadmap( this, WB_TABSTOP );
+        m_pImpl->pRoadmap.reset( VclPtr<ORoadmap>::Create( this, WB_TABSTOP ) );
         m_pImpl->pRoadmap->SetText( SVT_RESSTR( STR_WIZDLG_ROADMAP_TITLE ) );
         m_pImpl->pRoadmap->SetPosPixel( Point( 0, 0 ) );
         m_pImpl->pRoadmap->SetItemSelectHdl( LINK( this, RoadmapWizard, OnRoadmapItemSelected ) );
diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx
index b3c1793..6af232f 100644
--- a/svtools/source/dialogs/wizardmachine.cxx
+++ b/svtools/source/dialogs/wizardmachine.cxx
@@ -139,7 +139,7 @@ namespace svt
         // the help button
         if (_nButtonFlags & WZB_HELP)
         {
-            m_pHelp= new HelpButton(this, WB_TABSTOP);
+            m_pHelp= VclPtr<HelpButton>::Create(this, WB_TABSTOP);
             m_pHelp->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
             m_pHelp->Show();
             AddButton( m_pHelp, WIZARDDIALOG_BUTTON_STDOFFSET_X);
@@ -148,7 +148,7 @@ namespace svt
         // the previous button
         if (_nButtonFlags & WZB_PREVIOUS)
         {
-            m_pPrevPage = new PushButton(this, WB_TABSTOP);
+            m_pPrevPage = VclPtr<PushButton>::Create(this, WB_TABSTOP);
             m_pPrevPage->SetHelpId( HID_WIZARD_PREVIOUS );
             m_pPrevPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
             m_pPrevPage->SetText(SVT_RESSTR(STR_WIZDLG_PREVIOUS));
@@ -165,7 +165,7 @@ namespace svt
         // the next button
         if (_nButtonFlags & WZB_NEXT)
         {
-            m_pNextPage = new PushButton(this, WB_TABSTOP);
+            m_pNextPage = VclPtr<PushButton>::Create(this, WB_TABSTOP);
             m_pNextPage->SetHelpId( HID_WIZARD_NEXT );
             m_pNextPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
             m_pNextPage->SetText(OUString(SVT_RESSTR(STR_WIZDLG_NEXT)));
@@ -179,7 +179,7 @@ namespace svt
         // the finish button
         if (_nButtonFlags & WZB_FINISH)
         {
-            m_pFinish = new OKButton(this, WB_TABSTOP);
+            m_pFinish = VclPtr<OKButton>::Create(this, WB_TABSTOP);
             m_pFinish->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
             m_pFinish->SetText(SVT_RESSTR(STR_WIZDLG_FINISH));
             m_pFinish->Show();
@@ -191,7 +191,7 @@ namespace svt
         // the cancel button
         if (_nButtonFlags & WZB_CANCEL)
         {
-            m_pCancel = new CancelButton(this, WB_TABSTOP);
+            m_pCancel = VclPtr<CancelButton>::Create(this, WB_TABSTOP);
             m_pCancel->SetSizePixel( LogicToPixel( Size( 50, 14 ), MAP_APPFONT ) );
             m_pCancel->Show();
 
diff --git a/svtools/source/hatchwindow/hatchwindow.cxx b/svtools/source/hatchwindow/hatchwindow.cxx
index f31e8d1..3ca6655 100644
--- a/svtools/source/hatchwindow/hatchwindow.cxx
+++ b/svtools/source/hatchwindow/hatchwindow.cxx
@@ -55,7 +55,7 @@ void VCLXHatchWindow::initializeWindow( const uno::Reference< awt::XWindowPeer >
     if ( !pParent )
         throw lang::IllegalArgumentException(); // TODO
 
-    pHatchWindow = new SvResizeWindow( pParent, this );
+    pHatchWindow = VclPtr<SvResizeWindow>::Create( pParent, this );
     pHatchWindow->setPosSizePixel( aBounds.X, aBounds.Y, aBounds.Width, aBounds.Height );
     aHatchBorderSize = aSize;
     pHatchWindow->SetHatchBorderPixel( Size( aSize.Width, aSize.Height ) );
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 429de05..fa8cf14 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -93,19 +93,19 @@ static sal_uInt16 aWndFunc(
     switch ( nFlags & 0xf000 )
     {
         case ERRCODE_MSG_ERROR:
-            pBox.reset(new ErrorBox(pWin, eBits, aErr));
+            pBox.reset(VclPtr<ErrorBox>::Create(pWin, eBits, aErr));
             break;
 
         case ERRCODE_MSG_WARNING:
-            pBox.reset(new WarningBox(pWin, eBits, aErr));
+            pBox.reset(VclPtr<WarningBox>::Create(pWin, eBits, aErr));
             break;
 
         case ERRCODE_MSG_INFO:
-            pBox.reset(new InfoBox(pWin, aErr));
+            pBox.reset(VclPtr<InfoBox>::Create(pWin, aErr));
             break;
 
         case ERRCODE_MSG_QUERY:
-            pBox.reset(new QueryBox(pWin, eBits, aErr));
+            pBox.reset(VclPtr<QueryBox>::Create(pWin, eBits, aErr));
             break;
 
         default:
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index 7fabd9f..de845d1 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -242,7 +242,7 @@ namespace svt { namespace table
         ,m_nLeftColumn          ( 0                             )
         ,m_nTopRow              ( 0                             )
         ,m_nCursorHidden        ( 1                             )
-        ,m_pDataWindow          ( new TableDataWindow( *this )  )
+        ,m_pDataWindow          ( VclPtr<TableDataWindow>::Create( *this )  )
         ,m_pVScroll             ( NULL                          )
         ,m_pHScroll             ( NULL                          )
         ,m_pScrollCorner        ( NULL                          )
@@ -648,7 +648,8 @@ namespace svt { namespace table
             }
             else if ( !bHaveBar && i_needBar )
             {
-                _rpBar = new ScrollBar(
+                _rpBar = VclPtr<ScrollBar>::Create(
+
                     &_rParent,
                     WB_DRAG | ( _bHorizontal ? WB_HSCROLL : WB_VSCROLL )
                 );
@@ -1169,7 +1170,7 @@ namespace svt { namespace table
         }
         else if ( !bHaveScrollCorner && bNeedScrollCorner )
         {
-            m_pScrollCorner = new ScrollBarBox( &m_rAntiImpl );
+            m_pScrollCorner = VclPtr<ScrollBarBox>::Create( &m_rAntiImpl );
             m_pScrollCorner->SetSizePixel( Size( nScrollbarMetrics, nScrollbarMetrics ) );
             m_pScrollCorner->SetPosPixel( Point( i_dataCellPlayground.Right() + 1, i_dataCellPlayground.Bottom() + 1 ) );
             m_pScrollCorner->Show();
diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx
index 9d3d5e1..1a1d417 100644
--- a/svtools/source/toolpanel/drawerlayouter.cxx
+++ b/svtools/source/toolpanel/drawerlayouter.cxx
@@ -151,7 +151,7 @@ namespace svt
     {
         OSL_PRECOND( i_nPosition <= m_aDrawers.size(), "DrawerDeckLayouter::PanelInserted: inconsistency!" );
 
-        ToolPanelDrawer *pDrawer( new ToolPanelDrawer( m_rParentWindow, i_pPanel->GetDisplayName() ) );
+        VclPtr<ToolPanelDrawer> pDrawer( VclPtr<ToolPanelDrawer>::Create( m_rParentWindow, i_pPanel->GetDisplayName() ) );
         pDrawer->SetHelpId( i_pPanel->GetHelpID() );
         // proper Z-Order
         if ( i_nPosition == 0 )
diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index 467793a..8f3ef5b 100644
--- a/svtools/source/toolpanel/paneltabbar.cxx
+++ b/svtools/source/toolpanel/paneltabbar.cxx
@@ -499,15 +499,15 @@ namespace svt
         ,m_aNormalizer()
         ,m_eTabAlignment( i_eAlignment )
         ,m_rPanelDeck( i_rPanelDeck )
-        ,m_aRenderDevice( new VirtualDevice(i_rTabBar) )
+        ,m_aRenderDevice( VclPtr<VirtualDevice>::Create(i_rTabBar) )
         ,m_pRenderer()
         ,m_aHoveredItem()
         ,m_aFocusedItem()
         ,m_bMouseButtonDown( false )
         ,m_aItems()
         ,m_bItemsDirty( true )
-        ,m_aScrollBack( new PushButton(&i_rTabBar, WB_BEVELBUTTON) )
-        ,m_aScrollForward( new PushButton(&i_rTabBar, WB_BEVELBUTTON) )
+        ,m_aScrollBack( VclPtr<PushButton>::Create(&i_rTabBar, WB_BEVELBUTTON) )
+        ,m_aScrollForward( VclPtr<PushButton>::Create(&i_rTabBar, WB_BEVELBUTTON) )
         ,m_nScrollPosition( 0 )
     {
 #ifdef WNT
diff --git a/svtools/source/toolpanel/tablayouter.cxx b/svtools/source/toolpanel/tablayouter.cxx
index b2e6f24..5c83f28 100644
--- a/svtools/source/toolpanel/tablayouter.cxx
+++ b/svtools/source/toolpanel/tablayouter.cxx
@@ -48,7 +48,7 @@ namespace svt
                 const TabAlignment i_eAlignment, const TabItemContent i_eItemContent )
             :eAlignment( i_eAlignment )
             ,rPanels( i_rPanels )
-            ,pTabBar( new PanelTabBar( i_rParent, i_rPanels, i_eAlignment, i_eItemContent ) )
+            ,pTabBar( VclPtr<PanelTabBar>::Create( i_rParent, i_rPanels, i_eAlignment, i_eItemContent ) )
         {
             pTabBar->Show();
         }
diff --git a/svtools/source/toolpanel/toolpaneldeck.cxx b/svtools/source/toolpanel/toolpaneldeck.cxx
index e816e0d..8544ab1 100644
--- a/svtools/source/toolpanel/toolpaneldeck.cxx
+++ b/svtools/source/toolpanel/toolpaneldeck.cxx
@@ -69,7 +69,7 @@ namespace svt
     public:
         ToolPanelDeck_Impl( ToolPanelDeck& i_rDeck )
             :m_rDeck( i_rDeck )
-            ,m_aPanelAnchor( new vcl::Window(&i_rDeck, WB_DIALOGCONTROL | WB_CHILDDLGCTRL) )
+            ,m_aPanelAnchor( VclPtr<vcl::Window>::Create(&i_rDeck, WB_DIALOGCONTROL | WB_CHILDDLGCTRL) )
             ,m_aPanels()
             ,m_pDummyPanel( new DummyPanel )
             ,m_pLayouter()
diff --git a/svtools/source/toolpanel/toolpaneldrawer.cxx b/svtools/source/toolpanel/toolpaneldrawer.cxx
index 32e9f85..60b9d06 100644
--- a/svtools/source/toolpanel/toolpaneldrawer.cxx
+++ b/svtools/source/toolpanel/toolpaneldrawer.cxx
@@ -68,8 +68,8 @@ namespace svt
 
     ToolPanelDrawer::ToolPanelDrawer( vcl::Window& i_rParent, const OUString& i_rTitle )
         :Window( &i_rParent, WB_TABSTOP )
-        ,m_pPaintDevice( new VirtualDevice( *this ) )
-        ,m_aVisualization( new DrawerVisualization(*this) )
+        ,m_pPaintDevice( VclPtr<VirtualDevice>::Create( *this ) )
+        ,m_aVisualization( VclPtr<DrawerVisualization>::Create(*this) )
         ,m_bFocused( false )
         ,m_bExpanded( false )
     {
@@ -261,7 +261,7 @@ namespace svt
                 if ( !( i_rEvent.GetFlags() & AllSettingsFlags::STYLE ) )
                     break;
                 SetSettings( Application::GetSettings() );
-                m_pPaintDevice.reset( new VirtualDevice( *this ) );
+                m_pPaintDevice.reset( VclPtr<VirtualDevice>::Create( *this ) );
 
                 // fall through.
 
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index 5453863..8808a8d 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -207,7 +207,7 @@ UnoTreeListEntry* TreeControlPeer::getEntry( const Reference< XTreeNode >& xNode
 
 vcl::Window* TreeControlPeer::createVclControl( vcl::Window* pParent, sal_Int64 nWinStyle )
 {
-    mpTreeImpl = new UnoTreeListBoxImpl( this, pParent, nWinStyle );
+    mpTreeImpl = VclPtr<UnoTreeListBoxImpl>::Create( this, pParent, nWinStyle );
     return mpTreeImpl;
 }
 
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index 3673f2f..b30888c 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -68,7 +68,7 @@ SAL_DLLPUBLIC_EXPORT vcl::Window* CreateWindow( VCLXWindow** ppNewComp, const ::
     {
         if ( pParent )
         {
-            pWindow = new MultiLineEdit( pParent, nWinBits|WB_IGNORETAB);
+            pWindow = VclPtr<MultiLineEdit>::Create( pParent, nWinBits|WB_IGNORETAB);
             static_cast< MultiLineEdit* >( pWindow )->DisableSelectionOnFocus();
             *ppNewComp = new VCLXMultiLineEdit;
         }
@@ -82,7 +82,7 @@ SAL_DLLPUBLIC_EXPORT vcl::Window* CreateWindow( VCLXWindow** ppNewComp, const ::
     {
         if ( pParent )
         {
-            pWindow = new FileControl( pParent, nWinBits );
+            pWindow = VclPtr<FileControl>::Create( pParent, nWinBits );
             *ppNewComp = new VCLXFileControl;
         }
         else
@@ -93,22 +93,22 @@ SAL_DLLPUBLIC_EXPORT vcl::Window* CreateWindow( VCLXWindow** ppNewComp, const ::
     }
     else if (aServiceName.equalsIgnoreAsciiCase("FormattedField") )
     {
-        pWindow = new FormattedField( pParent, nWinBits );
+        pWindow = VclPtr<FormattedField>::Create( pParent, nWinBits );
         *ppNewComp = new SVTXFormattedField;
     }
     else if (aServiceName.equalsIgnoreAsciiCase("NumericField") )
     {
-        pWindow = new DoubleNumericField( pParent, nWinBits );
+        pWindow = VclPtr<DoubleNumericField>::Create( pParent, nWinBits );
         *ppNewComp = new SVTXNumericField;
     }
     else if (aServiceName.equalsIgnoreAsciiCase("LongCurrencyField") )
     {
-        pWindow = new DoubleCurrencyField( pParent, nWinBits );
+        pWindow = VclPtr<DoubleCurrencyField>::Create( pParent, nWinBits );
         *ppNewComp = new SVTXCurrencyField;
     }
     else if (aServiceName.equalsIgnoreAsciiCase("datefield") )
     {
-        pWindow = new CalendarField( pParent, nWinBits);
+        pWindow = VclPtr<CalendarField>::Create( pParent, nWinBits);
         static_cast<CalendarField*>(pWindow)->EnableToday();
         static_cast<CalendarField*>(pWindow)->EnableNone();
         static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( true );
@@ -125,7 +125,7 @@ SAL_DLLPUBLIC_EXPORT vcl::Window* CreateWindow( VCLXWindow** ppNewComp, const ::
     {
         if ( pParent )
         {
-            pWindow = new ProgressBar( pParent, nWinBits );
+            pWindow = VclPtr<ProgressBar>::Create( pParent, nWinBits );
             *ppNewComp = new VCLXProgressBar;
         }
         else
@@ -144,7 +144,7 @@ SAL_DLLPUBLIC_EXPORT vcl::Window* CreateWindow( VCLXWindow** ppNewComp, const ::
     {
         if ( pParent )
         {
-            pWindow = new FixedHyperlink( pParent, nWinBits );
+            pWindow = VclPtr<FixedHyperlink>::Create( pParent, nWinBits );
             *ppNewComp = new VCLXFixedHyperlink;
         }
         else
diff --git a/svtools/source/uno/wizard/wizardshell.cxx b/svtools/source/uno/wizard/wizardshell.cxx
index 2f09342..4a90e85 100644
--- a/svtools/source/uno/wizard/wizardshell.cxx
+++ b/svtools/source/uno/wizard/wizardshell.cxx
@@ -192,7 +192,7 @@ namespace svt { namespace uno
         if ( pPage == NULL )
         {
             // fallback for ill-behaved clients: empty page
-            pPage = new TabPage( this, 0 );
+            pPage = VclPtr<TabPage>::Create( this, 0 );
             pPage->SetSizePixel( LogicToPixel( Size( 280, 185 ), MAP_APPFONT ) );
         }
 


More information about the Libreoffice-commits mailing list