summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-17 15:11:54 +0200
committerNoel Grandin <noel@peralex.com>2015-04-17 15:11:54 +0200
commit0269ef901119635fa809245698c985b30e648ef4 (patch)
treebeb46403f2675dc15bfd02c1c5bc727ba892c1c6
parent5459c4a7312ce7bc0326978f4164441e76e5d5a4 (diff)
sw: convert new to ::Create.
Change-Id: Iab0fc73540b3c7a60c64296dce86b70c1e02cf09
-rw-r--r--extensions/source/propctrlr/browserline.cxx2
-rw-r--r--include/sfx2/tbxctrl.hxx2
-rw-r--r--include/svx/linectrl.hxx2
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx2
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx2
-rw-r--r--svx/source/tbxctrls/colorwindow.hxx2
-rw-r--r--svx/source/tbxctrls/layctrl.cxx8
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx4
-rw-r--r--svx/source/tbxctrls/linectrl.cxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx10
-rw-r--r--sw/source/uibase/app/docsh2.cxx6
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx4
-rw-r--r--sw/source/uibase/dbui/dbtree.cxx2
-rw-r--r--sw/source/uibase/dbui/mailmergechildwindow.cxx2
-rw-r--r--sw/source/uibase/dbui/mailmergehelper.cxx4
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx2
-rw-r--r--sw/source/uibase/docvw/PageBreakWin.cxx2
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx8
-rw-r--r--sw/source/uibase/docvw/srcedtw.cxx6
-rw-r--r--sw/source/uibase/envelp/syncbtn.cxx2
-rw-r--r--sw/source/uibase/inc/workctrl.hxx2
-rw-r--r--sw/source/uibase/misc/glshell.cxx2
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx2
-rw-r--r--sw/source/uibase/misc/swruler.cxx2
-rw-r--r--sw/source/uibase/ribbar/inputwin.cxx6
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx6
26 files changed, 47 insertions, 47 deletions
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index 9a8490511569..c32207506997 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -141,7 +141,7 @@ namespace pcr
{
m_aFtTitle->SetZOrder(pRefWindow,nFlags);
if ( m_pControlWindow )
- m_pControlWindow->SetZOrder( (vcl::Window*)&m_aFtTitle, WINDOW_ZORDER_BEHIND );
+ m_pControlWindow->SetZOrder( m_aFtTitle.get(), WINDOW_ZORDER_BEHIND );
if ( m_pBrowseButton && m_pControlWindow )
m_pBrowseButton->SetZOrder( m_pControlWindow, WINDOW_ZORDER_BEHIND );
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index 5284bcc3c1e4..c7dab434da50 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -153,7 +153,7 @@ public:
virtual ~SfxPopupWindow();
virtual void dispose() SAL_OVERRIDE;
- virtual SfxPopupWindow* Clone() const;
+ virtual VclPtr<SfxPopupWindow> Clone() const;
virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE;
void StartCascading();
diff --git a/include/svx/linectrl.hxx b/include/svx/linectrl.hxx
index 4b5ccec56f71..b9daf626280f 100644
--- a/include/svx/linectrl.hxx
+++ b/include/svx/linectrl.hxx
@@ -124,7 +124,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
};
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index f229d8d6a5ab..4fc75e1a2945 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -1335,7 +1335,7 @@ void SfxPopupWindow::StartCascading()
-SfxPopupWindow* SfxPopupWindow::Clone() const
+VclPtr<SfxPopupWindow> SfxPopupWindow::Clone() const
/* [Description]
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 1ad7f6e13f6b..d40f8a41763a 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -1038,7 +1038,7 @@ namespace sdr { namespace contact {
if ( m_aControl.is() )
{
- if ( m_pOutputDeviceForWindow.get() == const_cast<OutputDevice *>( &_rDevice ) )
+ if ( m_pOutputDeviceForWindow.get() == &_rDevice )
return true;
// Somebody requested a control for a new device, which means either of
diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx
index eae25a8d9467..5cdf8b7a10fe 100644
--- a/svx/source/tbxctrls/colorwindow.hxx
+++ b/svx/source/tbxctrls/colorwindow.hxx
@@ -74,7 +74,7 @@ public:
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
void SetSelectedHdl( const Link& rLink ) { maSelectedLink = rLink; }
};
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index bd82e70658b7..7bb1cd2532cc 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -86,7 +86,7 @@ public:
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Paint( const Rectangle& ) SAL_OVERRIDE;
virtual void PopupModeEnd() SAL_OVERRIDE;
- virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
private:
void Update( long nNewCol, long nNewLine );
@@ -166,7 +166,7 @@ void TableWindow::dispose()
SfxPopupWindow::dispose();
}
-SfxPopupWindow* TableWindow::Clone() const
+VclPtr<SfxPopupWindow> TableWindow::Clone() const
{
return new TableWindow( GetId(), maCommand, GetText(), rTbx, mxFrame );
}
@@ -430,7 +430,7 @@ public:
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Paint( const Rectangle& ) SAL_OVERRIDE;
virtual void PopupModeEnd() SAL_OVERRIDE;
- virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
};
@@ -472,7 +472,7 @@ ColumnsWindow::ColumnsWindow( sal_uInt16 nId, const OUString& rCmd, const OUStri
-SfxPopupWindow* ColumnsWindow::Clone() const
+VclPtr<SfxPopupWindow> ColumnsWindow::Clone() const
{
return new ColumnsWindow( GetId(), maCommand, GetText(), rTbx, mxFrame );
}
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index 99ca4bce73b5..1269b46bb2b8 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -66,7 +66,7 @@ public:
virtual void dispose() SAL_OVERRIDE;
// SfxPopupWindow
- virtual SfxPopupWindow * Clone() const SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
virtual void PopupModeEnd() SAL_OVERRIDE;
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
@@ -109,7 +109,7 @@ void SvxPopupWindowListBox::dispose()
SfxPopupWindow::dispose();
}
-SfxPopupWindow* SvxPopupWindowListBox::Clone() const
+VclPtr<SfxPopupWindow> SvxPopupWindowListBox::Clone() const
{
return new SvxPopupWindowListBox( GetId(), maCommandURL, nTbxId, rToolBox );
}
diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx
index 8a360f5178ad..c7e4e1760bd4 100644
--- a/svx/source/tbxctrls/linectrl.cxx
+++ b/svx/source/tbxctrls/linectrl.cxx
@@ -320,7 +320,7 @@ void SvxLineEndWindow::implInit()
aLineEndSet->Show();
}
-SfxPopupWindow* SvxLineEndWindow::Clone() const
+VclPtr<SfxPopupWindow> SvxLineEndWindow::Clone() const
{
return new SvxLineEndWindow( GetId(), mxFrame, GetText() );
}
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index f9d8ce8f5262..770eaefc9f31 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -258,7 +258,7 @@ public:
virtual void StateChanged( sal_uInt16 nSID, SfxItemState eState,
const SfxPoolItem* pState ) SAL_OVERRIDE;
- virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
};
@@ -280,7 +280,7 @@ public:
SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame >& rFrame, vcl::Window* pParentWindow );
virtual ~SvxLineWindow_Impl() { disposeOnce(); }
virtual void dispose() SAL_OVERRIDE { m_aLineStyleLb.disposeAndClear(); SfxPopupWindow::dispose(); }
- virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
};
class SvxStyleToolBoxControl;
@@ -1262,7 +1262,7 @@ void SvxColorWindow_Impl::KeyInput( const KeyEvent& rKEvt )
mpColorSet->KeyInput(rKEvt);
}
-SfxPopupWindow* SvxColorWindow_Impl::Clone() const
+VclPtr<SfxPopupWindow> SvxColorWindow_Impl::Clone() const
{
return new SvxColorWindow_Impl( maCommand, mrPaletteManager, mrBorderColorStatus, theSlotId, GetFrame(), GetText(), GetParent() );
}
@@ -1534,7 +1534,7 @@ void SvxFrameWindow_Impl::dispose()
SfxPopupWindow::dispose();
}
-SfxPopupWindow* SvxFrameWindow_Impl::Clone() const
+VclPtr<SfxPopupWindow> SvxFrameWindow_Impl::Clone() const
{
//! HACK: How do I get the Paragraph mode?
return new SvxFrameWindow_Impl( GetId(), GetFrame(), GetParent() );
@@ -1805,7 +1805,7 @@ SvxLineWindow_Impl::SvxLineWindow_Impl( sal_uInt16 nId, const Reference< XFrame
m_aLineStyleLb->Show();
}
-SfxPopupWindow* SvxLineWindow_Impl::Clone() const
+VclPtr<SfxPopupWindow> SvxLineWindow_Impl::Clone() const
{
return new SvxLineWindow_Impl( GetId(), GetFrame(), GetParent() );
}
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 3a0f64b00ed8..b9397f4f31e4 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -136,7 +136,7 @@ using namespace ::sfx2;
SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog(
vcl::Window *pParent, const SfxItemSet &rSet)
{
- SfxDocumentInfoDialog* pDlg = new SfxDocumentInfoDialog(pParent, rSet);
+ VclPtr<SfxDocumentInfoDialog> pDlg = VclPtr<SfxDocumentInfoDialog>::Create(pParent, rSet);
//only with statistics, when this document is being shown, not
//from within the Doc-Manager
SwDocShell* pDocSh = static_cast<SwDocShell*>( SfxObjectShell::Current());
@@ -501,7 +501,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
SvtPathOptions aPathOpt;
ScopedVclPtr<SfxNewFileDialog> pNewFileDlg(
- new SfxNewFileDialog(&GetView()->GetViewFrame()->GetWindow(), SFXWB_LOAD_TEMPLATE));
+ VclPtr<SfxNewFileDialog>::Create(&GetView()->GetViewFrame()->GetWindow(), SFXWB_LOAD_TEMPLATE));
pNewFileDlg->SetTemplateFlags(nFlags);
nRet = pNewFileDlg->Execute();
@@ -648,7 +648,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
SfxPrinter* pTemp = GetDoc()->getIDocumentDeviceAccess().getPrinter( false );
if(pTemp)
- pSavePrinter = new SfxPrinter(*pTemp);
+ pSavePrinter = VclPtr<SfxPrinter>::Create(*pTemp);
bSetModified = IsModified() || pSrcView->IsModified();
if(pSrcView->IsModified()||pSrcView->HasSourceSaved())
{
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index f5fd204f8bd7..8ca4f6520138 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -950,9 +950,9 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
if( ! pParent )
pParent = pSourceWindow;
if( bMergeShell )
- pProgressDlg = new CreateMonitor( pParent, pParent != pSourceWindow );
+ pProgressDlg = VclPtr<CreateMonitor>::Create( pParent, pParent != pSourceWindow );
else {
- pProgressDlg = new PrintMonitor( pParent, pParent != pSourceWindow, PrintMonitor::MONITOR_TYPE_PRINT );
+ pProgressDlg = VclPtr<PrintMonitor>::Create( pParent, pParent != pSourceWindow, PrintMonitor::MONITOR_TYPE_PRINT );
static_cast<PrintMonitor*>( pProgressDlg.get() )->SetText(pSourceShell->GetView().GetDocShell()->GetTitle(22));
}
pProgressDlg->SetCancelHdl( LINK(this, SwDBManager, PrtCancelHdl) );
diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index 70ef937b778a..6e511f0976e6 100644
--- a/sw/source/uibase/dbui/dbtree.cxx
+++ b/sw/source/uibase/dbui/dbtree.cxx
@@ -186,7 +186,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSwDBTreeList(vcl::Wind
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nStyle |= WB_BORDER;
- return new SwDBTreeList(pParent, nStyle);
+ return VclPtr<SwDBTreeList>::Create(pParent, nStyle);
}
Size SwDBTreeList::GetOptimalSize() const
diff --git a/sw/source/uibase/dbui/mailmergechildwindow.cxx b/sw/source/uibase/dbui/mailmergechildwindow.cxx
index f3feeaa4e4a8..ad16a82acf59 100644
--- a/sw/source/uibase/dbui/mailmergechildwindow.cxx
+++ b/sw/source/uibase/dbui/mailmergechildwindow.cxx
@@ -43,7 +43,7 @@ SwMailMergeChildWindow::SwMailMergeChildWindow( vcl::Window* _pParent,
SfxChildWinInfo* pInfo ) :
SfxChildWindow( _pParent, nId )
{
- pWindow = new SwMailMergeChildWin( pBindings, this, _pParent);
+ pWindow = VclPtr<SwMailMergeChildWin>::Create( pBindings, this, _pParent);
if (!pInfo->aSize.Width() || !pInfo->aSize.Height())
{
diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx
index fb26720b99b6..ce7d53e20d3c 100644
--- a/sw/source/uibase/dbui/mailmergehelper.cxx
+++ b/sw/source/uibase/dbui/mailmergehelper.cxx
@@ -187,7 +187,7 @@ struct SwAddressPreview_Impl
SwAddressPreview::SwAddressPreview(vcl::Window* pParent, WinBits nStyle)
: Window( pParent, nStyle )
- , aVScrollBar(new ScrollBar(this, WB_VSCROLL))
+ , aVScrollBar(VclPtr<ScrollBar>::Create(this, WB_VSCROLL))
, pImpl(new SwAddressPreview_Impl())
{
aVScrollBar->SetScrollHdl(LINK(this, SwAddressPreview, ScrollHdl));
@@ -621,7 +621,7 @@ OUString SwAuthenticator::getPassword( ) throw (RuntimeException, std::exceptio
if(!m_aUserName.isEmpty() && m_aPassword.isEmpty() && m_pParentWindow)
{
SfxPasswordDialog* pPasswdDlg =
- new SfxPasswordDialog( m_pParentWindow );
+ VclPtr<SfxPasswordDialog>::Create( m_pParentWindow );
pPasswdDlg->SetMinLen( 0 );
if(RET_OK == pPasswdDlg->Execute())
m_aPassword = pPasswdDlg->GetPassword();
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index e96a838d79c6..61dcbd21964e 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -143,7 +143,7 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPag
SetMapMode( MapMode ( MAP_PIXEL ) );
// Create the line control
- m_pLine = new SwDashedLine( GetEditWin(), &SwViewOption::GetHeaderFooterMarkColor );
+ m_pLine = VclPtr<SwDashedLine>::Create( GetEditWin(), &SwViewOption::GetHeaderFooterMarkColor );
m_pLine->SetZOrder( this, WINDOW_ZORDER_BEFOR );
// Create and set the PopupMenu
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 703c8c176a10..d806eb332395 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -105,7 +105,7 @@ SwPageBreakWin::SwPageBreakWin( SwEditWin* pEditWin, const SwPageFrm* pPageFrm )
SetMapMode( MapMode ( MAP_PIXEL ) );
// Create the line control
- m_pLine = new SwBreakDashedLine( GetEditWin(), &SwViewOption::GetPageBreakColor, this );
+ m_pLine = VclPtr<SwBreakDashedLine>::Create( GetEditWin(), &SwViewOption::GetPageBreakColor, this );
// Create the popup menu
m_pPopupMenu = new PopupMenu( SW_RES( MN_PAGEBREAK_BUTTON ) );
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index ebd0021e8f22..05a9cd24ecc4 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -356,13 +356,13 @@ void SwSidebarWin::InitControls()
AddEventListener( LINK( this, SwSidebarWin, WindowEventListener ) );
// actual window which holds the user text
- mpSidebarTxtControl = new SidebarTxtControl( *this,
+ mpSidebarTxtControl = VclPtr<SidebarTxtControl>::Create( *this,
WB_NODIALOGCONTROL,
mrView, mrMgr );
mpSidebarTxtControl->SetPointer(Pointer(POINTER_TEXT));
// window controls for author and date
- mpMetadataAuthor = new Edit( this, 0 );
+ mpMetadataAuthor = VclPtr<Edit>::Create( this, 0 );
mpMetadataAuthor->SetAccessibleName( SW_RES( STR_ACCESS_ANNOTATION_AUTHOR_NAME ) );
mpMetadataAuthor->EnableRTL(AllSettings::GetLayoutRTL());
mpMetadataAuthor->SetReadOnly();
@@ -381,7 +381,7 @@ void SwSidebarWin::InitControls()
mpMetadataAuthor->SetSettings(aSettings);
}
- mpMetadataDate = new Edit( this, 0 );
+ mpMetadataDate = VclPtr<Edit>::Create( this, 0 );
mpMetadataDate->SetAccessibleName( SW_RES( STR_ACCESS_ANNOTATION_DATE_NAME ) );
mpMetadataDate->EnableRTL(AllSettings::GetLayoutRTL());
mpMetadataDate->SetReadOnly();
@@ -415,7 +415,7 @@ void SwSidebarWin::InitControls()
mpOutlinerView->SetAttribs(DefaultItem());
//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, SwSidebarWin, ScrollHdl));
diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx
index 3068102bcd8f..5d2dac64c01f 100644
--- a/sw/source/uibase/docvw/srcedtw.cxx
+++ b/sw/source/uibase/docvw/srcedtw.cxx
@@ -487,18 +487,18 @@ void TextViewOutWin::Paint( const Rectangle& rRect )
void SwSrcEditWindow::CreateTextEngine()
{
const Color &rCol = GetSettings().GetStyleSettings().GetWindowColor();
- pOutWin = new TextViewOutWin(this, 0);
+ pOutWin = VclPtr<TextViewOutWin>::Create(this, 0);
pOutWin->SetBackground(Wallpaper(rCol));
pOutWin->SetPointer(Pointer(POINTER_TEXT));
pOutWin->Show();
// create Scrollbars
- pHScrollbar = new ScrollBar(this, WB_3DLOOK |WB_HSCROLL|WB_DRAG);
+ pHScrollbar = VclPtr<ScrollBar>::Create(this, WB_3DLOOK |WB_HSCROLL|WB_DRAG);
pHScrollbar->EnableRTL( false ); // --- RTL --- no mirroring for scrollbars
pHScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl));
pHScrollbar->Show();
- pVScrollbar = new ScrollBar(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
+ pVScrollbar = VclPtr<ScrollBar>::Create(this, WB_3DLOOK |WB_VSCROLL|WB_DRAG);
pVScrollbar->EnableRTL( false ); // --- RTL --- no mirroring for scrollbars
pVScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl));
pHScrollbar->EnableDrag();
diff --git a/sw/source/uibase/envelp/syncbtn.cxx b/sw/source/uibase/envelp/syncbtn.cxx
index 2032aba3e633..e75751de5a31 100644
--- a/sw/source/uibase/envelp/syncbtn.cxx
+++ b/sw/source/uibase/envelp/syncbtn.cxx
@@ -37,7 +37,7 @@ SwSyncChildWin::SwSyncChildWin( vcl::Window* _pParent,
SfxChildWinInfo* pInfo ) :
SfxChildWindow( _pParent, nId )
{
- pWindow = new SwSyncBtnDlg( pBindings, this, _pParent);
+ pWindow = VclPtr<SwSyncBtnDlg>::Create( pBindings, this, _pParent);
if (!pInfo->aSize.Width() || !pInfo->aSize.Height())
{
diff --git a/sw/source/uibase/inc/workctrl.hxx b/sw/source/uibase/inc/workctrl.hxx
index 201510ccabc7..6586553eb569 100644
--- a/sw/source/uibase/inc/workctrl.hxx
+++ b/sw/source/uibase/inc/workctrl.hxx
@@ -152,7 +152,7 @@ public:
static OUString GetQuickHelpText(bool bNext);
- virtual SfxPopupWindow* Clone() const SAL_OVERRIDE;
+ virtual VclPtr<SfxPopupWindow> Clone() const SAL_OVERRIDE;
void GrabFocus() { m_pToolBox->GrabFocus(); }
};
diff --git a/sw/source/uibase/misc/glshell.cxx b/sw/source/uibase/misc/glshell.cxx
index fbbfd851d60b..d3f1e6952a65 100644
--- a/sw/source/uibase/misc/glshell.cxx
+++ b/sw/source/uibase/misc/glshell.cxx
@@ -248,7 +248,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const OUString& rGroup, const OUString
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
0 );
- SfxPrinter* pPrinter = new SfxPrinter( pSet );
+ VclPtr<SfxPrinter> pPrinter = VclPtr<SfxPrinter>::Create( pSet );
// and append it to the document.
xDocSh->GetDoc()->getIDocumentDeviceAccess().setPrinter( pPrinter, true, true );
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index 6d69bfaeee0e..e70a49840f68 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -67,7 +67,7 @@ SwRedlineAcceptChild::SwRedlineAcceptChild( vcl::Window* _pParent,
SfxChildWinInfo* pInfo ) :
SwChildWinWrapper( _pParent, nId )
{
- pWindow = new SwModelessRedlineAcceptDlg( pBindings, this, _pParent);
+ pWindow = VclPtr<SwModelessRedlineAcceptDlg>::Create( pBindings, this, _pParent);
static_cast<SwModelessRedlineAcceptDlg *>(pWindow.get())->Initialize(pInfo);
}
diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx
index 1d95bd2bc9ac..db2adb767018 100644
--- a/sw/source/uibase/misc/swruler.cxx
+++ b/sw/source/uibase/misc/swruler.cxx
@@ -41,7 +41,7 @@ SwCommentRuler::SwCommentRuler( SwViewShell* pViewSh, vcl::Window* pParent, SwEd
, mpSwWin(pWin)
, mbIsHighlighted(false)
, mnFadeRate(0)
-, maVirDev( new VirtualDevice(*this) )
+, maVirDev( VclPtr<VirtualDevice>::Create(*this) )
{
// Set fading timeout: 5 x 40ms = 200ms
maFadeTimer.SetTimeout(40);
diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx
index b2dc3c18c342..c20543cdd59e 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -58,8 +58,8 @@ SFX_IMPL_POS_CHILDWINDOW_WITHID( SwInputChild, FN_EDIT_FORMULA, SFX_OBJECTBAR_OB
SwInputWindow::SwInputWindow( vcl::Window* pParent, SfxBindings* pBind )
: ToolBox( pParent , SW_RES( RID_TBX_FORMULA )),
- aPos( new Edit(this, SW_RES(ED_POS))),
- aEdit( new InputEdit(this, WB_3DLOOK|WB_TABSTOP|WB_BORDER|WB_NOHIDESELECTION)),
+ aPos( VclPtr<Edit>::Create(this, SW_RES(ED_POS))),
+ aEdit( VclPtr<InputEdit>::Create(this, WB_3DLOOK|WB_TABSTOP|WB_BORDER|WB_NOHIDESELECTION)),
aPopMenu( SW_RES(MN_CALC_POPUP)),
pMgr(0),
pWrtShell(0),
@@ -625,7 +625,7 @@ SwInputChild::SwInputChild(vcl::Window* _pParent,
SfxChildWindow( _pParent, nId )
{
pDispatch = pBindings->GetDispatcher();
- pWindow = new SwInputWindow( _pParent, pBindings );
+ pWindow = VclPtr<SwInputWindow>::Create( _pParent, pBindings );
static_cast<SwInputWindow*>(pWindow.get())->ShowWin();
eChildAlignment = SfxChildAlignment::LOWESTTOP;
}
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index 3b5bc23807f5..869ac2a44f9e 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -398,7 +398,7 @@ SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference< XFrame >&
"modules/swriter/ui/floatingnavigation.ui", rFrame),
aIList(SW_RES(IL_VALUES))
{
- m_pToolBox = new SwScrollNaviToolBox(get<vcl::Window>("box"), this, 0);
+ m_pToolBox = VclPtr<SwScrollNaviToolBox>::Create(get<vcl::Window>("box"), this, 0);
get(m_pInfoField, "label");
sal_uInt16 i;
@@ -477,9 +477,9 @@ void SwScrollNaviPopup::ApplyImageList()
}
}
-SfxPopupWindow* SwScrollNaviPopup::Clone() const
+VclPtr<SfxPopupWindow> SwScrollNaviPopup::Clone() const
{
- return new SwScrollNaviPopup( GetId(), GetFrame(), GetParent() );
+ return VclPtr<SwScrollNaviPopup>::Create( GetId(), GetFrame(), GetParent() );
}
IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet)