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

Noel Grandin noel at peralex.com
Mon Apr 20 04:47:36 PDT 2015


 sd/source/ui/animations/CustomAnimationCreateDialog.cxx |   10 ++--
 sd/source/ui/animations/CustomAnimationDialog.cxx       |   34 ++++++++--------
 sd/source/ui/animations/CustomAnimationPane.cxx         |    2 
 sd/source/ui/animations/SlideTransitionPane.cxx         |    2 
 sd/source/ui/annotations/annotationtag.cxx              |    2 
 sd/source/ui/annotations/annotationwindow.cxx           |    6 +-
 sd/source/ui/app/sdxfer.cxx                             |    2 
 sd/source/ui/controller/slidelayoutcontroller.cxx       |    4 -
 sd/source/ui/dlg/AnimationChildWindow.cxx               |    2 
 sd/source/ui/dlg/NavigatorChildWindow.cxx               |    3 -
 sd/source/ui/dlg/PaneChildWindows.cxx                   |    3 -
 sd/source/ui/dlg/RemoteDialogClientBox.cxx              |    6 +-
 sd/source/ui/dlg/animobjs.cxx                           |    2 
 sd/source/ui/dlg/headerfooterdlg.cxx                    |    4 -
 sd/source/ui/dlg/navigatr.cxx                           |    6 +-
 sd/source/ui/dlg/sddlgfact.cxx                          |   34 ++++++++--------
 sd/source/ui/docshell/docshel4.cxx                      |    4 -
 sd/source/ui/framework/factories/BasicViewFactory.cxx   |    2 
 sd/source/ui/framework/factories/FullScreenPane.cxx     |    5 +-
 sd/source/ui/inc/createtabledesignpanel.hxx             |    3 -
 sd/source/ui/presenter/PresenterHelper.cxx              |    4 -
 sd/source/ui/presenter/PresenterTextView.cxx            |    4 -
 sd/source/ui/sidebar/NavigatorWrapper.cxx               |    4 -
 sd/source/ui/slideshow/slideshow.cxx                    |    2 
 sd/source/ui/slideshow/slideshowimpl.cxx                |    4 -
 sd/source/ui/slidesorter/shell/SlideSorter.cxx          |    8 +--
 sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx      |    4 -
 sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx  |    4 -
 sd/source/ui/table/TableDesignPane.cxx                  |    4 -
 sd/source/ui/tools/PreviewRenderer.cxx                  |    2 
 sd/source/ui/unoidl/UnoDocumentSettings.cxx             |    2 
 sd/source/ui/view/ViewShellBase.cxx                     |    2 
 sd/source/ui/view/ViewTabBar.cxx                        |    2 
 sd/source/ui/view/drviews1.cxx                          |    2 
 sd/source/ui/view/drviewsa.cxx                          |    2 
 sd/source/ui/view/grviewsh.cxx                          |    2 
 sd/source/ui/view/viewshel.cxx                          |    6 +-
 37 files changed, 99 insertions(+), 95 deletions(-)

New commits:
commit 7819d49facfac7e241840ff9ea6932447e92a6f9
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Apr 20 13:44:47 2015 +0200

    sd: convert new to ::Create.
    
    Change-Id: I35c03ea4430eb5a5bd4c7cfaed74f741c09cbf18

diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
index f499b83..bcdbbd9 100644
--- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
@@ -509,15 +509,15 @@ CustomAnimationCreateDialog::CustomAnimationCreateDialog( vcl::Window* pParent,
     mnMiscId = mpTabControl->GetPageId("misc_effects");
 
     const CustomAnimationPresets& rPresets = CustomAnimationPresets::getCustomAnimationPresets();
-    mpTabPages[ENTRANCE] = new CustomAnimationCreateTabPage( mpTabControl, this, mnEntranceId, rPresets.getEntrancePresets(), bHasText );
+    mpTabPages[ENTRANCE] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnEntranceId, rPresets.getEntrancePresets(), bHasText );
     mpTabControl->SetTabPage( mnEntranceId, mpTabPages[ENTRANCE] );
-    mpTabPages[EMPHASIS] = new CustomAnimationCreateTabPage( mpTabControl, this, mnEmphasisId, rPresets.getEmphasisPresets(), bHasText );
+    mpTabPages[EMPHASIS] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnEmphasisId, rPresets.getEmphasisPresets(), bHasText );
     mpTabControl->SetTabPage( mnEmphasisId, mpTabPages[EMPHASIS] );
-    mpTabPages[EXIT] = new CustomAnimationCreateTabPage( mpTabControl, this, mnExitId, rPresets.getExitPresets(), bHasText );
+    mpTabPages[EXIT] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnExitId, rPresets.getExitPresets(), bHasText );
     mpTabControl->SetTabPage( mnExitId, mpTabPages[EXIT] );
-    mpTabPages[MOTIONPATH] = new CustomAnimationCreateTabPage( mpTabControl, this, mnMPathId, rPresets.getMotionPathsPresets(), bHasText, true );
+    mpTabPages[MOTIONPATH] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnMPathId, rPresets.getMotionPathsPresets(), bHasText, true );
     mpTabControl->SetTabPage( mnMPathId, mpTabPages[MOTIONPATH] );
