summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-17 16:33:13 +0200
committerNoel Grandin <noel@peralex.com>2015-04-17 16:33:13 +0200
commit5df70781f3001d2f5be0343fc9daf04ab5c56719 (patch)
tree2eef02fb2ca619fce2fa0a30bf2239eba13d9329 /svx/source
parent5cf00154ca1e5013ceba59103ad706a3492ea70b (diff)
svx: convert new to ::Create.
Change-Id: I52f589dabdedb538a4a5d0eadfa42b0d10de9b80
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/customshapes/tbxcustomshapes.cxx2
-rw-r--r--svx/source/form/tbxform.cxx2
-rw-r--r--svx/source/inc/tbxform.hxx2
-rw-r--r--svx/source/mnuctrls/clipboardctl.cxx2
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx2
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx2
-rw-r--r--svx/source/svdraw/svdfmtf.cxx2
-rw-r--r--svx/source/svdraw/svdibrow.cxx4
-rw-r--r--svx/source/svdraw/svdpntv.cxx2
-rw-r--r--svx/source/tbxctrls/SvxColorChildWindow.cxx3
-rw-r--r--svx/source/tbxctrls/bulletsnumbering.cxx8
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx2
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.cxx16
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.hxx8
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx4
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx14
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx6
-rw-r--r--svx/source/tbxctrls/layctrl.cxx18
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx8
-rw-r--r--svx/source/tbxctrls/linectrl.cxx10
-rw-r--r--svx/source/tbxctrls/subtoolboxcontrol.cxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx25
-rw-r--r--svx/source/tbxctrls/tbunocontroller.cxx3
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx6
-rw-r--r--svx/source/tbxctrls/tbxalign.cxx2
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx4
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx2
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx2
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx6
29 files changed, 86 insertions, 83 deletions
diff --git a/svx/source/customshapes/tbxcustomshapes.cxx b/svx/source/customshapes/tbxcustomshapes.cxx
index b287aac60a5a..f80af1e9a548 100644
--- a/svx/source/customshapes/tbxcustomshapes.cxx
+++ b/svx/source/customshapes/tbxcustomshapes.cxx
@@ -103,7 +103,7 @@ SfxPopupWindowType SvxTbxCtlCustomShapes::GetPopupWindowType() const
// Here is the window created
// The location of the Toolbox is queried through GetToolBox()
// rItemRect are the screen coordinates
-SfxPopupWindow* SvxTbxCtlCustomShapes::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxTbxCtlCustomShapes::CreatePopupWindow()
{
createAndPositionSubToolBar( m_aSubTbxResName );
return NULL;
diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx
index 98e4ea2111d9..64baa4f85f89 100644
--- a/svx/source/form/tbxform.cxx
+++ b/svx/source/form/tbxform.cxx
@@ -197,7 +197,7 @@ SfxPopupWindowType SvxFmTbxCtlConfig::GetPopupWindowType() const
}
-SfxPopupWindow* SvxFmTbxCtlConfig::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxFmTbxCtlConfig::CreatePopupWindow()
{
if ( GetSlotId() == SID_FM_CONFIG )
{
diff --git a/svx/source/inc/tbxform.hxx b/svx/source/inc/tbxform.hxx
index a1877d87bfe6..cc2ad675712e 100644
--- a/svx/source/inc/tbxform.hxx
+++ b/svx/source/inc/tbxform.hxx
@@ -58,7 +58,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
virtual SfxPopupWindowType GetPopupWindowType() const SAL_OVERRIDE;
- virtual SfxPopupWindow* CreatePopupWindow() SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> CreatePopupWindow() SAL_OVERRIDE;
};
diff --git a/svx/source/mnuctrls/clipboardctl.cxx b/svx/source/mnuctrls/clipboardctl.cxx
index e0ec2724c305..6d183d81ded1 100644
--- a/svx/source/mnuctrls/clipboardctl.cxx
+++ b/svx/source/mnuctrls/clipboardctl.cxx
@@ -61,7 +61,7 @@ SvxClipBoardControl::~SvxClipBoardControl()
}
-SfxPopupWindow* SvxClipBoardControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxClipBoardControl::CreatePopupWindow()
{
const SvxClipboardFmtItem* pFmtItem = PTR_CAST( SvxClipboardFmtItem, pClipboardFmtItem );
if ( pFmtItem )
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
index 5b1329178b9a..ffd2639d01c8 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
@@ -42,7 +42,7 @@ SfxPopupWindowType ParaLineSpacingPopup::GetPopupWindowType() const
return SfxPopupWindowType::ONTIMEOUT;
}
-SfxPopupWindow* ParaLineSpacingPopup::CreatePopupWindow()
+VclPtr<SfxPopupWindow> ParaLineSpacingPopup::CreatePopupWindow()
{
ParaLineSpacingControl* pControl = new ParaLineSpacingControl(GetSlotId());
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index d9cfce3e0c37..0440ba195faf 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -114,7 +114,7 @@ void CandidateMgr::PaintTransparentChildren(vcl::Window & rWindow, Rectangle con
SdrPreRenderDevice::SdrPreRenderDevice(OutputDevice& rOriginal)
: mrOutputDevice(rOriginal),
- mpPreRenderDevice(new VirtualDevice())
+ mpPreRenderDevice(VclPtr<VirtualDevice>::Create())
{
}
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index f9bdc1fd6474..fb7843f9dd5d 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -78,7 +78,7 @@ ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFileImport(
SdrLayerID nLay,
const Rectangle& rRect)
: maTmpList(),
- mpVD(new VirtualDevice()),
+ mpVD(VclPtr<VirtualDevice>::Create()),
maScaleRect(rRect),
mnMapScalingOfs(0),
mpLineAttr(0),
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index 51130f01be70..261d11945818 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -495,7 +495,7 @@ bool _SdrItemBrowserControl::BegChangeEntry(sal_uIntPtr nPos)
ImpItemListRow* pEntry=ImpGetEntry(nPos);
if (pEntry!=NULL && !pEntry->bComment) {
SetMode(MYBROWSEMODE & ~BROWSER_KEEPHIGHLIGHT);
- pEditControl=new ImpItemEdit(&GetDataWindow(),this,0);
+ pEditControl=VclPtr<ImpItemEdit>::Create(&GetDataWindow(),this,0);
Rectangle aRect(GetFieldRectPixel(nPos, ITEMBROWSER_VALUECOL_ID, false));
aRect.Left()+=2; // little offset for the Edit, so it's exact to the pixel
aRect.Right()--;
@@ -1046,7 +1046,7 @@ void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItem
_SdrItemBrowserWindow::_SdrItemBrowserWindow(vcl::Window* pParent, WinBits nBits):
FloatingWindow(pParent,nBits),
- aBrowse(new _SdrItemBrowserControl(this))
+ aBrowse(VclPtr<_SdrItemBrowserControl>::Create(this))
{
SetOutputSizePixel(aBrowse->GetSizePixel());
SetText(OUString("Joe's ItemBrowser"));
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index f058b4e0c009..911527d961aa 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -1125,7 +1125,7 @@ void SdrPaintView::ShowItemBrowser(bool bShow)
{
if (bShow) {
if (pItemBrowser==nullptr) {
- pItemBrowser=new SdrItemBrowser(*static_cast<SdrView*>(this));
+ pItemBrowser=VclPtr<SdrItemBrowser>::Create(*static_cast<SdrView*>(this));
}
pItemBrowser->Show();
pItemBrowser->GrabFocus();
diff --git a/svx/source/tbxctrls/SvxColorChildWindow.cxx b/svx/source/tbxctrls/SvxColorChildWindow.cxx
index a541eb2bdf83..a4ad23f3fedc 100644
--- a/svx/source/tbxctrls/SvxColorChildWindow.cxx
+++ b/svx/source/tbxctrls/SvxColorChildWindow.cxx
@@ -33,8 +33,9 @@ SvxColorChildWindow::SvxColorChildWindow( vcl::Window* _pParent,
SfxChildWinInfo* pInfo ) :
SfxChildWindow( _pParent, nId )
{
- SvxColorDockingWindow* pWin = new SvxColorDockingWindow( pBindings, this,
+ VclPtr<SvxColorDockingWindow> pWin = VclPtr<SvxColorDockingWindow>::Create( pBindings, this,
_pParent );
+
pWindow = pWin;
eChildAlignment = SfxChildAlignment::BOTTOM;
diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx b/svx/source/tbxctrls/bulletsnumbering.cxx
index e11ed8438a6a..68ab4fe1c114 100644
--- a/svx/source/tbxctrls/bulletsnumbering.cxx
+++ b/svx/source/tbxctrls/bulletsnumbering.cxx
@@ -60,7 +60,7 @@ class NumberingToolBoxControl : public svt::PopupWindowController
public:
NumberingToolBoxControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
- virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
bool IsInImpressDraw();
// XStatusListener
@@ -89,7 +89,7 @@ NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController,
mrController( rController )
{
WinBits nBits = WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NO_DIRECTSELECT;
- mpValueSet = new SvxNumValueSet( this, nBits );
+ mpValueSet = VclPtr<SvxNumValueSet>::Create( this, nBits );
mpValueSet->init( mbBulletItem ? NUM_PAGETYPE_BULLET : NUM_PAGETYPE_SINGLENUM );
if ( !mbBulletItem )
@@ -204,9 +204,9 @@ NumberingToolBoxControl::NumberingToolBoxControl( const css::uno::Reference< css
{
}
-vcl::Window* NumberingToolBoxControl::createPopupWindow( vcl::Window* pParent )
+VclPtr<vcl::Window> NumberingToolBoxControl::createPopupWindow( vcl::Window* pParent )
{
- return new NumberingPopup( *this, m_xFrame, pParent, mbBulletItem );
+ return VclPtr<NumberingPopup>::Create( *this, m_xFrame, pParent, mbBulletItem );
}
bool NumberingToolBoxControl::IsInImpressDraw()
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx
index 103aa77a9505..c3a3402c4037 100644
--- a/svx/source/tbxctrls/colrctrl.cxx
+++ b/svx/source/tbxctrls/colrctrl.cxx
@@ -186,7 +186,7 @@ SvxColorDockingWindow::SvxColorDockingWindow
SfxDockingWindow( _pBindings, pCW, _pParent, WB_MOVEABLE|WB_CLOSEABLE|WB_SIZEABLE|WB_DOCKABLE ),
pColorList (),
- aColorSet ( new SvxColorValueSet_docking(this) ),
+ aColorSet ( VclPtr<SvxColorValueSet_docking>::Create(this) ),
nLeftSlot ( SID_ATTR_FILL_COLOR ),
nRightSlot ( SID_ATTR_LINE_COLOR ),
nCols ( 20 ),
diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx
index 141725466bdd..b9d988ae37b1 100644
--- a/svx/source/tbxctrls/extrusioncontrols.cxx
+++ b/svx/source/tbxctrls/extrusioncontrols.cxx
@@ -244,9 +244,9 @@ ExtrusionDirectionControl::ExtrusionDirectionControl(
-vcl::Window* ExtrusionDirectionControl::createPopupWindow( vcl::Window* pParent )
+VclPtr<vcl::Window> ExtrusionDirectionControl::createPopupWindow( vcl::Window* pParent )
{
- return new ExtrusionDirectionWindow( *this, m_xFrame, pParent );
+ return VclPtr<ExtrusionDirectionWindow>::Create( *this, m_xFrame, pParent );
}
// XInitialization
@@ -490,9 +490,9 @@ ExtrusionDepthController::ExtrusionDepthController(
-vcl::Window* ExtrusionDepthController::createPopupWindow( vcl::Window* pParent )
+VclPtr<vcl::Window> ExtrusionDepthController::createPopupWindow( vcl::Window* pParent )
{
- return new ExtrusionDepthWindow( *this, m_xFrame, pParent );
+ return VclPtr<ExtrusionDepthWindow>::Create( *this, m_xFrame, pParent );
}
// XInitialization
@@ -757,9 +757,9 @@ ExtrusionLightingControl::ExtrusionLightingControl(
-vcl::Window* ExtrusionLightingControl::createPopupWindow( vcl::Window* pParent )
+VclPtr<vcl::Window> ExtrusionLightingControl::createPopupWindow( vcl::Window* pParent )
{
- return new ExtrusionLightingWindow( *this, m_xFrame, pParent );
+ return VclPtr<ExtrusionLightingWindow>::Create( *this, m_xFrame, pParent );
}
// XInitialization
@@ -903,9 +903,9 @@ ExtrusionSurfaceControl::ExtrusionSurfaceControl(
-vcl::Window* ExtrusionSurfaceControl::createPopupWindow( vcl::Window* pParent )
+VclPtr<vcl::Window> ExtrusionSurfaceControl::createPopupWindow( vcl::Window* pParent )
{
- return new ExtrusionSurfaceWindow( *this, m_xFrame, pParent );
+ return VclPtr<ExtrusionSurfaceWindow>::Create( *this, m_xFrame, pParent );
}
// XInitialization
diff --git a/svx/source/tbxctrls/extrusioncontrols.hxx b/svx/source/tbxctrls/extrusioncontrols.hxx
index 210d64d63267..d94de5301b87 100644
--- a/svx/source/tbxctrls/extrusioncontrols.hxx
+++ b/svx/source/tbxctrls/extrusioncontrols.hxx
@@ -73,7 +73,7 @@ class ExtrusionDirectionControl : public svt::PopupWindowController
public:
ExtrusionDirectionControl( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
- virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
@@ -120,7 +120,7 @@ class ExtrusionDepthController : public svt::PopupWindowController
public:
ExtrusionDepthController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
- virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
@@ -177,7 +177,7 @@ class ExtrusionLightingControl : public svt::PopupWindowController
public:
ExtrusionLightingControl( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
- virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
@@ -221,7 +221,7 @@ class ExtrusionSurfaceControl : public svt::PopupWindowController
public:
ExtrusionSurfaceControl( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
- virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index 54c960442ac9..4386b780ae4e 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -535,8 +535,8 @@ VclPtr<vcl::Window> SvxFillToolBoxControl::CreateItemWindow(vcl::Window *pParent
FillControl::FillControl(vcl::Window* pParent,WinBits nStyle)
: Window(pParent,nStyle | WB_DIALOGCONTROL),
- mpLbFillType(new SvxFillTypeBox(this)),
- mpLbFillAttr(new SvxFillAttrBox(this)),
+ mpLbFillType(VclPtr<SvxFillTypeBox>::Create(this)),
+ mpLbFillAttr(VclPtr<SvxFillAttrBox>::Create(this)),
maLogicalFillSize(40,80),
maLogicalAttrSize(50,80),
mnLastFillTypeControlSelectEntryPos(mpLbFillType->GetSelectEntryPos()),
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 2dfc0ad0806e..2cd3fa3ed24e 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -283,7 +283,7 @@ SfxPopupWindowType FontWorkShapeTypeControl::GetPopupWindowType() const
-SfxPopupWindow* FontWorkShapeTypeControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> FontWorkShapeTypeControl::CreatePopupWindow()
{
OUString aSubTbxResName( "private:resource/toolbar/fontworkshapetype" );
createAndPositionSubToolBar( aSubTbxResName );
@@ -396,7 +396,7 @@ class FontworkAlignmentControl : public svt::PopupWindowController
public:
FontworkAlignmentControl( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
- virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
@@ -419,9 +419,9 @@ FontworkAlignmentControl::FontworkAlignmentControl( const Reference< XComponentC
-vcl::Window* FontworkAlignmentControl::createPopupWindow( vcl::Window* pParent )
+VclPtr<vcl::Window> FontworkAlignmentControl::createPopupWindow( vcl::Window* pParent )
{
- return new FontworkAlignmentWindow( *this, m_xFrame, pParent );
+ return VclPtr<FontworkAlignmentWindow>::Create( *this, m_xFrame, pParent );
}
// XInitialization
@@ -636,7 +636,7 @@ class FontworkCharacterSpacingControl : public svt::PopupWindowController
public:
FontworkCharacterSpacingControl( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
- virtual vcl::Window* createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
+ virtual VclPtr<vcl::Window> createPopupWindow( vcl::Window* pParent ) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
@@ -657,9 +657,9 @@ FontworkCharacterSpacingControl::FontworkCharacterSpacingControl( const Referenc
-vcl::Window* FontworkCharacterSpacingControl::createPopupWindow( vcl::Window* pParent )
+VclPtr<vcl::Window> FontworkCharacterSpacingControl::createPopupWindow( vcl::Window* pParent )
{
- return new FontworkCharacterSpacingWindow( *this, m_xFrame, pParent );
+ return VclPtr<FontworkCharacterSpacingWindow>::Create( *this, m_xFrame, pParent );
}
// XInitialization
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index c73aedd75038..26aebdeabf31 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -259,8 +259,8 @@ ImplGrafControl::ImplGrafControl(
const OUString& rCmd,
const Reference< XFrame >& rFrame
) : Control( pParent, WB_TABSTOP )
- , maImage( new FixedImage(this) )
- , maField( new ImplGrafMetricField(this, rCmd, rFrame) )
+ , maImage( VclPtr<FixedImage>::Create(this) )
+ , maField( VclPtr<ImplGrafMetricField>::Create(this, rCmd, rFrame) )
{
ResId aResId( ImplGetRID( rCmd ), DIALOG_MGR() ) ;
Image aImage( aResId );
@@ -446,7 +446,7 @@ SfxPopupWindowType SvxGrafFilterToolBoxControl::GetPopupWindowType() const
return SfxPopupWindowType::ONCLICK;
}
-SfxPopupWindow* SvxGrafFilterToolBoxControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxGrafFilterToolBoxControl::CreatePopupWindow()
{
OUString aSubTbxResName( "private:resource/toolbar/graffilterbar" );
createAndPositionSubToolBar( aSubTbxResName );
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index 7bb1cd2532cc..a5ec5ebd8159 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -110,7 +110,7 @@ IMPL_LINK_NOARG(TableWindow, SelectHdl)
TableWindow::TableWindow( sal_uInt16 nSlotId, const OUString& rCmd, const OUString& rText,
ToolBox& rParentTbx, const Reference< XFrame >& rFrame )
: SfxPopupWindow( nSlotId, rFrame, WinBits( WB_STDPOPUP ) )
- , aTableButton( new PushButton(this) )
+ , aTableButton( VclPtr<PushButton>::Create(this) )
, nCol( 0 )
, nLine( 0 )
, bInitialKeyInput(false)
@@ -168,7 +168,7 @@ void TableWindow::dispose()
VclPtr<SfxPopupWindow> TableWindow::Clone() const
{
- return new TableWindow( GetId(), maCommand, GetText(), rTbx, mxFrame );
+ return VclPtr<TableWindow>::Create( GetId(), maCommand, GetText(), rTbx, mxFrame );
}
@@ -474,7 +474,7 @@ ColumnsWindow::ColumnsWindow( sal_uInt16 nId, const OUString& rCmd, const OUStri
VclPtr<SfxPopupWindow> ColumnsWindow::Clone() const
{
- return new ColumnsWindow( GetId(), maCommand, GetText(), rTbx, mxFrame );
+ return VclPtr<ColumnsWindow>::Create( GetId(), maCommand, GetText(), rTbx, mxFrame );
}
@@ -728,12 +728,12 @@ SfxPopupWindowType SvxTableToolBoxControl::GetPopupWindowType() const
-SfxPopupWindow* SvxTableToolBoxControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxTableToolBoxControl::CreatePopupWindow()
{
if ( bEnabled )
{
ToolBox& rTbx = GetToolBox();
- TableWindow* pWin = new TableWindow( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), rTbx, m_xFrame );
+ VclPtr<TableWindow> pWin = VclPtr<TableWindow>::Create( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), rTbx, m_xFrame );
pWin->StartPopupMode( &rTbx, FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_NOKEYCLOSE );
SetPopupWindow( pWin );
return pWin;
@@ -746,7 +746,7 @@ SfxPopupWindow* SvxTableToolBoxControl::CreatePopupWindow()
SfxPopupWindow* SvxTableToolBoxControl::CreatePopupWindowCascading()
{
if ( bEnabled )
- return new TableWindow( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), GetToolBox(), m_xFrame );
+ return VclPtr<TableWindow>::Create( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), GetToolBox(), m_xFrame );
return 0;
}
@@ -793,12 +793,12 @@ SfxPopupWindowType SvxColumnsToolBoxControl::GetPopupWindowType() const
-SfxPopupWindow* SvxColumnsToolBoxControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxColumnsToolBoxControl::CreatePopupWindow()
{
ColumnsWindow* pWin = 0;
if(bEnabled)
{
- pWin = new ColumnsWindow( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), GetToolBox(), m_xFrame );
+ pWin = VclPtr<ColumnsWindow>::Create( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), GetToolBox(), m_xFrame );
pWin->StartPopupMode( &GetToolBox(),
FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_NOKEYCLOSE );
SetPopupWindow( pWin );
@@ -813,7 +813,7 @@ SfxPopupWindow* SvxColumnsToolBoxControl::CreatePopupWindowCascading()
ColumnsWindow* pWin = 0;
if(bEnabled)
{
- pWin = new ColumnsWindow( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), GetToolBox(), m_xFrame );
+ pWin = VclPtr<ColumnsWindow>::Create( GetSlotId(), m_aCommandURL, GetToolBox().GetItemText( GetId() ), GetToolBox(), m_xFrame );
}
return pWin;
}
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index 1269b46bb2b8..a517946bff0e 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -111,7 +111,7 @@ void SvxPopupWindowListBox::dispose()
VclPtr<SfxPopupWindow> SvxPopupWindowListBox::Clone() const
{
- return new SvxPopupWindowListBox( GetId(), maCommandURL, nTbxId, rToolBox );
+ return VclPtr<SvxPopupWindowListBox>::Create( GetId(), maCommandURL, nTbxId, rToolBox );
}
void SvxPopupWindowListBox::PopupModeEnd()
@@ -155,7 +155,7 @@ SvxListBoxControl::SvxListBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBo
SvxListBoxControl::~SvxListBoxControl()
{}
-SfxPopupWindow* SvxListBoxControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxListBoxControl::CreatePopupWindow()
{
OSL_FAIL( "not implemented" );
return 0;
@@ -281,7 +281,7 @@ void SvxUndoRedoControl::StateChanged(
}
}
-SfxPopupWindow* SvxUndoRedoControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxUndoRedoControl::CreatePopupWindow()
{
DBG_ASSERT(( SID_UNDO == GetSlotId() || SID_REDO == GetSlotId() ), "mismatching ids" );
@@ -292,7 +292,7 @@ SfxPopupWindow* SvxUndoRedoControl::CreatePopupWindow()
ToolBox& rBox = GetToolBox();
- pPopupWin = new SvxPopupWindowListBox( GetSlotId(), m_aCommandURL, GetId(), rBox );
+ pPopupWin = VclPtr<SvxPopupWindowListBox>::Create( GetSlotId(), m_aCommandURL, GetId(), rBox );
pPopupWin->SetPopupModeEndHdl( LINK( this, SvxUndoRedoControl,
PopupModeEndHdl ) );
ListBox &rListBox = pPopupWin->GetListBox();
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index c7e4e1760bd4..82be0ad0e714 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -256,7 +256,7 @@ SvxLineEndWindow::SvxLineEndWindow(
SfxPopupWindow( nSlotId,
rFrame,
WinBits( WB_STDPOPUP | WB_OWNERDRAWDECORATION ) ),
- aLineEndSet ( new ValueSet(this, WinBits( WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT )) ),
+ aLineEndSet ( VclPtr<ValueSet>::Create(this, WinBits( WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT )) ),
nCols ( 2 ),
nLines ( 12 ),
nLineEndWidth ( 400 ),
@@ -277,7 +277,7 @@ SvxLineEndWindow::SvxLineEndWindow(
rFrame,
pParentWindow,
WinBits( WB_STDPOPUP | WB_OWNERDRAWDECORATION ) ),
- aLineEndSet ( new ValueSet(this, WinBits( WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT ) )),
+ aLineEndSet ( VclPtr<ValueSet>::Create(this, WinBits( WB_ITEMBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT ) )),
nCols ( 2 ),
nLines ( 12 ),
nLineEndWidth ( 400 ),
@@ -322,7 +322,7 @@ void SvxLineEndWindow::implInit()
VclPtr<SfxPopupWindow> SvxLineEndWindow::Clone() const
{
- return new SvxLineEndWindow( GetId(), mxFrame, GetText() );
+ return VclPtr<SvxLineEndWindow>::Create( GetId(), mxFrame, GetText() );
}
@@ -629,10 +629,10 @@ SfxPopupWindowType SvxLineEndToolBoxControl::GetPopupWindowType() const
-SfxPopupWindow* SvxLineEndToolBoxControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxLineEndToolBoxControl::CreatePopupWindow()
{
SvxLineEndWindow* pLineEndWin =
- new SvxLineEndWindow( GetId(), m_xFrame, &GetToolBox(), SVX_RESSTR( RID_SVXSTR_LINEEND ) );
+ VclPtr<SvxLineEndWindow>::Create( GetId(), m_xFrame, &GetToolBox(), SVX_RESSTR( RID_SVXSTR_LINEEND ) );
pLineEndWin->StartPopupMode( &GetToolBox(),
FLOATWIN_POPUPMODE_GRABFOCUS |
FLOATWIN_POPUPMODE_ALLOWTEAROFF |
diff --git a/svx/source/tbxctrls/subtoolboxcontrol.cxx b/svx/source/tbxctrls/subtoolboxcontrol.cxx
index c04c79b0de14..606debaaa292 100644
--- a/svx/source/tbxctrls/subtoolboxcontrol.cxx
+++ b/svx/source/tbxctrls/subtoolboxcontrol.cxx
@@ -37,7 +37,7 @@ SvxSubToolBoxControl::~SvxSubToolBoxControl()
{
}
-SfxPopupWindow* SvxSubToolBoxControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxSubToolBoxControl::CreatePopupWindow()
{
const sal_Char* pResource = 0;
switch( GetSlotId() )
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 770eaefc9f31..0e94807a483e 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -721,7 +721,7 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt )
{
if(m_pButtons[nId] == nullptr)
{
- m_pButtons[nId] = new MenuButton(static_cast<vcl::Window*>(pDevice), WB_FLATBUTTON | WB_NOPOINTERFOCUS);
+ m_pButtons[nId] = VclPtr<MenuButton>::Create(static_cast<vcl::Window*>(pDevice), WB_FLATBUTTON | WB_NOPOINTERFOCUS);
m_pButtons[nId]->SetSizePixel(Size(20, aRect.GetSize().Height()));
m_pButtons[nId]->SetPopupMenu(&m_aMenu);
}
@@ -1264,7 +1264,7 @@ void SvxColorWindow_Impl::KeyInput( const KeyEvent& rKEvt )
VclPtr<SfxPopupWindow> SvxColorWindow_Impl::Clone() const
{
- return new SvxColorWindow_Impl( maCommand, mrPaletteManager, mrBorderColorStatus, theSlotId, GetFrame(), GetText(), GetParent() );
+ return VclPtr<SvxColorWindow_Impl>::Create( maCommand, mrPaletteManager, mrBorderColorStatus, theSlotId, GetFrame(), GetText(), GetParent() );
}
IMPL_LINK(SvxColorWindow_Impl, SelectHdl, SvxColorValueSet*, pColorSet)
@@ -1474,7 +1474,7 @@ Color BorderColorStatus::GetColor()
SvxFrameWindow_Impl::SvxFrameWindow_Impl( sal_uInt16 nId, const Reference< XFrame >& rFrame, vcl::Window* pParentWindow ) :
SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_STDPOPUP | WB_OWNERDRAWDECORATION ) ),
- aFrameSet ( new SvxFrmValueSet_Impl(this, WinBits( WB_ITEMBORDER | WB_DOUBLEBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT )) ),
+ aFrameSet ( VclPtr<SvxFrmValueSet_Impl>::Create(this, WinBits( WB_ITEMBORDER | WB_DOUBLEBORDER | WB_3DLOOK | WB_NO_DIRECTSELECT )) ),
bParagraphMode(false)
{
BindListener();
@@ -1537,7 +1537,7 @@ void SvxFrameWindow_Impl::dispose()
VclPtr<SfxPopupWindow> SvxFrameWindow_Impl::Clone() const
{
//! HACK: How do I get the Paragraph mode?
- return new SvxFrameWindow_Impl( GetId(), GetFrame(), GetParent() );
+ return VclPtr<SvxFrameWindow_Impl>::Create( GetId(), GetFrame(), GetParent() );
}
vcl::Window* SvxFrameWindow_Impl::GetPreferredKeyInputWindow()
@@ -1752,7 +1752,7 @@ static Color lcl_mediumColor( Color aMain, Color /*aDefault*/ )
SvxLineWindow_Impl::SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame >& rFrame, vcl::Window* pParentWindow ) :
SfxPopupWindow( nId, rFrame, pParentWindow, WinBits( WB_STDPOPUP | WB_OWNERDRAWDECORATION | WB_AUTOSIZE ) ),
- m_aLineStyleLb( new LineListBox(this) )
+ m_aLineStyleLb( VclPtr<LineListBox>::Create(this) )
{
try
{
@@ -1807,7 +1807,7 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame
VclPtr<SfxPopupWindow> SvxLineWindow_Impl::Clone() const
{
- return new SvxLineWindow_Impl( GetId(), GetFrame(), GetParent() );
+ return VclPtr<SvxLineWindow_Impl>::Create( GetId(), GetFrame(), GetParent() );
}
IMPL_LINK_NOARG(SvxLineWindow_Impl, SelectHdl)
@@ -2528,10 +2528,11 @@ SfxPopupWindowType SvxColorToolBoxControl::GetPopupWindowType() const
return SfxPopupWindowType::ONTIMEOUT;
}
-SfxPopupWindow* SvxColorToolBoxControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxColorToolBoxControl::CreatePopupWindow()
{
SvxColorWindow_Impl* pColorWin =
- new SvxColorWindow_Impl(
+ VclPtr<SvxColorWindow_Impl>::Create(
+
m_aCommandURL,
mPaletteManager,
maBorderColorStatus,
@@ -2706,9 +2707,9 @@ SfxPopupWindowType SvxFrameToolBoxControl::GetPopupWindowType() const
return SfxPopupWindowType::ONCLICK;
}
-SfxPopupWindow* SvxFrameToolBoxControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxFrameToolBoxControl::CreatePopupWindow()
{
- SvxFrameWindow_Impl* pFrameWin = new SvxFrameWindow_Impl(
+ VclPtr<SvxFrameWindow_Impl> pFrameWin = VclPtr<SvxFrameWindow_Impl>::Create(
GetSlotId(), m_xFrame, &GetToolBox() );
pFrameWin->StartPopupMode( &GetToolBox(),
@@ -2748,9 +2749,9 @@ SfxPopupWindowType SvxFrameLineStyleToolBoxControl::GetPopupWindowType() const
return SfxPopupWindowType::ONCLICK;
}
-SfxPopupWindow* SvxFrameLineStyleToolBoxControl::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxFrameLineStyleToolBoxControl::CreatePopupWindow()
{
- SvxLineWindow_Impl* pLineWin = new SvxLineWindow_Impl( GetSlotId(), m_xFrame, &GetToolBox() );
+ VclPtr<SvxLineWindow_Impl> pLineWin = VclPtr<SvxLineWindow_Impl>::Create( GetSlotId(), m_xFrame, &GetToolBox() );
pLineWin->StartPopupMode( &GetToolBox(),
FLOATWIN_POPUPMODE_GRABFOCUS |
FLOATWIN_POPUPMODE_ALLOWTEAROFF |
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index 27611b06831f..21b2e98fc30e 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -409,7 +409,8 @@ uno::Reference< awt::XWindow > SAL_CALL FontHeightToolBoxControl::createItemWind
if ( pParent )
{
SolarMutexGuard aSolarMutexGuard;
- m_pBox = new SvxFontSizeBox_Impl(
+ m_pBox = VclPtr<SvxFontSizeBox_Impl>::Create(
+
pParent,
uno::Reference< frame::XDispatchProvider >( m_xFrame, uno::UNO_QUERY ),
m_xFrame,
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index d10d5b53326f..a5f8b17e8352 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -457,7 +457,7 @@ css::uno::Reference< css::awt::XWindow > SAL_CALL FindTextToolbarController::cre
if ( pParent )
{
ToolBox* pToolbar = static_cast<ToolBox*>(pParent);
- m_pFindTextFieldControl = new FindTextFieldControl( pToolbar, WinBits( WB_DROPDOWN | WB_VSCROLL), m_xFrame, m_xContext );
+ m_pFindTextFieldControl = VclPtr<FindTextFieldControl>::Create( pToolbar, WinBits( WB_DROPDOWN | WB_VSCROLL), m_xFrame, m_xContext );
Size aSize(250, m_pFindTextFieldControl->GetTextHeight() + 200);
m_pFindTextFieldControl->SetSizePixel( aSize );
@@ -680,7 +680,7 @@ css::uno::Reference< css::awt::XWindow > SAL_CALL MatchCaseToolboxController::cr
if ( pParent )
{
ToolBox* pToolbar = static_cast<ToolBox*>(pParent);
- m_pMatchCaseControl = new CheckBox( pToolbar, 0 );
+ m_pMatchCaseControl = VclPtr<CheckBox>::Create( pToolbar, 0 );
m_pMatchCaseControl->SetText( SVX_RESSTR( RID_SVXSTR_FINDBAR_MATCHCASE ) );
Size aSize( m_pMatchCaseControl->GetOptimalSize() );
m_pMatchCaseControl->SetSizePixel( aSize );
@@ -948,7 +948,7 @@ void SAL_CALL SearchLabelToolboxController::statusChanged( const css::frame::Fea
css::uno::Reference< css::awt::XWindow > SAL_CALL SearchLabelToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException, std::exception )
{
- vcl::Window *pSL= new FixedText(VCLUnoHelper::GetWindow( Parent ));
+ VclPtr<vcl::Window> pSL = VclPtr<FixedText>::Create(VCLUnoHelper::GetWindow( Parent ));
pSL->SetSizePixel(Size(250, 25));
return VCLUnoHelper::GetInterface(pSL);
}
diff --git a/svx/source/tbxctrls/tbxalign.cxx b/svx/source/tbxctrls/tbxalign.cxx
index 41571ee9699a..a4fdb266a15f 100644
--- a/svx/source/tbxctrls/tbxalign.cxx
+++ b/svx/source/tbxctrls/tbxalign.cxx
@@ -61,7 +61,7 @@ SfxPopupWindowType SvxTbxCtlAlign::GetPopupWindowType() const
* rItemRect sind die Screen-Koordinaten
*/
-SfxPopupWindow* SvxTbxCtlAlign::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxTbxCtlAlign::CreatePopupWindow()
{
SolarMutexGuard aGuard;
if ( GetSlotId() == SID_OBJECT_ALIGN )
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 0d0fe95c16a5..dbe36200fd5e 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -462,10 +462,10 @@ ChineseDictionaryDialog::ChineseDictionaryDialog( vcl::Window* pParent )
get(mpToSimplifiedContainer, "tradtosimpleview");
mpToSimplifiedContainer->set_height_request(mpToSimplifiedContainer->GetTextHeight() * 8);
- m_pCT_DictionaryToSimplified = new DictionaryList(*mpToSimplifiedContainer, 0);
+ m_pCT_DictionaryToSimplified = VclPtr<DictionaryList>::Create(*mpToSimplifiedContainer, 0);
get(mpToTraditionalContainer, "simpletotradview");
mpToTraditionalContainer->set_height_request(mpToTraditionalContainer->GetTextHeight() * 8);
- m_pCT_DictionaryToTraditional = new DictionaryList(*mpToTraditionalContainer, 0);
+ m_pCT_DictionaryToTraditional = VclPtr<DictionaryList>::Create(*mpToTraditionalContainer, 0);
SvtLinguConfig aLngCfg;
bool bValue;
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
index 5a2f76e5013b..58f8a1faddad 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
@@ -136,7 +136,7 @@ sal_Int16 SAL_CALL ChineseTranslation_UnoDialog::execute() throw(uno::RuntimeExc
pParent = pImplementation->GetWindow();
}
uno::Reference< XComponent > xComp( this );
- m_pDialog = new ChineseTranslationDialog( pParent );
+ m_pDialog = VclPtr<ChineseTranslationDialog>::Create( pParent );
}
if( !m_pDialog )
return nRet;
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
index 1c301c58943c..faa63755f7b2 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
@@ -107,7 +107,7 @@ IMPL_LINK_NOARG(ChineseTranslationDialog, DictionaryHdl)
{
if( !m_pDictionaryDialog )
{
- m_pDictionaryDialog = new ChineseDictionaryDialog(this);
+ m_pDictionaryDialog = VclPtr<ChineseDictionaryDialog>::Create(this);
}
if( m_pDictionaryDialog )
{
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index b61c625b4cc2..afe0c725d8c5 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -160,7 +160,7 @@ namespace {
virtual sal_Bool SAL_CALL supportsMimeType( const OUString& MimeTypeName ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
virtual Sequence< OUString > SAL_CALL getSupportedMimeTypeNames( ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
- VirtualDevice* CreatePageVDev( SdrPage* pPage, sal_uIntPtr nWidthPixel, sal_uIntPtr nHeightPixel ) const;
+ VclPtr<VirtualDevice> CreatePageVDev( SdrPage* pPage, sal_uIntPtr nWidthPixel, sal_uIntPtr nHeightPixel ) const;
DECL_LINK( CalcFieldValueHdl, EditFieldInfo* );
@@ -395,9 +395,9 @@ IMPL_LINK(GraphicExporter, CalcFieldValueHdl, EditFieldInfo*, pInfo)
@return the returned VirtualDevice is owned by the caller
*/
-VirtualDevice* GraphicExporter::CreatePageVDev( SdrPage* pPage, sal_uIntPtr nWidthPixel, sal_uIntPtr nHeightPixel ) const
+VclPtr<VirtualDevice> GraphicExporter::CreatePageVDev( SdrPage* pPage, sal_uIntPtr nWidthPixel, sal_uIntPtr nHeightPixel ) const
{
- VirtualDevice* pVDev = new VirtualDevice();
+ VclPtr<VirtualDevice> pVDev = VclPtr<VirtualDevice>::Create();
MapMode aMM( MAP_100TH_MM );
Point aPoint( 0, 0 );