-    mpTabPages[MISCEFFECTS] = new CustomAnimationCreateTabPage( mpTabControl, this, mnMiscId, rPresets.getMiscPresets(), bHasText );
+    mpTabPages[MISCEFFECTS] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnMiscId, rPresets.getMiscPresets(), bHasText );
     mpTabControl->SetTabPage( mnMiscId, mpTabPages[MISCEFFECTS] );
 
     getCurrentPage()->setDuration( mfDuration );
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 9f0bad8..b090ede 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -113,7 +113,7 @@ private:
 PresetPropertyBox::PresetPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const OUString& aPresetId, const Link& rModifyHdl )
 : PropertySubControl( nControlType )
 {
-    mpControl = new ListBox( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
+    mpControl = VclPtr<ListBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
     mpControl->SetDropDownLineCount( 10 );
     mpControl->SetSelectHdl( rModifyHdl );
     mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_PRESETPROPERTYBOX );
@@ -189,7 +189,7 @@ private:
 ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl )
 : PropertySubControl( nControlType )
 {
-    mpControl = new ColorListBox( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
+    mpControl = VclPtr<ColorListBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
     mpControl->SetDropDownLineCount( 10 );
     mpControl->SetSelectHdl( rModifyHdl );
     mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_COLORPROPERTYBOX );
@@ -262,7 +262,7 @@ private:
 FontPropertyBox::FontPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl )
 : PropertySubControl( nControlType )
 {
-    mpControl = new FontNameBox( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
+    mpControl = VclPtr<FontNameBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
     mpControl->SetDropDownLineCount( 10 );
     mpControl->SetSelectHdl( rModifyHdl );
     mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_FONTPROPERTYBOX );
@@ -339,7 +339,7 @@ DropdownMenuBox::DropdownMenuBox( vcl::Window* pParent, Edit* pSubControl, Popup
 :   Edit( pParent, WB_BORDER|WB_TABSTOP| WB_DIALOGCONTROL ),
     mpSubControl(pSubControl),mpDropdownButton(0),mpMenu(pMenu)
 {
-    mpDropdownButton = new MenuButton( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP);
+    mpDropdownButton = VclPtr<MenuButton>::Create( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP);
     mpDropdownButton->SetSymbol(SymbolType::SPIN_DOWN);
     mpDropdownButton->Show();
     mpDropdownButton->SetPopupMenu( pMenu );
@@ -420,13 +420,13 @@ private:
 CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl )
 : PropertySubControl( nControlType )
 {
-    mpMetric.set( new MetricField( pParent, WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
+    mpMetric.set( VclPtr<MetricField>::Create( pParent, WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
     mpMetric->SetUnit( FUNIT_PERCENT );
     mpMetric->SetMin( 0 );
     mpMetric->SetMax( 1000 );
 
     mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_FONTSIZE_POPUP ) );
-    mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+    mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
     mpControl->SetMenuSelectHdl( LINK( this, CharHeightPropertyBox, implMenuSelectHdl ));
     mpControl->SetModifyHdl( rModifyHdl );
     mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_CHARHEIGHTPROPERTYBOX );
@@ -502,7 +502,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::W
 : PropertySubControl( nControlType )
 , maModifyHdl( rModifyHdl )
 {
-    mpMetric.set( new MetricField( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
+    mpMetric.set( VclPtr<MetricField>::Create( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
     mpMetric->SetUnit( FUNIT_PERCENT );
     mpMetric->SetMin( 0 );
     mpMetric->SetMax( 100 );
@@ -515,7 +515,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::W
         mpMenu->InsertItem( i, aStr );
     }
 
-    mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+    mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
     mpControl->SetMenuSelectHdl( LINK( this, TransparencyPropertyBox, implMenuSelectHdl ));
     mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_TRANSPARENCYPROPERTYBOX );
 
@@ -606,14 +606,14 @@ RotationPropertyBox::RotationPropertyBox( sal_Int32 nControlType, vcl::Window* p
 : PropertySubControl( nControlType )
 , maModifyHdl( rModifyHdl )
 {
-    mpMetric.set( new MetricField( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
+    mpMetric.set( VclPtr<MetricField>::Create( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
     mpMetric->SetUnit( FUNIT_CUSTOM );
     mpMetric->SetCustomUnitText( OUString( sal_Unicode(0xb0)) ); // degree sign
     mpMetric->SetMin( -10000 );
     mpMetric->SetMax( 10000 );
 
     mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_ROTATION_POPUP ) );
-    mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+    mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
     mpControl->SetMenuSelectHdl( LINK( this, RotationPropertyBox, implMenuSelectHdl ));
     mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_ROTATIONPROPERTYBOX );
 
@@ -732,13 +732,13 @@ ScalePropertyBox::ScalePropertyBox( sal_Int32 nControlType, vcl::Window* pParent
 : PropertySubControl( nControlType )
 , maModifyHdl( rModifyHdl )
 {
-    mpMetric.set( new MetricField( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
+    mpMetric.set( VclPtr<MetricField>::Create( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
     mpMetric->SetUnit( FUNIT_PERCENT );
     mpMetric->SetMin( 0 );
     mpMetric->SetMax( 10000 );
 
     mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_SCALE_POPUP ) );
-    mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+    mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
     mpControl->SetMenuSelectHdl( LINK( this, ScalePropertyBox, implMenuSelectHdl ));
     mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_SCALEPROPERTYBOX );
 
@@ -897,11 +897,11 @@ FontStylePropertyBox::FontStylePropertyBox( sal_Int32 nControlType, vcl::Window*
 : PropertySubControl( nControlType )
 , maModifyHdl( rModifyHdl )
 {
-    mpEdit.set( new Edit( pParent, WB_TABSTOP|WB_IGNORETAB|WB_NOBORDER|WB_READONLY) );
+    mpEdit.set( VclPtr<Edit>::Create( pParent, WB_TABSTOP|WB_IGNORETAB|WB_NOBORDER|WB_READONLY) );
     mpEdit->SetText( SD_RESSTR(STR_CUSTOMANIMATION_SAMPLE) );
 
     mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_FONTSTYLE_POPUP ) );
-    mpControl = new DropdownMenuBox( pParent, mpEdit, mpMenu );
+    mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpEdit, mpMenu );
     mpControl->SetMenuSelectHdl( LINK( this, FontStylePropertyBox, implMenuSelectHdl ));
     mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_FONTSTYLEPROPERTYBOX );
 
@@ -2181,9 +2181,9 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySe
     sal_uInt16 mnTimingId = mpTabControl->GetPageId("timing");
     sal_uInt16 mnTextAnimId = mpTabControl->GetPageId("textanim");
 
-    mpEffectTabPage = new CustomAnimationEffectTabPage( mpTabControl, mpSet );
+    mpEffectTabPage = VclPtr<CustomAnimationEffectTabPage>::Create( mpTabControl, mpSet );
     mpTabControl->SetTabPage( mnEffectId, mpEffectTabPage );
-    mpDurationTabPage = new CustomAnimationDurationTabPage( mpTabControl, mpSet );
+    mpDurationTabPage = VclPtr<CustomAnimationDurationTabPage>::Create( mpTabControl, mpSet );
     mpTabControl->SetTabPage( mnTimingId, mpDurationTabPage );
 
     bool bHasText = false;
@@ -2192,7 +2192,7 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySe
 
     if( bHasText )
     {
-        mpTextAnimTabPage = new CustomAnimationTextAnimTabPage( mpTabControl, mpSet );
+        mpTextAnimTabPage = VclPtr<CustomAnimationTextAnimTabPage>::Create( mpTabControl, mpSet );
         mpTabControl->SetTabPage( mnTextAnimId, mpTextAnimTabPage );
     }
     else
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 3532be1..93b20a5 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -2286,7 +2286,7 @@ void CustomAnimationPane::updatePathFromMotionPathTag( const rtl::Reference< Mot
     if( pDocSh )
     {
         const Size aMinSize( pParent->LogicToPixel( Size( 80, 256 ), MAP_APPFONT ) );
-        pWindow = new CustomAnimationPane( pParent, rBase, rxFrame, aMinSize );
+        pWindow = VclPtr<CustomAnimationPane>::Create( pParent, rBase, rxFrame, aMinSize );
     }
 
     return pWindow;
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index 9f83e71..21d8d32 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -1101,7 +1101,7 @@ IMPL_LINK_NOARG(SlideTransitionPane, LateInitCallback)
     if( pDocSh )
     {
         Size aMinSize( pParent->LogicToPixel( Size( 72, 216 ), MAP_APPFONT ) );
-        pWindow = new SlideTransitionPane( pParent, rBase, aMinSize, pDocSh->GetDoc(), rxFrame );
+        pWindow = VclPtr<SlideTransitionPane>::Create( pParent, rBase, aMinSize, pDocSh->GetDoc(), rxFrame );
     }
 
     return pWindow;
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 5b94e7c..ae9dc83 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -577,7 +577,7 @@ void AnnotationTag::OpenPopup( bool bEdit )
 
             Rectangle aRect( aPos, maSize );
 
-            mpAnnotationWindow.reset( new AnnotationWindow( mrManager, mrView.GetDocSh(), pWindow->GetWindow(WINDOW_FRAME) ) );
+            mpAnnotationWindow.reset( VclPtr<AnnotationWindow>::Create( mrManager, mrView.GetDocSh(), pWindow->GetWindow(WINDOW_FRAME) ) );
             mpAnnotationWindow->InitControls();
             mpAnnotationWindow->setAnnotation(mxAnnotation);
 
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index 48ed13a..24495d6 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -307,11 +307,11 @@ void AnnotationWindow::dispose()
 void AnnotationWindow::InitControls()
 {
     // actual window which holds the user text
-    mpTextWindow = new AnnotationTextWindow(this, WB_NODIALOGCONTROL);
+    mpTextWindow = VclPtr<AnnotationTextWindow>::Create(this, WB_NODIALOGCONTROL);
     mpTextWindow->SetPointer(Pointer(POINTER_TEXT));
 
     // window control for author and date
-    mpMeta = new MultiLineEdit(this,0);
+    mpMeta = VclPtr<MultiLineEdit>::Create(this,0);
     mpMeta->SetReadOnly();
     mpMeta->SetRightToLeft(AllSettings::GetLayoutRTL());
     mpMeta->AlwaysDisableInput(true);
@@ -345,7 +345,7 @@ void AnnotationWindow::InitControls()
     mpOutlinerView->SetOutputArea( PixelToLogic( Rectangle(0,0,1,1) ) );
 
     //create Scrollbars
-    mpVScrollbar = new ScrollBar(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
+    mpVScrollbar = VclPtr<ScrollBar>::Create(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
     mpVScrollbar->EnableNativeWidget(false);
     mpVScrollbar->EnableRTL( false );
     mpVScrollbar->SetScrollHdl(LINK(this, AnnotationWindow, ScrollHdl));
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index 7ae66ff..4129bc3 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -262,7 +262,7 @@ void SdTransferable::CreateData()
         if( 1 == pPage->GetObjCount() )
             CreateObjectReplacement( pPage->GetObj( 0 ) );
 
-        mpVDev = new VirtualDevice( *Application::GetDefaultDevice() );
+        mpVDev = VclPtr<VirtualDevice>::Create( *Application::GetDefaultDevice() );
         mpVDev->SetMapMode( MapMode( mpSdDrawDocumentIntern->GetScaleUnit(), Point(), mpSdDrawDocumentIntern->GetScaleFraction(), mpSdDrawDocumentIntern->GetScaleFraction() ) );
         mpSdViewIntern = new ::sd::View( *mpSdDrawDocumentIntern, mpVDev );
         mpSdViewIntern->EndListening(*mpSdDrawDocumentIntern );
diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx
index 1a1fac9..4684280 100644
--- a/sd/source/ui/controller/slidelayoutcontroller.cxx
+++ b/sd/source/ui/controller/slidelayoutcontroller.cxx
@@ -211,7 +211,7 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const
 
     if( bVerticalEnabled && (eMode == DrawViewMode_DRAW) )
     {
-        mpLayoutSet2 = new ValueSet( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
+        mpLayoutSet2 = VclPtr<ValueSet>::Create( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
 
         mpLayoutSet2->SetSelectHdl( LINK( this, LayoutToolbarMenu, SelectHdl ) );
         mpLayoutSet2->SetColCount( 4 );
@@ -353,7 +353,7 @@ void SAL_CALL SlideLayoutController::initialize( const css::uno::Sequence< css::
 
 VclPtr<::vcl::Window> SlideLayoutController::createPopupWindow( ::vcl::Window* pParent )
 {
-    return new sd::LayoutToolbarMenu( *this, m_xFrame, pParent, mbInsertPage );
+    return VclPtr<sd::LayoutToolbarMenu>::Create( *this, m_xFrame, pParent, mbInsertPage );
 }
 
 // XServiceInfo
diff --git a/sd/source/ui/dlg/AnimationChildWindow.cxx b/sd/source/ui/dlg/AnimationChildWindow.cxx
index 7e7ec61..d59f0ac 100644
--- a/sd/source/ui/dlg/AnimationChildWindow.cxx
+++ b/sd/source/ui/dlg/AnimationChildWindow.cxx
@@ -39,7 +39,7 @@ AnimationChildWindow::AnimationChildWindow(
     SfxChildWinInfo* pInfo )
     : SfxChildWindow( _pParent, nId )
 {
-    AnimationWindow* pAnimWin = new AnimationWindow(pBindings, this, _pParent);
+    VclPtr<AnimationWindow> pAnimWin = VclPtr<AnimationWindow>::Create(pBindings, this, _pParent);
     pWindow = pAnimWin;
 
     eChildAlignment = SfxChildAlignment::NOALIGNMENT;
diff --git a/sd/source/ui/dlg/NavigatorChildWindow.cxx b/sd/source/ui/dlg/NavigatorChildWindow.cxx
index 480a5f7..0beb6d1 100644
--- a/sd/source/ui/dlg/NavigatorChildWindow.cxx
+++ b/sd/source/ui/dlg/NavigatorChildWindow.cxx
@@ -52,7 +52,8 @@ NavigatorChildWindow::NavigatorChildWindow (
     SfxChildWinInfo* )
     : SfxChildWindowContext( nId )
 {
-    SdNavigatorWin* pNavWin = new SdNavigatorWin(
+    VclPtr<SdNavigatorWin> pNavWin = VclPtr<SdNavigatorWin>::Create(
+
         pParent,
         this,
         SdResId( FLT_NAVIGATOR ),
diff --git a/sd/source/ui/dlg/PaneChildWindows.cxx b/sd/source/ui/dlg/PaneChildWindows.cxx
index 26606bc..7007a77 100644
--- a/sd/source/ui/dlg/PaneChildWindows.cxx
+++ b/sd/source/ui/dlg/PaneChildWindows.cxx
@@ -56,7 +56,8 @@ PaneChildWindow::PaneChildWindow (
     SfxChildAlignment eAlignment)
     : SfxChildWindow (pParentWindow, nId)
 {
-    pWindow = new PaneDockingWindow(
+    pWindow = VclPtr<PaneDockingWindow>::Create(
+
         pBindings,
         this,
         pParentWindow,
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index 842ffd1..83abb22 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -73,9 +73,9 @@ ClientBox::ClientBox( vcl::Window* pParent, WinBits nStyle ) :
     m_nTopIndex( 0 ),
     m_nActiveHeight( 0 ),
     m_nExtraHeight( 2 ),
-    m_aPinBox( new NumericBox( this, 0 ) ),
-    m_aDeauthoriseButton( new PushButton( this ) ),
-    m_aScrollBar( new ScrollBar( this, WB_VERT ) )
+    m_aPinBox( VclPtr<NumericBox>::Create( this, 0 ) ),
+    m_aDeauthoriseButton( VclPtr<PushButton>::Create( this ) ),
+    m_aScrollBar( VclPtr<ScrollBar>::Create( this, WB_VERT ) )
 {
     m_aScrollBar->SetScrollHdl( LINK( this, ClientBox, ScrollHdl ) );
     m_aScrollBar->EnableDrag();
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index 47f785e..2d13b2e 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -158,7 +158,7 @@ AnimationWindow::AnimationWindow(SfxBindings* pInBindings, SfxChildWindow *pCW,
     get(m_pLbAdjustment, "alignment");
     get(m_pBtnCreateGroup, "create");
 
-    m_pCtlDisplay = new SdDisplay(get<Window>("box"));
+    m_pCtlDisplay = VclPtr<SdDisplay>::Create(get<Window>("box"));
     m_pCtlDisplay->set_hexpand(true);
     m_pCtlDisplay->set_vexpand(true);
     m_pCtlDisplay->Show();
diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx
index 8d81eb1..84d0da1 100644
--- a/sd/source/ui/dlg/headerfooterdlg.cxx
+++ b/sd/source/ui/dlg/headerfooterdlg.cxx
@@ -199,7 +199,7 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, vcl::Window* pPar
     mpTabCtrl->Show();
 
     mnSlidesId = mpTabCtrl->GetPageId("slides");
-    mpSlideTabPage = new HeaderFooterTabPage( mpTabCtrl, pDoc, pSlide, false );
+    mpSlideTabPage = VclPtr<HeaderFooterTabPage>::Create( mpTabCtrl, pDoc, pSlide, false );
     mpTabCtrl->SetTabPage( mnSlidesId, mpSlideTabPage );
 
     Size aSiz = mpSlideTabPage->GetSizePixel();
@@ -212,7 +212,7 @@ HeaderFooterDialog::HeaderFooterDialog( ViewShell* pViewShell, vcl::Window* pPar
     }
 
     mnNotesId = mpTabCtrl->GetPageId("notes");
-    mpNotesHandoutsTabPage = new HeaderFooterTabPage( mpTabCtrl, pDoc, pNotes, true );
+    mpNotesHandoutsTabPage = VclPtr<HeaderFooterTabPage>::Create( mpTabCtrl, pDoc, pNotes, true );
     mpTabCtrl->SetTabPage( mnNotesId, mpNotesHandoutsTabPage );
 
     get(maPBApplyToAll, "apply_all" );
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 157a2f9..7960d71 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -68,9 +68,9 @@ SdNavigatorWin::SdNavigatorWin(
     SfxBindings* pInBindings,
     const UpdateRequestFunctor& rUpdateRequest)
     : vcl::Window( pParent, rSdResId )
-    , maToolbox ( new ToolBox( this, SdResId( 1 ) ) )
-    , maTlbObjects( new SdPageObjsTLB( this, SdResId( TLB_OBJECTS ) ) )
-    , maLbDocs ( new ListBox( this, SdResId( LB_DOCS ) ) )
+    , maToolbox ( VclPtr<ToolBox>::Create( this, SdResId( 1 ) ) )
+    , maTlbObjects( VclPtr<SdPageObjsTLB>::Create( this, SdResId( TLB_OBJECTS ) ) )
+    , maLbDocs ( VclPtr<ListBox>::Create( this, SdResId( LB_DOCS ) ) )
     , mpChildWinContext( pChWinCtxt )
     , mbDocImported ( false )
       // On changes of the DragType: adjust SelectionMode of TLB!
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 3e4c4a9..ad902b9 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -391,47 +391,47 @@ AbstractCopyDlg * SdAbstractDialogFactory_Impl::CreateCopyDlg(
 
 AbstractSdCustomShowDlg * SdAbstractDialogFactory_Impl::CreateSdCustomShowDlg( vcl::Window* pWindow, SdDrawDocument& rDrawDoc )
 {
-    return new AbstractSdCustomShowDlg_Impl( new SdCustomShowDlg( pWindow, rDrawDoc ) );
+    return new AbstractSdCustomShowDlg_Impl( VclPtr<SdCustomShowDlg>::Create( pWindow, rDrawDoc ) );
 }
 
 SfxAbstractTabDialog *  SdAbstractDialogFactory_Impl::CreateSdTabCharDialog( vcl::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell )
 {
-    return new SdAbstractTabDialog_Impl( new SdCharDlg( pParent, pAttr, pDocShell ) );
+    return new SdAbstractTabDialog_Impl( VclPtr<SdCharDlg>::Create( pParent, pAttr, pDocShell ) );
 }
 
 SfxAbstractTabDialog *  SdAbstractDialogFactory_Impl::CreateSdTabPageDialog( vcl::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell, bool bAreaPage )
 {
-    return new SdAbstractTabDialog_Impl( new SdPageDlg( pDocShell, pParent, pAttr, bAreaPage ) );
+    return new SdAbstractTabDialog_Impl( VclPtr<SdPageDlg>::Create( pDocShell, pParent, pAttr, bAreaPage ) );
 }
 
 AbstractAssistentDlg * SdAbstractDialogFactory_Impl::CreateAssistentDlg( vcl::Window* pParent, bool bAutoPilot)
 {
-    return new AbstractAssistentDlg_Impl( new AssistentDlg( pParent, bAutoPilot ) );
+    return new AbstractAssistentDlg_Impl( VclPtr<AssistentDlg>::Create( pParent, bAutoPilot ) );
 }
 
 AbstractSdModifyFieldDlg * SdAbstractDialogFactory_Impl::CreateSdModifyFieldDlg( vcl::Window* pWindow, const SvxFieldData* pInField, const SfxItemSet& rSet )
 {
-    return new AbstractSdModifyFieldDlg_Impl( new SdModifyFieldDlg( pWindow, pInField, rSet ) );
+    return new AbstractSdModifyFieldDlg_Impl( VclPtr<SdModifyFieldDlg>::Create( pWindow, pInField, rSet ) );
 }
 
 AbstractSdSnapLineDlg * SdAbstractDialogFactory_Impl::CreateSdSnapLineDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View* pView)
 {
-    return new AbstractSdSnapLineDlg_Impl( new SdSnapLineDlg( pWindow, rInAttrs, pView ) );
+    return new AbstractSdSnapLineDlg_Impl( VclPtr<SdSnapLineDlg>::Create( pWindow, rInAttrs, pView ) );
 }
 
 AbstractSdInsertLayerDlg * SdAbstractDialogFactory_Impl::CreateSdInsertLayerDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs, bool bDeletable, const OUString& aStr )
 {
-    return new AbstractSdInsertLayerDlg_Impl( new SdInsertLayerDlg( pWindow, rInAttrs, bDeletable, aStr ) );
+    return new AbstractSdInsertLayerDlg_Impl( VclPtr<SdInsertLayerDlg>::Create( pWindow, rInAttrs, bDeletable, aStr ) );
 }
 
 AbstractSdInsertPasteDlg * SdAbstractDialogFactory_Impl::CreateSdInsertPasteDlg( vcl::Window* pWindow )
 {
-    return new AbstractSdInsertPasteDlg_Impl( new SdInsertPasteDlg( pWindow ) );
+    return new AbstractSdInsertPasteDlg_Impl( VclPtr<SdInsertPasteDlg>::Create( pWindow ) );
 }
 
 AbstractSdInsertPagesObjsDlg * SdAbstractDialogFactory_Impl::CreateSdInsertPagesObjsDlg( vcl::Window* pParent, const SdDrawDocument* pDoc, SfxMedium* pSfxMedium, const OUString& rFileName )
 {
-    return new AbstractSdInsertPagesObjsDlg_Impl( new SdInsertPagesObjsDlg( pParent, pDoc, pSfxMedium, rFileName ) );
+    return new AbstractSdInsertPagesObjsDlg_Impl( VclPtr<SdInsertPagesObjsDlg>::Create( pParent, pDoc, pSfxMedium, rFileName ) );
 }
 
 AbstractMorphDlg * SdAbstractDialogFactory_Impl::CreateMorphDlg( vcl::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2)
@@ -446,13 +446,13 @@ SfxAbstractTabDialog *  SdAbstractDialogFactory_Impl::CreateSdOutlineBulletTabDl
 
 SfxAbstractTabDialog *  SdAbstractDialogFactory_Impl::CreateSdParagraphTabDlg( vcl::Window* pParent, const SfxItemSet* pAttr )
 {
-    return new SdAbstractTabDialog_Impl( new SdParagraphDlg( pParent, pAttr ) );
+    return new SdAbstractTabDialog_Impl( VclPtr<SdParagraphDlg>::Create( pParent, pAttr ) );
 }
 
 AbstractSdStartPresDlg *  SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg( vcl::Window* pWindow, const SfxItemSet& rInAttrs,
                                                                                      const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList )
 {
-    return new AbstractSdStartPresDlg_Impl( new SdStartPresentationDlg( pWindow, rInAttrs, rPageNames, pCSList ) );
+    return new AbstractSdStartPresDlg_Impl( VclPtr<SdStartPresentationDlg>::Create( pWindow, rInAttrs, rPageNames, pCSList ) );
 }
 
 VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Window* pWindow )
@@ -462,32 +462,32 @@ VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Windo
 
 SfxAbstractTabDialog *  SdAbstractDialogFactory_Impl::CreateSdPresLayoutTemplateDlg( SfxObjectShell* pDocSh, vcl::Window* pParent, const SdResId& DlgId, SfxStyleSheetBase& rStyleBase, PresentationObjects ePO, SfxStyleSheetBasePool* pSSPool )
 {
-    return new SdPresLayoutTemplateDlg_Impl( new SdPresLayoutTemplateDlg( pDocSh, pParent, DlgId, rStyleBase, ePO, pSSPool ) );
+    return new SdPresLayoutTemplateDlg_Impl( VclPtr<SdPresLayoutTemplateDlg>::Create( pDocSh, pParent, DlgId, rStyleBase, ePO, pSSPool ) );
 }
 
 AbstractSdPresLayoutDlg *  SdAbstractDialogFactory_Impl::CreateSdPresLayoutDlg(  ::sd::DrawDocShell* pDocShell, vcl::Window* pWindow, const SfxItemSet& rInAttrs)
 {
-    return new AbstractSdPresLayoutDlg_Impl( new SdPresLayoutDlg( pDocShell, pWindow, rInAttrs ) );
+    return new AbstractSdPresLayoutDlg_Impl( VclPtr<SdPresLayoutDlg>::Create( pDocShell, pWindow, rInAttrs ) );
 }
 
 SfxAbstractTabDialog *  SdAbstractDialogFactory_Impl::CreateSdTabTemplateDlg( vcl::Window* pParent, const SfxObjectShell* pDocShell, SfxStyleSheetBase& rStyleBase, SdrModel* pModel, SdrView* pView )
 {
-    return new SdAbstractTabDialog_Impl( new SdTabTemplateDlg( pParent, pDocShell, rStyleBase, pModel, pView ) );
+    return new SdAbstractTabDialog_Impl( VclPtr<SdTabTemplateDlg>::Create( pParent, pDocShell, rStyleBase, pModel, pView ) );
 }
 
 SfxAbstractDialog* SdAbstractDialogFactory_Impl::CreatSdActionDialog( vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView )
 {
-    return new SdAbstractSfxDialog_Impl( new SdActionDlg( pParent, pAttr, pView ) );
+    return new SdAbstractSfxDialog_Impl( VclPtr<SdActionDlg>::Create( pParent, pAttr, pView ) );
 }
 
 AbstractSdVectorizeDlg *  SdAbstractDialogFactory_Impl::CreateSdVectorizeDlg( vcl::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell )
 {
-    return new AbstractSdVectorizeDlg_Impl( new SdVectorizeDlg( pParent, rBmp, pDocShell ) );
+    return new AbstractSdVectorizeDlg_Impl( VclPtr<SdVectorizeDlg>::Create( pParent, rBmp, pDocShell ) );
 }
 
 AbstractSdPublishingDlg *  SdAbstractDialogFactory_Impl::CreateSdPublishingDlg( vcl::Window* pWindow, DocumentType eDocType)
 {
-    return new AbstractSdPublishingDlg_Impl( new SdPublishingDlg( pWindow, eDocType ) );
+    return new AbstractSdPublishingDlg_Impl( VclPtr<SdPublishingDlg>::Create( pWindow, eDocType ) );
 }
 
 // Factories for TabPages
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 1fc11db..39ec864 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -109,7 +109,7 @@ SfxPrinter* DrawDocShell::GetPrinter(bool bCreate)
         pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aPrintItem.GetOptionsPrint().IsWarningPrinter() ) );
         pSet->Put( aFlagItem );
 
-        mpPrinter = new SfxPrinter(pSet);
+        mpPrinter = VclPtr<SfxPrinter>::Create(pSet);
         mbOwnPrinter = true;
 
         // set output quality
@@ -1132,7 +1132,7 @@ void DrawDocShell::OpenBookmark( const OUString& rBookmarkURL )
 
 VclPtr<SfxDocumentInfoDialog> DrawDocShell::CreateDocumentInfoDialog( vcl::Window *pParent, const SfxItemSet &rSet )
 {
-    SfxDocumentInfoDialog* pDlg   = new SfxDocumentInfoDialog( pParent, rSet );
+    VclPtr<SfxDocumentInfoDialog> pDlg   = VclPtr<SfxDocumentInfoDialog>::Create( pParent, rSet );
     DrawDocShell*          pDocSh = PTR_CAST(DrawDocShell,SfxObjectShell::Current());
 
     if( pDocSh == this )
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 10fe98d..587770d 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -91,7 +91,7 @@ BasicViewFactory::BasicViewFactory (
       mpViewShellContainer(new ViewShellContainer()),
       mpBase(NULL),
       mpFrameView(NULL),
-      mpWindow(new WorkWindow(NULL,WB_STDWORK)),
+      mpWindow(VclPtr<WorkWindow>::Create(nullptr,WB_STDWORK)),
       mpViewCache(new ViewCache()),
       mxLocalPane(new Pane(Reference<XResourceId>(), mpWindow.get()))
 {
diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx
index 88c8320..f8428e1 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.cxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.cxx
@@ -46,7 +46,8 @@ FullScreenPane::FullScreenPane (
       mpWorkWindow(NULL)
 {
     vcl::Window* pParent = NULL;
-    mpWorkWindow.reset(new WorkWindow(
+    mpWorkWindow.reset(VclPtr<WorkWindow>::Create(
+
         pParent,
         0));  // For debugging (non-fullscreen) use WB_BORDER | WB_MOVEABLE | WB_SIZEABLE));
 
@@ -86,7 +87,7 @@ FullScreenPane::FullScreenPane (
     // For some reason the VCL canvas can not paint into a WorkWindow.
     // Therefore a child window is created that covers the WorkWindow
     // completely.
-    mpWindow = new vcl::Window(mpWorkWindow.get());
+    mpWindow = VclPtr<vcl::Window>::Create(mpWorkWindow.get());
     mpWindow->SetPosSizePixel(Point(0,0), mpWorkWindow->GetSizePixel());
     mpWindow->SetBackground(Wallpaper());
     mxWindow = VCLUnoHelper::GetInterface(mpWindow);
diff --git a/sd/source/ui/inc/createtabledesignpanel.hxx b/sd/source/ui/inc/createtabledesignpanel.hxx
index 2d8f1c3..44fc06e 100644
--- a/sd/source/ui/inc/createtabledesignpanel.hxx
+++ b/sd/source/ui/inc/createtabledesignpanel.hxx
@@ -21,10 +21,11 @@
 #define INCLUDED_SD_SOURCE_UI_INC_CREATETABLEDESIGNPANEL_HXX
 
 #include <sal/config.h>
+#include <vcl/vclptr.hxx>
 
 namespace sd {
 
-::vcl::Window * createTableDesignPanel (::vcl::Window* pParent, ViewShellBase& rBase);
+VclPtr<::vcl::Window> createTableDesignPanel (::vcl::Window* pParent, ViewShellBase& rBase);
 
 }
 
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index fa55eee..52e2797 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -79,11 +79,11 @@ Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow (
     vcl::Window* pWindow = NULL;
     if (bCreateSystemChildWindow)
     {
-        pWindow = new WorkWindow(pParentWindow, WB_SYSTEMCHILDWINDOW);
+        pWindow = VclPtr<WorkWindow>::Create(pParentWindow, WB_SYSTEMCHILDWINDOW);
     }
     else
     {
-        pWindow = new vcl::Window(pParentWindow);
+        pWindow = VclPtr<vcl::Window>::Create(pParentWindow);
     }
     Reference<awt::XWindow> xWindow (pWindow->GetComponentInterface(), UNO_QUERY);
 
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 91c1e2d..70854f5 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -242,7 +242,7 @@ PresenterTextView::Implementation::Implementation (void)
       msTotalHeightPropertyName("TotalHeight"),
       mxBitmap(),
       mpCanvas(),
-      mpOutputDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0)),
+      mpOutputDevice(VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), 0, 0)),
       mpEditEngine(NULL),
       mpEditEngineItemPool(EditEngine::CreatePool()),
       maSize(100,100),
@@ -454,7 +454,7 @@ Reference<rendering::XBitmap> PresenterTextView::Implementation::GetBitmap (void
     if ( ! mxBitmap.is())
     {
         mpOutputDevice.disposeAndClear();
-        mpOutputDevice = new VirtualDevice(*Application::GetDefaultDevice(), 0, 0);
+        mpOutputDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), 0, 0);
         mpOutputDevice->SetMapMode(MAP_PIXEL);
         mpOutputDevice->SetOutputSizePixel(maSize, true);
         mpOutputDevice->SetLineColor();
diff --git a/sd/source/ui/sidebar/NavigatorWrapper.cxx b/sd/source/ui/sidebar/NavigatorWrapper.cxx
index ff63abb..c42e47f 100644
--- a/sd/source/ui/sidebar/NavigatorWrapper.cxx
+++ b/sd/source/ui/sidebar/NavigatorWrapper.cxx
@@ -33,9 +33,9 @@ NavigatorWrapper::NavigatorWrapper (
     SfxBindings* pBindings)
     : Control(pParent, 0),
       mrViewShellBase(rViewShellBase),
-      maNavigator(new SdNavigatorWin(
+      maNavigator(VclPtr<SdNavigatorWin>::Create(
         this,
-        NULL,
+        (::sd::NavigatorChildWindow*)NULL,
         SdResId(FLT_NAVIGATOR),
         pBindings,
         ::boost::bind(&NavigatorWrapper::UpdateNavigator, this)))
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index 7e81443..481582d 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -1159,7 +1159,7 @@ void SlideShow::StartFullscreenPresentation( )
     // will be created.  This is done here explicitly so that we can make it
     // fullscreen.
     const sal_Int32 nDisplay (GetDisplay());
-    WorkWindow* pWorkWindow = new FullScreenWorkWindow(this, mpCurrentViewShellBase);
+    VclPtr<WorkWindow> pWorkWindow = VclPtr<FullScreenWorkWindow>::Create(this, mpCurrentViewShellBase);
     pWorkWindow->SetBackground(Wallpaper(COL_BLACK));
     pWorkWindow->StartPresentationMode( true, mpDoc->getPresentationSettings().mbAlwaysOnTop ? PRESENTATION_HIDEALLAPPS : 0, nDisplay);
     //    pWorkWindow->ShowFullScreenMode(sal_False, nDisplay);
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index aaf704e..8748791 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -802,7 +802,7 @@ bool SlideshowImpl::startPreview(
         mpSlideController->insertSlideNumber( nSlideNumber-1 );
         mpSlideController->setPreviewNode( xAnimationNode );
 
-        mpShowWindow = new ShowWindow( this, ((pParent == 0) && mpViewShell) ?  mpParentWindow.get() : pParent );
+        mpShowWindow = VclPtr<ShowWindow>::Create( this, ((pParent == 0) && mpViewShell) ?  mpParentWindow.get() : pParent );
         if( mpViewShell )
         {
             mpViewShell->SetActiveWindow( mpShowWindow );
@@ -967,7 +967,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings )
             // hide child windows
             hideChildWindows();
 
-            mpShowWindow = new ShowWindow( this, mpParentWindow );
+            mpShowWindow = VclPtr<ShowWindow>::Create( this, mpParentWindow );
             mpShowWindow->SetMouseAutoHide( !maPresSettings.mbMouseVisible );
             if( mpViewShell )
             {
diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
index 24090e6..e232461 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
@@ -136,11 +136,11 @@ SlideSorter::SlideSorter (
       mxControllerWeak(),
       mpViewShell(pViewShell),
       mpViewShellBase(&rBase),
-      mpContentWindow(new ContentWindow(rParentWindow,*this )),
+      mpContentWindow(VclPtr<ContentWindow>::Create(rParentWindow,*this )),
       mbOwnesContentWindow(true),
-      mpHorizontalScrollBar(new ScrollBar(&rParentWindow,WinBits(WB_HSCROLL | WB_DRAG))),
-      mpVerticalScrollBar(new ScrollBar(&rParentWindow,WinBits(WB_VSCROLL | WB_DRAG))),
-      mpScrollBarBox(new ScrollBarBox(&rParentWindow)),
+      mpHorizontalScrollBar(VclPtr<ScrollBar>::Create(&rParentWindow,WinBits(WB_HSCROLL | WB_DRAG))),
+      mpVerticalScrollBar(VclPtr<ScrollBar>::Create(&rParentWindow,WinBits(WB_VSCROLL | WB_DRAG))),
+      mpScrollBarBox(VclPtr<ScrollBarBox>::Create(&rParentWindow)),
       mbLayoutPending(true),
       mpProperties(new controller::Properties()),
       mpTheme(new view::Theme(mpProperties))
diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
index 327cadd..88369d6 100644
--- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
+++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
@@ -162,7 +162,7 @@ private:
 LayeredDevice::LayeredDevice (sd::Window* pTargetWindow)
     : mpTargetWindow(pTargetWindow),
       mpLayers(new LayerContainer()),
-      mpBackBuffer(new VirtualDevice(*mpTargetWindow)),
+      mpBackBuffer(VclPtr<VirtualDevice>::Create(*mpTargetWindow)),
       maSavedMapMode(pTargetWindow->GetMapMode())
 {
     mpBackBuffer->SetOutputSizePixel(mpTargetWindow->GetSizePixel());
@@ -386,7 +386,7 @@ void Layer::Initialize (sd::Window *pTargetWindow)
 #else
     if ( ! mpLayerDevice)
     {
-        mpLayerDevice.reset(new VirtualDevice(*pTargetWindow));
+        mpLayerDevice.reset(VclPtr<VirtualDevice>::Create(*pTargetWindow));
         mpLayerDevice->SetOutputSizePixel(pTargetWindow->GetSizePixel());
     }
 #endif
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index 1ac2ac0..55c5cd7 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -162,9 +162,9 @@ Bitmap PageObjectPainter::CreateMarkedPreview (
 {
     ScopedVclPtr<VirtualDevice> pDevice;
     if (pReferenceDevice != NULL)
-        pDevice.reset(new VirtualDevice(*pReferenceDevice));
+        pDevice.reset(VclPtr<VirtualDevice>::Create(*pReferenceDevice));
     else
-        pDevice.reset(new VirtualDevice());
+        pDevice.reset(VclPtr<VirtualDevice>::Create());
     pDevice->SetOutputSizePixel(rSize);
 
     pDevice->DrawBitmap(Point(0,0), rSize, rPreview);
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index e002c1c..7d337d1 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -806,9 +806,9 @@ short TableDesignDialog::Execute()
     return RET_CANCEL;
 }
 
-::vcl::Window * createTableDesignPanel( ::vcl::Window* pParent, ViewShellBase& rBase )
+VclPtr<::vcl::Window> createTableDesignPanel( ::vcl::Window* pParent, ViewShellBase& rBase )
 {
-    return new TableDesignPane( pParent, rBase );
+    return VclPtr<TableDesignPane>::Create( pParent, rBase );
 }
 
 void showTableDesignDialog( ::vcl::Window* pParent, ViewShellBase& rBase )
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index a43b996..66ca6e8 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -64,7 +64,7 @@ namespace {
 PreviewRenderer::PreviewRenderer (
     OutputDevice* pTemplate,
     const bool bHasFrame)
-    : mpPreviewDevice (new VirtualDevice()),
+    : mpPreviewDevice (VclPtr<VirtualDevice>::Create()),
       mpDocShellOfView(NULL),
       maFrameColor (svtools::ColorConfig().GetColorValue(svtools::DOCBOUNDARIES).nColor),
       mbHasFrame(bHasFrame)
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 2be0f09..698f89a 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -730,7 +730,7 @@ throw (UnknownPropertyException, PropertyVetoException,
                             SfxPrinter *pTempPrinter = pDocSh->GetPrinter( true );
                             if (pTempPrinter)
                             {
-                                SfxPrinter *pNewPrinter = new SfxPrinter( pTempPrinter->GetOptions().Clone(), aPrinterName );
+                                VclPtr<SfxPrinter> pNewPrinter = VclPtr<SfxPrinter>::Create( pTempPrinter->GetOptions().Clone(), aPrinterName );
                                 pDocSh->SetPrinter( pNewPrinter );
                             }
                         }
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index b6a1e34..1bb6c95 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -240,7 +240,7 @@ ViewShellBase::ViewShellBase (
       mpDocument (NULL)
 {
     mpImpl.reset(new Implementation(*this));
-    mpImpl->mpViewWindow = new FocusForwardingWindow(_pFrame->GetWindow(),*this);
+    mpImpl->mpViewWindow = VclPtr<FocusForwardingWindow>::Create(_pFrame->GetWindow(),*this);
     mpImpl->mpViewWindow->SetBackground(Wallpaper());
 
     _pFrame->GetWindow().SetBackground(Application::GetSettings().GetStyleSettings().GetLightColor());
diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx
index 05deb3e..652ffc4 100644
--- a/sd/source/ui/view/ViewTabBar.cxx
+++ b/sd/source/ui/view/ViewTabBar.cxx
@@ -82,7 +82,7 @@ ViewTabBar::ViewTabBar (
     const Reference<XResourceId>& rxViewTabBarId,
     const Reference<frame::XController>& rxController)
     : ViewTabBarInterfaceBase(maMutex),
-      mpTabControl(new TabBarControl(GetAnchorWindow(rxViewTabBarId,rxController), this)),
+      mpTabControl(VclPtr<TabBarControl>::Create(GetAnchorWindow(rxViewTabBarId,rxController), this)),
       mxController(rxController),
       maTabBarButtons(),
       mpTabPage(NULL),
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index 74c2a96..12445b0 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -526,7 +526,7 @@ SvxRuler* DrawViewShell::CreateVRuler(::sd::Window* pWin)
     WinBits  aWBits = WB_VSCROLL | WB_3DLOOK | WB_BORDER;
     sal_uInt16   nFlags = SVXRULER_SUPPORT_OBJECT;
 
-    pRuler = new Ruler(*this, GetParentWindow(), pWin, nFlags,
+    pRuler = VclPtr<Ruler>::Create(*this, GetParentWindow(), pWin, nFlags,
         GetViewFrame()->GetBindings(), aWBits);
     pRuler->SetSourceUnit(pWin->GetMapMode().GetMapUnit());
 
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index b42b71f..c8a8f4e 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -109,7 +109,7 @@ void SAL_CALL ScannerEventListener::disposing( const lang::EventObject& rEventOb
 
 DrawViewShell::DrawViewShell( SfxViewFrame* pFrame, ViewShellBase& rViewShellBase, vcl::Window* pParentWindow, PageKind ePageKind, FrameView* pFrameViewArgument )
     : ViewShell (pFrame, pParentWindow, rViewShellBase)
-    , maTabControl(new sd::TabControl(this, pParentWindow))
+    , maTabControl(VclPtr<sd::TabControl>::Create(this, pParentWindow))
     , mbIsLayerModeActive(false)
     , mbIsInSwitchPage(false)
     , mpSelectionChangeHandler(new svx::sidebar::SelectionChangeHandler(
diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx
index 1f94f01..573dad5 100644
--- a/sd/source/ui/view/grviewsh.cxx
+++ b/sd/source/ui/view/grviewsh.cxx
@@ -52,7 +52,7 @@ void GraphicViewShell::ConstructGraphicViewShell(void)
 {
     meShellType = ST_DRAW;
 
-    mpLayerTabBar.reset (new LayerTabBar(this, GetParentWindow()));
+    mpLayerTabBar.reset (VclPtr<LayerTabBar>::Create(this, GetParentWindow()));
 
     // #i67363# no layer tabbar in preview mode
     if ( !GetObjectShell()->IsPreview() )
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index c4b6f4f..8901b26 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -210,16 +210,16 @@ void ViewShell::construct(void)
     if ( ! GetDocSh()->IsPreview())
     {
         // Create scroll bars and the filler between the scroll bars.
-        mpHorizontalScrollBar.reset (new ScrollBar(GetParentWindow(), WinBits(WB_HSCROLL | WB_DRAG)));
+        mpHorizontalScrollBar.reset (VclPtr<ScrollBar>::Create(GetParentWindow(), WinBits(WB_HSCROLL | WB_DRAG)));
         mpHorizontalScrollBar->EnableRTL (false);
         mpHorizontalScrollBar->SetRange(Range(0, 32000));
         mpHorizontalScrollBar->SetScrollHdl(LINK(this, ViewShell, HScrollHdl));
 
-        mpVerticalScrollBar.reset (new ScrollBar(GetParentWindow(), WinBits(WB_VSCROLL | WB_DRAG)));
+        mpVerticalScrollBar.reset (VclPtr<ScrollBar>::Create(GetParentWindow(), WinBits(WB_VSCROLL | WB_DRAG)));
         mpVerticalScrollBar->SetRange(Range(0, 32000));
         mpVerticalScrollBar->SetScrollHdl(LINK(this, ViewShell, VScrollHdl));
 
-        mpScrollBarBox.reset(new ScrollBarBox(GetParentWindow(), WB_SIZEABLE));
+        mpScrollBarBox.reset(VclPtr<ScrollBarBox>::Create(GetParentWindow(), WB_SIZEABLE));
     }
 
     OUString aName( "ViewShell" );


More information about the Libreoffice-commits mailing list